ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
635 stars 154 forks source link

Coverage for binary tests #1489

Closed LesnyRumcajs closed 2 years ago

LesnyRumcajs commented 2 years ago

Issue summary

Coverage reports are missing runs where the forest binary is executed directly, e.g. cli tests. Some attempts were made with adding --follow-exec to tarpaulin (perhaps the executed binary was not the instrumented one) or creating explicitly an instrumented binary (which was severely timing out, >20mins).

Task summary

Acceptance Criteria

Other information and links

https://github.com/assert-rs/assert_cmd/issues/57 https://docs.rs/escargot/latest/escargot/ https://github.com/xd009642/tarpaulin/issues/105

An attempt at building instrumented binary once for all tests

lazy_static!(
    static ref FOREST_BINARY: CargoRun = {
    escargot::CargoBuild::new()
        .bin("forest")
        .current_release()
        .current_target()
        .run()
        .unwrap()
    };
);

// then use with: let cmd = Command::new(FOREST_BINARY.path())
lemmih commented 2 years ago

This might be solvable once #1558 lands.

lemmih commented 2 years ago

cargo llvm-cov magically does the right thing. We have good coverage and it doesn't significantly impact testing time.