From 52d18b8d26cb6ab637da148d1fe196ad520b5f4e Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 30 Jul 2024 14:19:53 +0200 Subject: [PATCH 1/4] run ci tests using nextest Signed-off-by: Reuben Miller --- .config/nextest.toml | 3 +++ .github/workflows/pull-request-checks.yml | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 00000000000..605251d873f --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,3 @@ +[profile.default] +retries = 0 +test-threads = "num-cpus" 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 From 901a380f79a6fca8907ec7baf768a95e0b981f60 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 30 Jul 2024 14:20:03 +0200 Subject: [PATCH 2/4] ignore code coverage report Signed-off-by: Reuben Miller --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From 44faf26f10bb328cd2260f97f8b3db7ee90e1419 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 30 Jul 2024 14:20:54 +0200 Subject: [PATCH 3/4] split build tasks to allow running cargo tests and doc tests individually Signed-off-by: Reuben Miller --- justfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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: From d5756851427121efdc85553980ac5c86639c2c5f Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Tue, 30 Jul 2024 16:07:27 +0200 Subject: [PATCH 4/4] add retry config for flaky unit test Signed-off-by: Reuben Miller --- .config/nextest.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/nextest.toml b/.config/nextest.toml index 605251d873f..1c1eb801854 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -1,3 +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