From 4a0808ed791ecbfae2dbc55aec726b317524b35d Mon Sep 17 00:00:00 2001 From: Adam Kern Date: Mon, 26 May 2025 14:29:52 -0400 Subject: [PATCH 1/3] Moves scripts and CI/CD to nextest --- .github/workflows/ci.yaml | 4 +--- scripts/all-tests.sh | 14 +++++++------- scripts/blas-integ-tests.sh | 4 ++-- scripts/miri-tests.sh | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13fb9d0d6..60f824791 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -118,8 +118,6 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install openblas run: sudo apt-get install libopenblas-dev gfortran - - run: cargo tree -p blas-tests -i openblas-src -F blas-tests/openblas-system - - run: cargo tree -p blas-tests -i openblas-build -F blas-tests/openblas-system - run: ./scripts/blas-integ-tests.sh $BLAS_MSRV miri: @@ -169,7 +167,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install cargo-careful run: cargo install cargo-careful - - run: cargo careful test -Zcareful-sanitizer --features="$FEATURES" + - run: cargo careful nextest run -Zcareful-sanitizer --features="$FEATURES" docs: #if: ${{ github.event_name == 'merge_group' }} diff --git a/scripts/all-tests.sh b/scripts/all-tests.sh index 612a7d758..4135ebeb8 100755 --- a/scripts/all-tests.sh +++ b/scripts/all-tests.sh @@ -12,23 +12,23 @@ QC_FEAT=--features=ndarray-rand/quickcheck cargo build -v --no-default-features # ndarray with no features -cargo test -p ndarray -v --no-default-features +cargo nextest run -p ndarray -v --no-default-features # ndarray with no_std-compatible features -cargo test -p ndarray -v --no-default-features --features approx +cargo nextest run -p ndarray -v --no-default-features --features approx # all with features -cargo test -v --features "$FEATURES" $QC_FEAT +cargo nextest run -v --features "$FEATURES" $QC_FEAT # all with features and release (ignore test crates which is already optimized) -cargo test -v -p ndarray -p ndarray-rand --release --features "$FEATURES" $QC_FEAT --lib --tests +cargo nextest run -v -p ndarray -p ndarray-rand --release --features "$FEATURES" $QC_FEAT --lib --tests # BLAS tests -cargo test -p ndarray --lib -v --features blas -cargo test -p blas-mock-tests -v +cargo nextest run -p ndarray --lib -v --features blas +cargo nextest run -p blas-mock-tests -v if [[ -z "${MSRV}" ]] && [ "$CHANNEL" != "$MSRV" ]; then ./scripts/blas-integ-tests.sh "$FEATURES" $CHANNEL fi # Examples -cargo test --examples +cargo nextest run --examples # Benchmarks ([ "$CHANNEL" != "nightly" ] || cargo bench --no-run --verbose --features "$FEATURES") diff --git a/scripts/blas-integ-tests.sh b/scripts/blas-integ-tests.sh index 3d769e0af..3a6258d77 100755 --- a/scripts/blas-integ-tests.sh +++ b/scripts/blas-integ-tests.sh @@ -4,5 +4,5 @@ set -x set -e # BLAS tests -cargo test -p blas-tests -v --features blas-tests/openblas-system -cargo test -p numeric-tests -v --features numeric-tests/test_blas +cargo nextest run -p blas-tests -v --features blas-tests/openblas-system +cargo nextest run -p numeric-tests -v --features numeric-tests/test_blas diff --git a/scripts/miri-tests.sh b/scripts/miri-tests.sh index 0100f3e6a..1f291bade 100755 --- a/scripts/miri-tests.sh +++ b/scripts/miri-tests.sh @@ -15,4 +15,4 @@ RUSTFLAGS="-Zrandomize-layout" # General tests # Note that we exclude blas feature because Miri can't do cblas_gemm -cargo miri test -v -p ndarray -p ndarray-rand --features approx,serde +cargo miri nextest run -v -p ndarray -p ndarray-rand --features approx,serde From 1b358ff0b7d33a8c13931c35cf20fea0aac1099f Mon Sep 17 00:00:00 2001 From: Adam Kern Date: Mon, 26 May 2025 14:35:11 -0400 Subject: [PATCH 2/3] Forgot to actually install nextest --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 60f824791..adcf8cb59 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -101,6 +101,7 @@ jobs: toolchain: ${{ matrix.rust }} - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@nextest - name: Install openblas run: sudo apt-get install libopenblas-dev gfortran - run: ./scripts/all-tests.sh "$FEATURES" ${{ matrix.rust }} @@ -116,6 +117,7 @@ jobs: toolchain: ${{ needs.pass-msrv.outputs.BLAS_MSRV }} - uses: rui314/setup-mold@v1 - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@nextest - name: Install openblas run: sudo apt-get install libopenblas-dev gfortran - run: ./scripts/blas-integ-tests.sh $BLAS_MSRV @@ -129,6 +131,7 @@ jobs: with: components: miri - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@nextest - run: ./scripts/miri-tests.sh cross_test: @@ -165,6 +168,7 @@ jobs: with: toolchain: nightly - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@nextest - name: Install cargo-careful run: cargo install cargo-careful - run: cargo careful nextest run -Zcareful-sanitizer --features="$FEATURES" From d633d64137dfdcccaa14cc85afe8a269f0c44c4b Mon Sep 17 00:00:00 2001 From: Adam Kern Date: Mon, 26 May 2025 14:59:12 -0400 Subject: [PATCH 3/3] Add profile for nextest on CI --- .config/nextest.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 000000000..6a109e171 --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,5 @@ +[profile.ci] +fail-fast = false + +[profile.ci.junit] +path = "junit.xml"