diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 00000000000..1c1eb801854 --- /dev/null +++ b/.config/nextest.toml @@ -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 diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index c09c40830ac..3c07e1c9eb9 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -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 diff --git a/.gitignore b/.gitignore index 41204d6908b..a374c3e8608 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,5 @@ tedge-private-key.pem _CHANGELOG.md # -mutants.out* \ No newline at end of file +mutants.out* +codecov.json diff --git a/justfile b/justfile index a70d81bcfd1..1fe6ee28fb5 100644 --- a/justfile +++ b/justfile @@ -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: