Skip to content

Coverage for binary tests #1489

@LesnyRumcajs

Description

@LesnyRumcajs

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

  • Investigate how we can make binary tests with coverage check (most likely it should be one binary for most cases, except where some fancy features are used)
  • Implement the change

Acceptance Criteria

  • main is at least partially covered
  • coverage step does not take significantly more time than before

Other information and links

assert-rs/assert_cmd#57
https://docs.rs/escargot/latest/escargot/
xd009642/tarpaulin#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())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions