Skip to content

Commit 03abf3c

Browse files
committed
difftest: use nextest to properly filter tests, adjust ci
1 parent 22781b4 commit 03abf3c

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
22
compiletest = "run --release -p compiletests --"
3-
difftest = "run --release -p difftests --"
3+
difftest = "nextest run --release -P difftests -p difftests"
44
run-wasm = ["run", "--release", "-p", "run-wasm", "--"]
55

66
[target.'cfg(target_arch = "wasm32")']

.config/nextest.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[profile.default]
2+
default-filter = '!package(difftest*) & !package(compiletest*) & !package(example-runner-*)'
3+
fail-fast = false
4+
5+
[profile.difftests]
6+
default-filter = 'package(difftests)'
7+
8+
[profile.difftest-runner]
9+
default-filter = 'package(difftest-runner) | package(difftest)'

.github/workflows/ci.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
# figure out native target triple while we're at it
4444
- name: install rust-toolchain
4545
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
46+
- name: install nextest
47+
uses: taiki-e/install-action@nextest
4648
# Fetch dependencies in a separate step to clearly show how long each part
4749
# of the testing takes
4850
- name: cargo fetch --locked
@@ -51,13 +53,13 @@ jobs:
5153
# Core crates
5254
# Compiled in --release because cargo compiletest would otherwise compile in release again.
5355
- name: rustc_codegen_spirv build
54-
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
56+
run: cargo nextest run -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
5557

5658
- name: rustc_codegen_spirv test
57-
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
59+
run: cargo nextest run -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
5860

5961
- name: workspace test (excluding examples & difftest)
60-
run: cargo test --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features "use-installed-tools"
62+
run: cargo nextest run --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features "use-installed-tools"
6163

6264
# Examples
6365
- name: cargo check examples
@@ -194,14 +196,16 @@ jobs:
194196
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
195197
- name: install rust-toolchain
196198
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
199+
- name: install nextest
200+
uses: taiki-e/install-action@nextest
197201
- name: cargo fetch --locked
198202
run: cargo fetch --locked --target $TARGET
199203
- name: cargo fetch --locked difftests
200204
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target $TARGET
201-
- name: test difftest
202-
run: cargo test -p "difftest*" --release --no-default-features --features "use-installed-tools"
205+
- name: test difftest-runner
206+
run: cargo nextest run -P difftest-runner -p difftest-runner -p difftest --release --no-default-features --features "use-installed-tools"
203207
- name: difftests
204-
run: cargo run -p difftests --release --no-default-features --features "use-installed-tools"
208+
run: cargo nextest run -P difftests -p difftests --release --no-default-features --features "use-installed-tools"
205209

206210
# This allows us to have a single job we can branch protect on, rather than needing
207211
# to update the branch protection rules when the test matrix changes

0 commit comments

Comments
 (0)