cargo test takes a long time with because the first run of main_binary takes a long time while holding the cargo locking, blocking other tests
Example
running 6 tests
test blackbox_backup ... test blackbox_backup has been running for over 60 seconds
test blackbox_help ... test blackbox_help has been running for over 60 seconds
test blackbox_help ... ok
test blackbox_no_args ... ok
test clean_error_on_non_archive ... ok
test empty_archive ... ok
test incomplete_version ... ok
test blackbox_backup ... ok
From https://ci.appveyor.com/project/sourcefrog/conserve/builds/20036005
Cause
- If a bare
cargo test is run, cargo uses target/debug for the OUT_DIR
main_binary passes --target <TRIPLET> to cargo which changes the OUT_DIR to target/<TRIPLE>/debug
- This means
cargo tests build artifacts cannot be reused and those parts need to be rebuilt
Background:
In Issue #4 we had to choose between performance and correctness (if you do specify --target, main_binary should run that target's bin) and sided on correctness
Workarounds
-
Call into escargot without passing in current_target
-
Call cargo test --target <TRIPLE>
cargo testtakes a long time with because the first run ofmain_binarytakes a long time while holding thecargolocking, blocking other testsExample
From https://ci.appveyor.com/project/sourcefrog/conserve/builds/20036005
Cause
cargo testis run,cargousestarget/debugfor theOUT_DIRmain_binarypasses--target <TRIPLET>tocargowhich changes theOUT_DIRtotarget/<TRIPLE>/debugcargo tests build artifacts cannot be reused and those parts need to be rebuiltBackground:
In Issue #4 we had to choose between performance and correctness (if you do specify
--target,main_binaryshould run that target'sbin) and sided on correctnessWorkarounds
Call into escargot without passing in
current_targetCall
cargo test --target <TRIPLE>