Skip to content

Commit 3b5b688

Browse files
committed
difftest: use nextest to properly filter tests, adjust ci
1 parent 0e4c402 commit 3b5b688

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

.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
@@ -40,6 +40,8 @@ jobs:
4040
# figure out native target triple while we're at it
4141
- name: install rust-toolchain
4242
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
43+
- name: install nextest
44+
uses: taiki-e/install-action@nextest
4345
# Fetch dependencies in a separate step to clearly show how long each part
4446
# of the testing takes
4547
- name: cargo fetch --locked
@@ -48,13 +50,13 @@ jobs:
4850
# Core crates
4951
# Compiled in --release because cargo compiletest would otherwise compile in release again.
5052
- name: rustc_codegen_spirv build
51-
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
53+
run: cargo nextest run -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
5254

5355
- name: rustc_codegen_spirv test
54-
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
56+
run: cargo nextest run -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools"
5557

5658
- name: workspace test (excluding examples & difftest)
57-
run: cargo test --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features "use-installed-tools,clap"
59+
run: cargo nextest run --release --workspace --exclude "example-runner-*" --exclude "difftest*" --no-default-features --features "use-installed-tools,clap"
5860

5961
# Examples
6062
- name: cargo check examples
@@ -183,14 +185,16 @@ jobs:
183185
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
184186
- name: install rust-toolchain
185187
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
188+
- name: install nextest
189+
uses: taiki-e/install-action@nextest
186190
- name: cargo fetch --locked
187191
run: cargo fetch --locked --target $TARGET
188192
- name: cargo fetch --locked difftests
189193
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target $TARGET
190-
- name: test difftest
191-
run: cargo test -p "difftest*" --release --no-default-features --features "use-installed-tools"
194+
- name: test difftest-runner
195+
run: cargo nextest run -P difftest-runner -p difftest-runner -p difftest --release --no-default-features --features "use-installed-tools"
192196
- name: difftests
193-
run: cargo run -p difftests --release --no-default-features --features "use-installed-tools"
197+
run: cargo nextest run -P difftests -p difftests --release --no-default-features --features "use-installed-tools"
194198

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

0 commit comments

Comments
 (0)