Skip to content

Commit 44b70fa

Browse files
adamqqqplayjiangliu
authored andcommitted
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 7edea8a commit 44b70fa

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
@@ -85,7 +85,7 @@ jobs:
8585
- name: Checkout
8686
uses: actions/checkout@v3
8787
- name: Rust Cache
88-
uses: Swatinem/rust-cache@v2.2.0
88+
uses: Swatinem/rust-cache@v2
8989
with:
9090
cache-on-failure: true
9191
- name: Build Nydus
@@ -600,12 +600,14 @@ jobs:
600600
- name: Checkout
601601
uses: actions/checkout@v3
602602
- name: Rust Cache
603-
uses: Swatinem/rust-cache@v2.2.0
603+
uses: Swatinem/rust-cache@v2
604604
with:
605605
cache-on-failure: true
606+
- name: Install cargo nextest
607+
uses: taiki-e/install-action@nextest
606608
- name: Unit Test
607609
run: |
608-
make ut
610+
make ut-nextest
609611
610612
nydus-unit-test-coverage:
611613
runs-on: ubuntu-latest
@@ -614,7 +616,7 @@ jobs:
614616
steps:
615617
- uses: actions/checkout@v3
616618
- name: Rust Cache
617-
uses: Swatinem/rust-cache@v2.2.0
619+
uses: Swatinem/rust-cache@v2
618620
with:
619621
cache-on-failure: true
620622
- 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)