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

Testssuite #5022

Closed
wants to merge 2 commits into from
Closed

Testssuite #5022

wants to merge 2 commits into from

Conversation

rochamatcomp
Copy link
Contributor

Reorganize integration tests as one crate with many modules #4867.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matklad (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@matklad
Copy link
Member

matklad commented Feb 8, 2018

Excellent @rochamatcomp!

Could you do some measurements to test that it actually improves things instead of making them worse?

I think the following metrics are interesting (before and after this change):

  1. the size of /target directory after cargo test --no-run
  2. the time to compile the tests (first, cargo build --lib && cargo build --bin to build cargo itself, then actually measure cargo test --no-run)
  3. the time to recompile a single test after Cargo library is edited
  4. the time to recompile a single test after the test itself is edited

@matklad
Copy link
Member

matklad commented Feb 8, 2018

Oh, because we'd want to take advantage of incremental compilation, I think it makes sense to do the measurements using the current beta.

@rochamatcomp
Copy link
Contributor Author

rustup show
beta-x86_64-unknown-linux-gnu (default)
rustc 1.24.0-beta.11 (03f456d3c 2018-02-03)

  1. the time to compile the tests (before cargo build);
  2. the time to compile the tests (after cargo build);
  3. the time to recompile a single test after Cargo library is edited;
  4. the time to recompile a single test after the test itself is edited.

The time in seconds.

Test Command Original Testsuite Absolute diff Relative diff (%)
1 cargo test --no-run 125.64 73.40 -52.24 -41.58
2 cargo build --lib 56.15 55.83 -0.32 -0.57
cargo build --bins 9.41 9.42 +0.01 +0.11
cargo test --no-run (after cargo build) 68.87 19.95 -48.92 -71.03
TOTAL 134.43 85.20 -49.23 -36.62
3 cargo test build --no-run (after Cargo library edit) 56.33 11.62 -44.71 -79.37
4 cargo test build --no-run (after test build.rs edit) 3.38 4.96 +1.58 +46,75
  1. The size of /target directory in gigabytes.
Test Command Original Testsuite Absolute diff Relative diff (%)
1 du -hs target/ 5.8 1.1 -4.7 -81.04

@matklad
Copy link
Member

matklad commented Feb 10, 2018

Awww, awesome, @rochamatcomp !

@alexcrichton seems like a massive win overall to me, what would you think?

@alexcrichton
Copy link
Member

Thanks for getting those numbers! I'm game for merging.

@matklad
Copy link
Member

matklad commented Feb 11, 2018

@rochamatcomp could you rebase the PR so that it merges cleanly?

bors added a commit that referenced this pull request 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. :-)
CBenoit added a commit to Devolutions/IronRDP that referenced this pull request May 10, 2023
Put all integration tests in a single crate, and organized in modules.

This is similar to what was done in `cargo` repository:
rust-lang/cargo#5022 (comment)

```
$ rustup show
stable-x86_64-unknown-linux-gnu (default)
rustc 1.69.0 (84c898d65 2023-04-16)
```

Run on a recent high-end laptop:
12th Gen Intel(R) Core(TM) i9-12900HK

Original (multiple integration binaries):

- `cargo clean && cargo test --no-run`: 62.893s
- `cargo clean && cargo build --lib`: 54.959s
- `cargo clean && cargo build --bins`: 55.933s
- `cargo test --no-run` (after `cargo build`): 14.472s
- `cargo test` (after `cargo test --no-run`): 1.786s
- `du -hs target/`: 4.2G

After (ironrdp-testsuite):

- `cargo clean && cargo test --no-run`: 41.157s (crates with no tests are ignored)
- `cargo clean && cargo build --lib`: 53.983s
- `cargo clean && cargo build --bins`: 54.482s
- `cargo test --no-run` (after `cargo build`): 12.915s
- `cargo test` (after `cargo test --no-run`): 0.240s
- `du -hs target/`: 3.4G

Absolute diff:
- `cargo clean && cargo test --no-run`: -21.736s
- `cargo clean && cargo build --lib`: -0.976s
- `cargo clean && cargo build --bins`: -1.451s
- `cargo test --no-run` (after `cargo build`): -1.557s
- `cargo test` (after `cargo test --no-run`): -1.546s
- `du -hs target/`: -0.8G

Relative diff (%):
- `cargo clean && cargo test --no-run`: -34.5%
- `cargo clean && cargo build --lib`: -1.77%
- `cargo clean && cargo build --bins`: -2.59%
- `cargo test --no-run` (after `cargo build`): -10.7%
- `cargo test` (after `cargo test --no-run`): -86.5%
- `du -hs target/`: -19.0%
CBenoit added a commit to Devolutions/IronRDP that referenced this pull request May 10, 2023
Put all integration tests in a single crate, and organized in modules.

This is similar to what was done in `cargo` repository:
rust-lang/cargo#5022 (comment)

```
$ rustup show
stable-x86_64-unknown-linux-gnu (default)
rustc 1.69.0 (84c898d65 2023-04-16)
```

Run on a recent high-end laptop:
12th Gen Intel(R) Core(TM) i9-12900HK

Original (multiple integration binaries):

- `cargo clean && cargo test --no-run`: 62.893s
- `cargo clean && cargo build --lib`: 54.959s
- `cargo clean && cargo build --bins`: 55.933s
- `cargo test --no-run` (after `cargo build`): 14.472s
- `cargo test` (after `cargo test --no-run`): 1.786s
- `du -hs target/`: 4.2G

