Replies: 1 comment 2 replies
-
I agree, the way Rust tests are run in parallel and with multiple executables makes it very difficult to get the information we need
This could (if we don't get a lot of race conditions) tell us whether or not the current test executable is the first one to run, but we still can tell whether the current test inside that executable is the first to run |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@escritorio-gustavo
Regarding this comment of mine:
When attempting to do this without the CLI,
static
s are pretty useless as soon as there are multiple test executables.So the only valid alternative to keep state is the filesystem. Here's how a test would need to look like:
The big question here is how to implement the red square, "is this the first test to run?".
For one, that question only makes sense when running just
cargo test
. Users could, of course, just run the test executables manually.Besides that, I'm not sure how I'd even attempt to answer the question "is this the first test to run?". Maybe by having each
#[test]
appendstd::env::current_exe()
to the metadata file, and comparing the paths of the executables in the metadata file with what's present undertarget/
?So yeah, this get's suuper complicated and messy, unless I'm missing something here.
Beta Was this translation helpful? Give feedback.
All reactions