You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-libtestArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.
When running cargo test -- --logfile log.txt, all testers will write their logs into log.txt, meaning that for project with more than 1 test executable, this will result in log.txt being overridden by the last test run.
Steps
Create a project with 2 different test modules. 2 different tester executables will be created when running cargo --test
Possible Solution(s)
Introduce new command line argument such as --logsuffix and --logdir. The tester will append a random string to the log name. Example:
mkdir out
cargo test -- --logdir "out" --logsuffix "-ut.txt"# Tests running...
ls out/
{tester_name}-{random_1}-ut.txt {tester_name}-{random_2}-ut.txt {tester_name}-{random_3}-ut.txt
Notes
The proposed solution will be especially useful when dealing with CI systems, needing to consume JUint reports (where piping result to a single file wouldn't work because it won't be a valid XML):
mkdir out
cargo test -- -Z unstable-options --format junit --report-time --logdir "out" --logsuffix "-ut.xml"# Tests running# Let CI digest out/ dir *-ut.xml files
Version
cargo 1.65.0 (4bc8f24d3 2022-10-20)
The text was updated successfully, but these errors were encountered:
A-libtestArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.
Problem
When running
cargo test -- --logfile log.txt
, all testers will write their logs intolog.txt
, meaning that for project with more than 1 test executable, this will result inlog.txt
being overridden by the last test run.Steps
Create a project with 2 different test modules. 2 different tester executables will be created when running
cargo --test
Possible Solution(s)
Introduce new command line argument such as
--logsuffix
and--logdir
. The tester will append a random string to the log name. Example:Notes
The proposed solution will be especially useful when dealing with CI systems, needing to consume JUint reports (where piping result to a single file wouldn't work because it won't be a valid XML):
Version
The text was updated successfully, but these errors were encountered: