Open Bug 1796194 Opened 3 years ago Updated 3 years ago

Rust tests don't run integration tests with features

Categories

(Firefox Build System :: General, defect, P3)

defect

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.

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).

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.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.