Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize integration tests as one crate with many modules #4867

Closed
matklad opened this issue Dec 27, 2017 · 3 comments
Closed

Reorganize integration tests as one crate with many modules #4867

matklad opened this issue Dec 27, 2017 · 3 comments
Labels
A-cargo-api Area: cargo-the-library API and internal code issues C-cleanup Category: cleanup within the codebase E-easy Experience: Easy

Comments

@matklad
Copy link
Member

matklad commented Dec 27, 2017

Currently, Cargo has a huge amount of integration tests. The problem with them is that each test is a separate artifact, and each tests gets a copy of Cargo linked in. This leads to a HUGE ./target directory after cargo test, about 7 GB.

What if instead we have only one crate with integration tests, which consists of a number of submodules? That is, to have this layout

tests/
  cargosuite/
    main.rs # <- mod build; mod run; mod test; mod publish;
    build.rs
    run.rs
    test.rs
    publish.rs
@matklad matklad added A-cargo-api Area: cargo-the-library API and internal code issues C-cleanup Category: cleanup within the codebase E-easy Experience: Easy labels Dec 27, 2017
@alexcrichton
Copy link
Member

This may no longer be a problem with incremental compilation, but historically I haven't done this because it makes compilation time for tests huge. Would just want to be sure that editing tests doesn't take minutes to get a new artifact!

@matklad
Copy link
Member Author

matklad commented Dec 27, 2017

Would just want to be sure that editing tests doesn't take minutes to get a new artifact!

Yeah, the alternative would be for tests not to link with cargo. I think it is possible to achieve, but will require moderately more complicated changes. Not that we need to do anything with tests right now, but it would be great to fix it one day :)

@rochamatcomp
Copy link
Contributor

I can try to do.

bors added a commit that referenced this issue Feb 21, 2018
Reorganize integration tests as one crate with many modules. Issue #4867. Rebased V3

This is an automatic rebase of @rochamatcomp's work in #5022, as requested in [#5038](#5038 (comment)).

I take no credit for the changes; I just wanted faster test for my work. :-)
@matklad matklad closed this as completed Mar 6, 2018
nicopado added a commit to input-output-hk/catalyst-core that referenced this issue Jun 19, 2023
Proposing new integration tests structure ispired by
rust-lang/cargo#4867
Example:
```
tests/
       component/
             main.rs
             component1.rs
             component2.rs
      integration/
              main.rs
              component1_component2.rs
      end2end/
             main.rs
             voting.rs       
      non_functional/
                main.rs
                load.rs
```
In this way we will have 4 crates. Performances could be improved by
having only one crate but I think the structure will became to messy
Ideas welcome @nicopado @stevenj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo-api Area: cargo-the-library API and internal code issues C-cleanup Category: cleanup within the codebase E-easy Experience: Easy
Projects
None yet
Development

No branches or pull requests

3 participants