Skip to content

Long runtimes for integration tests #845

@simonsan

Description

@simonsan

https://github.com/iqlusioninc/abscissa/blob/main/cli/template/tests/acceptance.rs.hbs#L31

I built an integration tests with some stages, unfortunately the default configuration of the CmdRunner invokes cargo each time which rebuilds/checks the binary each time as well. There was a huge performance penalty because of that. When I initialized the CmdRunner with:

pub static RUNNER: Lazy<CmdRunner> = Lazy::new(|| {
    let mut runner = CmdRunner::new(env!("CARGO_BIN_EXE_RUSTIC"));
    runner.exclusive().capture_stdout();
    runner
});

the gain was huge, tests that ran 90 seconds on my device ran in 1 second.

2023-05-09 09_20_56-Environment Variables - The Cargo Book — Mozilla Firefox

src.: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates

Is there any downsides about this, that I don't understand/know? If not, would it be reasonable to adopt that as a default option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions