зеркало из https://github.com/mozilla/sccache.git
edf0ac5176
* Refactor sccache cargo test - Improve cleanup by using Result instead of panicking, to ensure that the temporary folder gets cleaned up. Previously, when a test failed, no clean up would happen. Now the cleanup happens, unless there is an unexpected panic somewhere in the intergration test code. - this commit aims to make it easier to add new tests Split sccache cargo tests To make it clearer what is failing, split the cargo test into multiple tests. Since Sccache can't be invoked in parallel, we use the `serial_test` to serialize testing,otherwise cargo by default would start them in parallel. The logger is now also lazily initialized, so the first test to run will initialize it. It now writes a linebreak, because otherwise the output is hard to read with `RUST_LOG=debug cargo test --test sccache_cargo -- --nocapture`. We catch panics (which are not intended by the tests ) to ensure that the temporary directory for the test gets cleaned up. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Remove panic=abort from CI coverage test I suspect the commandline was just taken like that from the example here: https://doc.rust-lang.org/stable/unstable-book/compiler-flags/profile.html However, there seems to be no reason to actually abort, since we don't have a custom test harness or anything. Since we want to catch panics, so we can correctly clean up, we need panic=unwind. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Parse env_deps from dep-info This will trigger rebuilds if environment variables changed that the rust code depended on with env!. On the Rust side this requires at least Rust 1.46, otherwise there will be no env-dep info in the dep-info file. In that case we cannot detect the dependency on the env-value, and behaviour is unchanged compared to the current sccache behaviour. With recent Rust versions however, we can trigger a rebuild if a variable that is referenced via env! or option_env! is changed. Other env variables like `CARGO_*` or `RUSTFLAGS` which may affect the compilation are not listed in the dep-info file, so they have to be blanket added (as is currently already the case). Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Add test for cargo env_deps The previous commit added support for parsing "env_dep" information from dep_info files. This commit adds a test for changing an environment variable, that is referenced in rust code via env!, and asserts that sccache rebuilds and the rust code uses the new value of the changed environment variable. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> |
||
---|---|---|
.. | ||
Configuration.md | ||
Distributed.md | ||
DistributedQuickstart.md | ||
Jenkins.md | ||
Releasing.md | ||
Rust.md |