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

test: Run tests faster with nextest #778

Merged
merged 5 commits into from
Jun 22, 2022
Merged

Commits on Jun 22, 2022

  1. test: Run tests faster with nextest.

    > [`cargo-nextest`](https://nexte.st/index.html) is a next-generation
    > test runner for Rust projects.
    
    This patch installs and uses `nextest` to run our own tests.
    
    Comparing `cargo test` and `cargo nextest` with hyperfine provides the
    following results:
    
    ```sh
    $ hyperfine 'cargo test --workspace' 'cargo nextest run --workspace && cargo test --doc'
    Benchmark 1: cargo test --workspace
      Time (mean ± σ):     51.785 s ±  2.066 s    [User: 183.471 s, System: 10.563 s]
      Range (min … max):   49.151 s … 56.641 s    10 runs
    
    Benchmark 2: cargo nextest run --workspace && cargo test --doc
      Time (mean ± σ):     44.556 s ±  0.894 s    [User: 192.213 s, System: 11.441 s]
      Range (min … max):   43.170 s … 45.762 s    10 runs
    ```
    
    Benchmark 2 is 1.16 times faster than Benchmark 1.
    Hywan committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    399862d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d9475c1 View commit details
    Browse the repository at this point in the history
  3. test: Run doctests manually.

    `cargo-nextest` doesn't support doctests for now, so we must run them
    “manually” by running a separate `cargo test --doc` command.
    Hywan committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    eb33333 View commit details
    Browse the repository at this point in the history
  4. test: Add missing cargo-nextest installation.

    This patch also changes the step's name from Clippy to Test.
    Hywan committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    3bfc68d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b0d51fd View commit details
    Browse the repository at this point in the history