From f7fb6560bd55d9f583230f5d08c851e0c4175ddc Mon Sep 17 00:00:00 2001 From: alcroito Date: Sun, 24 Sep 2023 17:19:38 +0200 Subject: [PATCH] build: Use nextest cargo test runner in CI Supports retries for flaky failures. Use 3 retries. Also limit the db test to run in a separate process, so that diesel_migration harness doesn't fail with an I/O error. --- .config/nextest.toml | 16 ++++++++++++++++ .github/workflows/ci.yaml | 7 +++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000..eba2aaa --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,16 @@ +[profile.ci] +# Don't fail fast in CI to run the full test suite. +fail-fast = false +failure-output = "immediate-final" +retries = 3 + +[test-groups] +serial-integration = { max-threads = 1 } + +[[profile.default.overrides]] +filter = 'test(db::logic::tests::test_do_ops_with_db)' +test-group = 'serial-integration' + +[[profile.ci.overrides]] +filter = 'test(db::logic::tests::test_do_ops_with_db)' +test-group = 'serial-integration' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7be33a2..7f48d5e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -164,8 +164,11 @@ jobs: - name: Create dummy web artifacts run: mkdir -p webclients/svelte/build - - name: Run cargo test - run: cargo test ${{ matrix.features && '--features' }} ${{ matrix.features }} ${{ matrix.release && '--release' || '' }} ${{ matrix.no_default_features && '--no-default-features' || '' }} ${{ matrix.all_features && '--all-features' || '' }} + - name: Install latest nextest release + uses: taiki-e/install-action@nextest + + - name: Run cargo nextest + run: cargo nextest run --profile ci ${{ matrix.features && '--features' }} ${{ matrix.features }} ${{ matrix.release && '--release' || '' }} ${{ matrix.no_default_features && '--no-default-features' || '' }} ${{ matrix.all_features && '--all-features' || '' }} env: RUST_BACKTRACE: full