Skip to content

Commit 509b02c

Browse files
authored
ci: Enable nextest for all behavior tests (apache#2400)
* ci: Enable nextest for all behavior tests Signed-off-by: Xuanwo <[email protected]> * FIx nextest not set Signed-off-by: Xuanwo <[email protected]> * fix install Signed-off-by: Xuanwo <[email protected]> * Install nextest on windows Signed-off-by: Xuanwo <[email protected]> * Add os in key Signed-off-by: Xuanwo <[email protected]> * Fix test Signed-off-by: Xuanwo <[email protected]> * Fix build Signed-off-by: Xuanwo <[email protected]> * Fix build Signed-off-by: Xuanwo <[email protected]> * Don't setup on linux Signed-off-by: Xuanwo <[email protected]> * add todo Signed-off-by: Xuanwo <[email protected]> * fix fs Signed-off-by: Xuanwo <[email protected]> * fix azblob Signed-off-by: Xuanwo <[email protected]> * Use nestest to run gcs Signed-off-by: Xuanwo <[email protected]> * Make cos a bit happy Signed-off-by: Xuanwo <[email protected]> --------- Signed-off-by: Xuanwo <[email protected]>
1 parent bd31233 commit 509b02c

31 files changed

+150
-148
lines changed

.config/nextest.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
[profile.default]
1919
fail-fast = false
20-
slow-timeout = { period = "60s", terminate-after = 2 }
20+
slow-timeout = { period = "60s", terminate-after = 10 }

.github/actions/setup/action.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ description: 'Prepare Rust Build Environment'
2020
inputs:
2121
need-rocksdb:
2222
description: "This setup needs rocksdb or not"
23+
need-nextest:
24+
description: "This setup needs nextest or not"
2325

2426
runs:
2527
using: "composite"
@@ -37,6 +39,20 @@ runs:
3739
# Enable sparse index
3840
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
3941
42+
- name: Cache nextest on linux
43+
id: cache-nextest
44+
uses: actions/cache@v3
45+
if: inputs.need-nextest == 'true' && runner.os == 'Linux'
46+
with:
47+
path: ~/.cargo/bin/cargo-nextest
48+
# TODO: remove the runner.os while bumping version
49+
key: r0-${{runner.os}}-nextest-0.9.53
50+
51+
- name: Build nextest if not cached
52+
if: steps.cache-nextest.outputs.cache-hit != 'true' && inputs.need-nextest == 'true'
53+
shell: bash
54+
run: cargo install [email protected] --locked
55+
4056
- name: Setup rust on linux
4157
if: runner.os == 'Linux' && inputs.need-rocksdb == 'true'
4258
shell: bash

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ jobs:
165165

166166
- name: Setup Rust toolchain
167167
uses: ./.github/actions/setup
168-
- name: Install cargo-nextest
169-
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
168+
with:
169+
need-nextest: true
170170
- name: Test
171171
run: cargo nextest run --no-fail-fast --features layers-all && cargo test --doc
172172
env:

.github/workflows/service_test_azblob.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ jobs:
5757
5858
- name: Setup Rust toolchain
5959
uses: ./.github/actions/setup
60+
with:
61+
need-nextest: true
6062

6163
- name: Test
6264
shell: bash
6365
working-directory: core
64-
run: cargo test azblob -- --show-output
66+
run: cargo nextest run azblob
6567
env:
6668
RUST_BACKTRACE: full
6769
RUST_LOG: debug
@@ -78,6 +80,8 @@ jobs:
7880
- uses: actions/checkout@v3
7981
- name: Setup Rust toolchain
8082
uses: ./.github/actions/setup
83+
with:
84+
need-nextest: true
8185

8286
- name: Load secret
8387
id: op-load-secret
@@ -95,7 +99,4 @@ jobs:
9599
- name: Test
96100
shell: bash
97101
working-directory: core
98-
run: cargo test azblob -- --show-output
99-
env:
100-
RUST_BACKTRACE: full
101-
RUST_LOG: debug
102+
run: cargo nextest run azblob

.github/workflows/service_test_azdfs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ concurrency:
3939
jobs:
4040
azure_azdfs:
4141
runs-on: ubuntu-latest
42-
if: ${{ github.repository_owner == 'apache' }}
42+
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
4343
steps:
4444
- uses: actions/checkout@v3
4545
- name: Setup Rust toolchain
4646
uses: ./.github/actions/setup
47+
with:
48+
need-nextest: true
4749
- name: Test
4850
shell: bash
4951
working-directory: core
50-
run: cargo test azdfs -- --show-output
52+
run: cargo nextest run azdfs
5153
env:
52-
RUST_BACKTRACE: full
53-
RUST_LOG: debug
5454
OPENDAL_AZDFS_TEST: ${{ secrets.OPENDAL_AZDFS_TEST }}
5555
OPENDAL_AZDFS_FILESYSTEM: ${{ secrets.OPENDAL_AZDFS_FILESYSTEM }}
5656
OPENDAL_AZDFS_ENDPOINT: ${{ secrets.OPENDAL_AZDFS_ENDPOINT }}

.github/workflows/service_test_cos.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
- uses: actions/checkout@v3
4545
- name: Setup Rust toolchain
4646
uses: ./.github/actions/setup
47+
with:
48+
need-nextest: true
4749

4850
- name: Load secret
4951
id: op-load-secret
@@ -61,7 +63,4 @@ jobs:
6163
- name: Test
6264
shell: bash
6365
working-directory: core
64-
run: cargo test cos -- --show-output
65-
env:
66-
RUST_BACKTRACE: full
67-
RUST_LOG: debug
66+
run: cargo nextest run cos

.github/workflows/service_test_dashmap.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
- uses: actions/checkout@v3
4848
- name: Setup Rust toolchain
4949
uses: ./.github/actions/setup
50+
with:
51+
need-nextest: true
5052
- name: Test
5153
shell: bash
5254
working-directory: core
53-
run: cargo test dashmap --features services-dashmap -- --show-output
55+
run: cargo nextest run dashmap --features services-dashmap
5456
env:
55-
RUST_BACKTRACE: full
56-
RUST_LOG: debug
5757
OPENDAL_DASHMAP_TEST: on

.github/workflows/service_test_fs.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ jobs:
5151
- name: Test
5252
shell: bash
5353
working-directory: core
54-
run: cargo test services_fs -- --show-output
54+
run: cargo test services_fs
5555
env:
56-
RUST_BACKTRACE: full
57-
RUST_LOG: debug
5856
OPENDAL_FS_TEST: on
5957
OPENDAL_FS_ROOT: ${{ runner.temp }}/

.github/workflows/service_test_ftp.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ jobs:
7777
7878
- name: Setup Rust toolchain
7979
uses: ./.github/actions/setup
80+
with:
81+
need-nextest: true
8082
- name: Test
8183
shell: bash
8284
working-directory: core
83-
run: cargo test ftp --features services-ftp -- --show-output
85+
run: cargo nextest run ftp --features services-ftp
8486
env:
85-
RUST_BACKTRACE: full
86-
RUST_LOG: debug
8787
OPENDAL_FTP_TEST: on
8888
OPENDAL_FTP_ENDPOINT: ftp://127.0.0.1:2121
8989
OPENDAL_FTP_ROOT: /

.github/workflows/service_test_gcs.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ concurrency:
3939
jobs:
4040
gcs:
4141
runs-on: ubuntu-latest
42-
if: ${{ github.repository_owner == 'apache' }}
42+
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
4343
steps:
4444
- uses: actions/checkout@v3
4545
- name: Setup Rust toolchain
4646
uses: ./.github/actions/setup
47+
with:
48+
need-nextest: true
4749
- name: Test
4850
shell: bash
4951
working-directory: core
50-
run: cargo test gcs -- --show-output
52+
run: cargo nextest run gcs
5153
env:
52-
RUST_BACKTRACE: full
53-
RUST_LOG: debug
5454
OPENDAL_GCS_TEST: ${{ secrets.OPENDAL_GCS_TEST }}
5555
OPENDAL_GCS_ROOT: ${{ secrets.OPENDAL_GCS_ROOT }}
5656
OPENDAL_GCS_BUCKET: ${{ secrets.OPENDAL_GCS_BUCKET }}

.github/workflows/service_test_ghac.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ concurrency:
3939
jobs:
4040
ghac:
4141
runs-on: ubuntu-latest
42-
if: ${{ github.repository_owner == 'apache' }}
42+
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
4343
steps:
4444
- uses: actions/checkout@v3
4545
- name: Setup Rust toolchain
4646
uses: ./.github/actions/setup
47+
with:
48+
need-nextest: true
4749

4850
- name: Configure Cache Env
4951
uses: actions/github-script@v6
@@ -55,10 +57,8 @@ jobs:
5557
- name: Test
5658
shell: bash
5759
working-directory: core
58-
run: cargo test ghac -- --show-output
60+
run: cargo nextest run ghac
5961
env:
60-
RUST_BACKTRACE: full
61-
RUST_LOG: debug
6262
OPENDAL_GHAC_TEST: ${{ secrets.OPENDAL_GHAC_TEST }}
6363
OPENDAL_GHAC_ENABLE_CREATE_SIMULATION: true
6464
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/service_test_hdfs.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444

4545
- name: Setup Rust toolchain
4646
uses: ./.github/actions/setup
47+
with:
48+
need-nextest: true
4749

4850
- name: Setup java env
4951
uses: actions/setup-java@v3
@@ -60,10 +62,8 @@ jobs:
6062
working-directory: core
6163
run: |
6264
export CLASSPATH=$(find $HADOOP_HOME -iname "*.jar" | xargs echo | tr ' ' ':')
63-
cargo test services_hdfs --features services-hdfs -- --show-output
65+
cargo nextest run services_hdfs --features services-hdfs
6466
env:
65-
RUST_BACKTRACE: full
66-
RUST_LOG: debug
6767
HADOOP_HOME: "/home/runner/hadoop-3.3.5"
6868
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
6969
OPENDAL_HDFS_TEST: on
@@ -101,6 +101,8 @@ jobs:
101101
102102
- name: Setup Rust toolchain
103103
uses: ./.github/actions/setup
104+
with:
105+
need-nextest: true
104106

105107
- name: Setup java env
106108
uses: actions/setup-java@v3
@@ -118,10 +120,8 @@ jobs:
118120
run: |
119121
export CLASSPATH=$(find $HADOOP_HOME -iname "*.jar" | xargs echo | tr ' ' ':')
120122
121-
cargo test services_hdfs --features services-hdfs -- --show-output
123+
cargo nextest run services_hdfs --features services-hdfs
122124
env:
123-
RUST_BACKTRACE: full
124-
RUST_LOG: debug
125125
HADOOP_HOME: "/home/runner/hadoop-3.1.3"
126126
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
127127
OPENDAL_HDFS_TEST: on

.github/workflows/service_test_http.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ concurrency:
3838

3939
jobs:
4040
nginx:
41-
runs-on: ${{ matrix.os }}
42-
strategy:
43-
matrix:
44-
os:
45-
- ubuntu-latest
41+
runs-on: ubuntu-latest
4642
steps:
4743
- uses: actions/checkout@v3
4844

@@ -56,14 +52,14 @@ jobs:
5652
5753
- name: Setup Rust toolchain
5854
uses: ./.github/actions/setup
55+
with:
56+
need-nextest: true
5957

6058
- name: Test
6159
shell: bash
6260
working-directory: core
63-
run: cargo test http -- --show-output
61+
run: cargo nextest run http
6462
env:
65-
RUST_BACKTRACE: full
66-
RUST_LOG: debug
6763
OPENDAL_HTTP_TEST: on
6864
OPENDAL_HTTP_ENDPOINT: http://127.0.0.1:8080
6965
OPENDAL_DISABLE_RANDOM_ROOT: true
@@ -94,13 +90,13 @@ jobs:
9490
9591
- name: Setup Rust toolchain
9692
uses: ./.github/actions/setup
93+
with:
94+
need-nextest: true
9795
- name: Test
9896
shell: bash
9997
working-directory: core
100-
run: cargo test http -- --show-output
98+
run: cargo nextest run http
10199
env:
102-
RUST_BACKTRACE: full
103-
RUST_LOG: debug
104100
OPENDAL_HTTP_TEST: on
105101
OPENDAL_HTTP_ENDPOINT: http://127.0.0.1:8080
106102
OPENDAL_DISABLE_RANDOM_ROOT: true

.github/workflows/service_test_ipfs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jobs:
5353
ipfs files ls /opendal-testdata -l
5454
- name: Setup Rust toolchain
5555
uses: ./.github/actions/setup
56+
with:
57+
need-nextest: true
5658
- name: Test
5759
shell: bash
5860
working-directory: core
59-
run: cargo test ipfs --features services-ipfs -- --show-output
61+
run: cargo nextest run ipfs --features services-ipfs
6062
env:
61-
RUST_BACKTRACE: full
62-
RUST_LOG: debug
6363
OPENDAL_IPFS_TEST: on
6464
OPENDAL_IPFS_ROOT: /ipfs/QmPpCt1aYGb9JWJRmXRUnmJtVgeFFTJGzWFYEEX7bo9zGJ/
6565
OPENDAL_IPFS_ENDPOINT: "http://127.0.0.1:8080"

.github/workflows/service_test_ipmfs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ jobs:
4848
- uses: actions/checkout@v3
4949
- name: Setup Rust toolchain
5050
uses: ./.github/actions/setup
51+
with:
52+
need-nextest: true
5153
- name: Test
5254
shell: bash
5355
working-directory: core
54-
run: cargo test ipmfs -- --show-output
56+
run: cargo nextest run ipmfs
5557
env:
56-
RUST_BACKTRACE: full
57-
RUST_LOG: debug
5858
OPENDAL_IPFS_TEST: on
5959
OPENDAL_IPFS_ROOT: /opendal/
6060
OPENDAL_IPFS_ENDPOINT: "http://127.0.0.1:5001"

.github/workflows/service_test_memcached.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ jobs:
5757
- uses: actions/checkout@v3
5858
- name: Setup Rust toolchain
5959
uses: ./.github/actions/setup
60+
with:
61+
need-nextest: true
6062
- name: Test
6163
shell: bash
6264
working-directory: core
63-
run: cargo test memcached --features services-memcached -- --show-output
65+
run: cargo nextest run memcached --features services-memcached
6466
env:
65-
RUST_BACKTRACE: full
66-
RUST_LOG: debug
6767
OPENDAL_MEMCACHED_TEST: on
6868
OPENDAL_MEMCACHED_ENDPOINT: tcp://127.0.0.1:11211
6969
OPENDAL_MEMCACHED_ROOT: /

.github/workflows/service_test_memory.yml

+4-8
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,16 @@ concurrency:
3838

3939
jobs:
4040
memory:
41-
runs-on: ${{ matrix.os }}
42-
strategy:
43-
matrix:
44-
os:
45-
- ubuntu-latest
41+
runs-on: ubuntu-latest
4642
steps:
4743
- uses: actions/checkout@v3
4844
- name: Setup Rust toolchain
4945
uses: ./.github/actions/setup
46+
with:
47+
need-nextest: true
5048
- name: Test
5149
shell: bash
5250
working-directory: core
53-
run: cargo test memory -- --show-output
51+
run: cargo nextest run memory
5452
env:
55-
RUST_BACKTRACE: full
56-
RUST_LOG: debug
5753
OPENDAL_MEMORY_TEST: on

0 commit comments

Comments
 (0)