Skip to content

Commit

Permalink
Merge pull request #3027 from reubenmiller/ci-nextest
Browse files Browse the repository at this point in the history
ci: run tests using cargo-nextest
  • Loading branch information
reubenmiller authored Jul 30, 2024
2 parents 123e1d4 + d575685 commit c531450
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[profile.default]
retries = 0
test-threads = "num-cpus"

[[profile.default.overrides]]
# Remove once https://github.com/thin-edge/thin-edge.io/issues/3021 is resolved
filter = 'test(bridge_reconnects_successfully_after_local_connection_interrupted)'
retries = 4
5 changes: 4 additions & 1 deletion .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,14 @@ jobs:
- name: Enable cache
uses: Swatinem/rust-cache@v2

- name: Install latest nextest release
uses: taiki-e/install-action@nextest

- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov

- name: cargo llvm-cov
run: cargo llvm-cov --no-fail-fast --locked --all-features --all-targets --codecov --output-path codecov.json
run: cargo llvm-cov nextest --no-fail-fast --locked --all-features --all-targets --codecov --output-path codecov.json

# https://github.com/rust-lang/cargo/issues/6669
- name: cargo test --doc
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ tedge-private-key.pem
_CHANGELOG.md

#
mutants.out*
mutants.out*
codecov.json
14 changes: 11 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,18 @@ check TARGET=DEFAULT_TARGET:
release *ARGS:
ci/build_scripts/build.sh {{ARGS}}

# Run unit and doc tests
test *ARGS:
just -f {{justfile()}} test-unit {{ARGS}}
just -f {{justfile()}} test-docs

# Run unit tests
test:
cargo nextest run --no-fail-fast --all-features --all-targets
cargo test --doc --no-fail-fast --all-features
test-unit *ARGS:
cargo nextest run --no-fail-fast --all-features --all-targets {{ARGS}}

# Run doc tests
test-docs *ARGS:
cargo test --doc --no-fail-fast --all-features {{ARGS}}

# Install integration test dependencies
setup-integration-test *ARGS:
Expand Down

0 comments on commit c531450

Please sign in to comment.