Skip to content

Commit e4b583d

Browse files
committed
action: replace cargo test with cargo nextest in CI
1. improve test speed and presents test results concisely. Signed-off-by: Qinqi Qu <[email protected]>
1 parent a78db8b commit e4b583d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/smoke.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Checkout
5454
uses: actions/checkout@v3
5555
- name: Rust Cache
56-
uses: Swatinem/rust-cache@v2.2.0
56+
uses: Swatinem/rust-cache@v2
5757
with:
5858
cache-on-failure: true
5959
- name: Build Nydus
@@ -351,12 +351,14 @@ jobs:
351351
- name: Checkout
352352
uses: actions/checkout@v3
353353
- name: Rust Cache
354-
uses: Swatinem/rust-cache@v2.2.0
354+
uses: Swatinem/rust-cache@v2
355355
with:
356356
cache-on-failure: true
357+
- name: Install cargo nextest
358+
uses: taiki-e/install-action@nextest
357359
- name: Unit Test
358360
run: |
359-
make ut
361+
make ut-nextest
360362
361363
nydus-unit-test-coverage:
362364
runs-on: ubuntu-latest
@@ -365,7 +367,7 @@ jobs:
365367
steps:
366368
- uses: actions/checkout@v3
367369
- name: Rust Cache
368-
uses: Swatinem/rust-cache@v2.2.0
370+
uses: Swatinem/rust-cache@v2
369371
with:
370372
cache-on-failure: true
371373
- name: Install cargo-llvm-cov

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ install: release
109109
@sudo install -m 755 target/release/nydus-image $(INSTALL_DIR_PREFIX)/nydus-image
110110
@sudo install -m 755 target/release/nydusctl $(INSTALL_DIR_PREFIX)/nydusctl
111111

112+
# unit test
112113
ut: .release_version
113-
TEST_WORKDIR_PREFIX=$(TEST_WORKDIR_PREFIX) RUST_BACKTRACE=1 ${CARGO} test --workspace $(EXCLUDE_PACKAGES) $(CARGO_COMMON) $(CARGO_BUILD_FLAGS) -- --skip integration --nocapture --test-threads=8
114+
TEST_WORKDIR_PREFIX=$(TEST_WORKDIR_PREFIX) RUST_BACKTRACE=1 ${CARGO} test --no-fail-fast --workspace $(EXCLUDE_PACKAGES) $(CARGO_COMMON) $(CARGO_BUILD_FLAGS) -- --skip integration --nocapture --test-threads=8
115+
116+
# you need install cargo nextest first from: https://nexte.st/book/pre-built-binaries.html
117+
ut-nextest: .release_version
118+
TEST_WORKDIR_PREFIX=$(TEST_WORKDIR_PREFIX) RUST_BACKTRACE=1 ${CARGO} nextest run --no-fail-fast --filter-expr 'test(test) - test(integration)' --workspace $(EXCLUDE_PACKAGES) $(CARGO_COMMON) $(CARGO_BUILD_FLAGS) --test-threads 8
114119

115120
# install test dependencies
116121
pre-coverage:

0 commit comments

Comments
 (0)