-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter to only run integration tests. #8396
Comments
I'd like to take this, if no one else has started work on it. I read in the docs that integration tests are generally put in |
I'm curious if either of you could state your motivation for this? From my perspective, the unit tests are just another testable thing, so I'm uncertain why you would want to specifically exclude them. As for a design/implementation perspective, I was wondering if maybe it would be better to add globbing to the target names instead of adding new flags? Perhaps something like |
The motivation in my case is kind of a "We probably shouldn't be doing it like this" situation. Historically the project I'm working on has unit-tests that are meant to be executed on the host system. I'm now working on integration tests and those target our target platform, so compiling both at the same time doesn't really work. Of course in the long run our unit-tests should also be able to run on our target platform, but that is currently not the case. Regarding globbing: I personally would like globbing to be available for |
With |
Ah, okay. The only thing that might be a bit confusing is that |
I need that feature too - in Gitlab yaml I have 2 different stages: |
Interesting... This crunch dont work for me because I customize This is how it looks like: > cargo test --test '*'
error: no test target named `*` > cargo test --tests get_video_events
Finished test [unoptimized + debuginfo] target(s) in 0.15s
Running {my_home_dir}/rust_build_artifacts/debug/deps/{project_name}-9598706256c32c7d
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out
Running {my_home_dir}/rust_build_artifacts/debug/deps/{test_file_1}-28b3cb4b0c341f41
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Running {my_home_dir}/rust_build_artifacts/debug/deps/{test_file_2}-d0642ae53302a48c
running 0 tests |
@invis87 |
I'm going to close this as fixed by #8752. It now adds the syntax |
👋🏻 probably a silly question but re:
Why does that only match integration tests? I expect the glob to match every test (unit and integration). |
@Integralist Because
|
See also: rust-lang/cargo#8396 Signed-off-by: Knut Borchers <knut.borchers@gmail.com>
Perhaps, we can revisit the issue since the |
Describe the problem you are trying to solve
Currently
cargo test --tests
runs both unit and integration tests. Usingcargo test --lib
runs only the unit-tests of the library, however there is no way to only let the integration tests run, apart from maybe using a naming scheme for the integration tests, which I would like to avoid. It's also possible to write a script which callscargo test --test <name>
for each.rs
file in the tests folder, but again, this is something I would like to avoid.Describe the solution you'd like
I would like to run only the integration tests with e.g.
cargo test --integration_tests
.Notes
Looking into
libtest
the enumTestType
seems to already provide the necessary information.The text was updated successfully, but these errors were encountered: