Skip to content

Commit 1215a7c

Browse files
committed
difftest: use nextest to properly filter tests, adjust ci
1 parent e489d83 commit 1215a7c

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-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"
44

55

66
[target.x86_64-pc-windows-msvc]

.config/nextest.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[profile.default]
2+
default-filter = '!package(difftest*) & !package(compiletest*) & !package(example-runner-*)'
3+
4+
[profile.difftests]
5+
default-filter = 'package(difftests)'
6+
7+
[profile.difftest-runner]
8+
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
@@ -41,6 +41,8 @@ jobs:
4141
# figure out native target triple while we're at it
4242
- name: install rust-toolchain
4343
run: echo "TARGET=$(rustc --print host-tuple)" >> "$GITHUB_ENV"
44+
- name: install nextest
45+
uses: taiki-e/install-action@nextest
4446
# Fetch dependencies in a separate step to clearly show how long each part
4547
# of the testing takes
4648
- name: cargo fetch --locked
@@ -49,13 +51,13 @@ jobs:
4951
# Core crates
5052
# Compiled in --release because cargo compiletest would otherwise compile in release again.
5153
- name: rustc_codegen_spirv build
52-
run: cargo test -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
54+
run: cargo nextest -p rustc_codegen_spirv --release --no-default-features --features "use-installed-tools" --no-run
5355

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

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

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

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

0 commit comments

Comments
 (0)