Skip to content

Commit 4c10b02

Browse files
Use nextest to speedup tests (#2078)
## Which issue does this PR close? - Closes #2077. ## What changes are included in this PR? Use nextest instead of cargo test to run tests. ## Are these changes tested? Yes, ut.
1 parent ac4e4b0 commit 4c10b02

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,26 @@ jobs:
146146
with:
147147
key: ${{ matrix.test-suite.name }}
148148

149+
- name: Install cargo-nextest
150+
if: matrix.test-suite.name == 'default'
151+
uses: taiki-e/install-action@v2
152+
with:
153+
tool: cargo-nextest
154+
149155
- name: Start Docker containers
150156
if: matrix.test-suite.name == 'default'
151157
run: make docker-up
152158

153159
- name: Run tests
154-
run: cargo test --no-fail-fast ${{ matrix.test-suite.args }}
160+
env:
161+
# Disable debug info to speed up compilation and reduce artifact size
162+
RUSTFLAGS: "-C debuginfo=0"
163+
run: |
164+
if [ "${{ matrix.test-suite.name }}" = "default" ]; then
165+
cargo nextest run ${{ matrix.test-suite.args }}
166+
else
167+
cargo test --no-fail-fast ${{ matrix.test-suite.args }}
168+
fi
155169
156170
- name: Stop Docker containers
157171
if: always() && matrix.test-suite.name == 'default'

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ install-cargo-machete:
3232
cargo-machete: install-cargo-machete
3333
cargo machete
3434

35+
install-cargo-nextest:
36+
cargo install --locked cargo-nextest
37+
38+
nextest: install-cargo-nextest
39+
cargo nextest run --all-targets --all-features --workspace
40+
3541
install-taplo-cli:
3642
cargo install taplo-cli@0.9.3
3743

@@ -57,7 +63,7 @@ unit-test: doc-test
5763

5864
test: docker-up
5965
@trap '$(MAKE) docker-down' EXIT; \
60-
cargo test --no-fail-fast --all-targets --all-features --workspace
66+
$(MAKE) nextest
6167

6268
clean:
6369
cargo clean

0 commit comments

Comments
 (0)