Skip to content

Commit 5492747

Browse files
committed
difftest: use nextest to properly filter tests, adjust ci
1 parent 1a480f0 commit 5492747

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

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

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

6163
# Examples
6264
- name: cargo check examples
@@ -191,14 +193,16 @@ jobs:
191193
sudo apt install -y xvfb libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
192194
- name: install rust-toolchain
193195
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
196+
- name: install nextest
197+
uses: taiki-e/install-action@nextest
194198
- name: cargo fetch --locked
195199
run: cargo fetch --locked --target $TARGET
196200
- name: cargo fetch --locked difftests
197201
run: cargo fetch --locked --manifest-path=tests/difftests/tests/Cargo.toml --target $TARGET
198-
- name: test difftest
199-
run: cargo test -p "difftest*" --release --no-default-features --features "use-installed-tools"
202+
- name: test difftest-runner
203+
run: cargo nextest run -P difftest-runner -p difftest-runner -p difftest --release --no-default-features --features "use-installed-tools"
200204
- name: difftests
201-
run: cargo run -p difftests --release --no-default-features --features "use-installed-tools"
205+
run: cargo nextest run -P difftests -p difftests --release --no-default-features --features "use-installed-tools"
202206

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

0 commit comments

Comments
 (0)