Rust tests don't run integration tests with features
Categories
(Firefox Build System :: General, defect, P3)
Tracking
(Not tracked)
People
(Reporter: gregtatum, Unassigned)
Details
The L10nRegistry was originally written out of tree and then migrated in. When running ./mach rusttests the unit tests and docs tests correctly run.
0:09.91 Running unittests src/lib.rs (/Users/greg/dev/gecko/obj-ff-release/x86_64-apple-darwin/release/deps/l10nregistry-2922a2fc815d9b72)
0:09.92 running 1 test
0:09.92 test source::tests::calculate_source_pos ... ok
0:09.92 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
...
2:22.22 Doc-tests l10nregistry
2:22.37 running 0 tests
2:22.37 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
However there are also integration tests for l10nregistry-rs defined in the Cargo.toml. Locally I can run them doing:
cd intl/l10n/rust/l10nregistry-rs
cargo test --all-features
However, these are not running in CI nor with mach rusttests. I tried looking a bit at the rusttests implementation, but couldn't really make sense of how it all works and actually runs the tests.
Comment 1•3 years ago
|
||
I don't think we can make mach rusttests run tests with --all-features, because that would mean doing so for everything, and everything doesn't like enabling all their features (for a start, there are features we don't enable that rely on crates we don't even vendor).
| Reporter | ||
Comment 2•3 years ago
|
||
Would it be possible to teach the infrastructure to run certain combinations of features for a given crate? It sounds like this might be a limitation of the current implementation. I couldn't figure out how exactly the current code is running the tests.
Not being able to control the testing environment for non-vendored crates seems like a major limitation to using Rust in Gecko.
Comment 3•3 years ago
|
||
You can enable individual features. https://firefox-source-docs.mozilla.org/testing-rust-code/index.html#rust-tests
Updated•3 years ago
|
Description
•