After (ironrdp-testsuite):

- `cargo clean && cargo test --no-run`: 41.157s (crates with no tests are ignored)
- `cargo clean && cargo build --lib`: 53.983s
- `cargo clean && cargo build --bins`: 54.482s
- `cargo test --no-run` (after `cargo build`): 12.915s
- `cargo test` (after `cargo test --no-run`): 0.240s
- `du -hs target/`: 3.4G

Absolute diff:
- `cargo clean && cargo test --no-run`: -21.736s
- `cargo clean && cargo build --lib`: -0.976s
- `cargo clean && cargo build --bins`: -1.451s
- `cargo test --no-run` (after `cargo build`): -1.557s
- `cargo test` (after `cargo test --no-run`): -1.546s
- `du -hs target/`: -0.8G

Relative diff (%):
- `cargo clean && cargo test --no-run`: -34.5%
- `cargo clean && cargo build --lib`: -1.77%
- `cargo clean && cargo build --bins`: -2.59%
- `cargo test --no-run` (after `cargo build`): -10.7%
- `cargo test` (after `cargo test --no-run`): -86.5%
- `du -hs target/`: -19.0%
CBenoit added a commit to Devolutions/IronRDP that referenced this pull request May 11, 2023
Put all integration tests in a single crate, and organized in modules.

This is similar to what was done in `cargo` repository:
rust-lang/cargo#5022 (comment)

```
$ rustup show
stable-x86_64-unknown-linux-gnu (default)
rustc 1.69.0 (84c898d65 2023-04-16)
```

Run on a recent high-end laptop:
12th Gen Intel(R) Core(TM) i9-12900HK

Original (multiple integration binaries):

- `cargo clean && cargo test --no-run`: 62.893s
- `cargo clean && cargo build --lib`: 54.959s
- `cargo clean && cargo build --bins`: 55.933s
- `cargo test --no-run` (after `cargo build`): 14.472s
- `cargo test` (after `cargo test --no-run`): 1.786s
- `du -hs target/`: 4.2G

After (ironrdp-testsuite):

- `cargo clean && cargo test --no-run`: 41.157s (crates with no tests are ignored)
- `cargo clean && cargo build --lib`: 53.983s
- `cargo clean && cargo build --bins`: 54.482s
- `cargo test --no-run` (after `cargo build`): 12.915s
- `cargo test` (after `cargo test --no-run`): 0.240s
- `du -hs target/`: 3.4G

Absolute diff:
- `cargo clean && cargo test --no-run`: -21.736s
- `cargo clean && cargo build --lib`: -0.976s
- `cargo clean && cargo build --bins`: -1.451s
- `cargo test --no-run` (after `cargo build`): -1.557s
- `cargo test` (after `cargo test --no-run`): -1.546s
- `du -hs target/`: -0.8G

Relative diff (%):
- `cargo clean && cargo test --no-run`: -34.5%
- `cargo clean && cargo build --lib`: -1.77%
- `cargo clean && cargo build --bins`: -2.59%
- `cargo test --no-run` (after `cargo build`): -10.7%
- `cargo test` (after `cargo test --no-run`): -86.5%
- `du -hs target/`: -19.0%
CBenoit added a commit to Devolutions/IronRDP that referenced this pull request May 11, 2023
Put all integration tests in a single crate, and organized in modules.

This is similar to what was done in `cargo` repository:
rust-lang/cargo#5022 (comment)

```
$ rustup show
stable-x86_64-unknown-linux-gnu (default)
rustc 1.69.0 (84c898d65 2023-04-16)
```

Run on a recent high-end laptop:
12th Gen Intel(R) Core(TM) i9-12900HK

Original (multiple integration binaries):

- `cargo clean && cargo test --no-run`: 62.893s
- `cargo clean && cargo build --lib`: 54.959s
- `cargo clean && cargo build --bins`: 55.933s
- `cargo test --no-run` (after `cargo build`): 14.472s
- `cargo test` (after `cargo test --no-run`): 1.786s
- `du -hs target/`: 4.2G

After (ironrdp-testsuite):

- `cargo clean && cargo test --no-run`: 41.157s (crates with no tests are ignored)
- `cargo clean && cargo build --lib`: 53.983s
- `cargo clean && cargo build --bins`: 54.482s
- `cargo test --no-run` (after `cargo build`): 12.915s
- `cargo test` (after `cargo test --no-run`): 0.240s
- `du -hs target/`: 3.4G

Absolute diff:
- `cargo clean && cargo test --no-run`: -21.736s
- `cargo clean && cargo build --lib`: -0.976s
- `cargo clean && cargo build --bins`: -1.451s
- `cargo test --no-run` (after `cargo build`): -1.557s
- `cargo test` (after `cargo test --no-run`): -1.546s
- `du -hs target/`: -0.8G

Relative diff (%):
- `cargo clean && cargo test --no-run`: -34.5%
- `cargo clean && cargo build --lib`: -1.77%
- `cargo clean && cargo build --bins`: -2.59%
- `cargo test --no-run` (after `cargo build`): -10.7%
- `cargo test` (after `cargo test --no-run`): -86.5%
- `du -hs target/`: -19.0%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants