Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Enable nextest for all behavior tests #2400

Merged
merged 14 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

[profile.default]
fail-fast = false
slow-timeout = { period = "60s", terminate-after = 2 }
slow-timeout = { period = "60s", terminate-after = 10 }
16 changes: 16 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ description: 'Prepare Rust Build Environment'
inputs:
need-rocksdb:
description: "This setup needs rocksdb or not"
need-nextest:
description: "This setup needs nextest or not"

runs:
using: "composite"
Expand All @@ -37,6 +39,20 @@ runs:
# Enable sparse index
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV

- name: Cache nextest on linux
id: cache-nextest
uses: actions/cache@v3
if: inputs.need-nextest == 'true' && runner.os == 'Linux'
with:
path: ~/.cargo/bin/cargo-nextest
# TODO: remove the runner.os while bumping version
key: r0-${{runner.os}}-nextest-0.9.53

- name: Build nextest if not cached
if: steps.cache-nextest.outputs.cache-hit != 'true' && inputs.need-nextest == 'true'
shell: bash
run: cargo install [email protected] --locked

- name: Setup rust on linux
if: runner.os == 'Linux' && inputs.need-rocksdb == 'true'
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
with:
need-nextest: true
- name: Test
run: cargo nextest run --no-fail-fast --features layers-all && cargo test --doc
env:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/service_test_azblob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Test
shell: bash
working-directory: core
run: cargo test azblob -- --show-output
run: cargo nextest run azblob
env:
RUST_BACKTRACE: full
RUST_LOG: debug
Expand All @@ -78,6 +80,8 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Load secret
id: op-load-secret
Expand All @@ -95,7 +99,4 @@ jobs:
- name: Test
shell: bash
working-directory: core
run: cargo test azblob -- --show-output
env:
RUST_BACKTRACE: full
RUST_LOG: debug
run: cargo nextest run azblob
8 changes: 4 additions & 4 deletions .github/workflows/service_test_azdfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ concurrency:
jobs:
azure_azdfs:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'apache' }}
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test azdfs -- --show-output
run: cargo nextest run azdfs
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_AZDFS_TEST: ${{ secrets.OPENDAL_AZDFS_TEST }}
OPENDAL_AZDFS_FILESYSTEM: ${{ secrets.OPENDAL_AZDFS_FILESYSTEM }}
OPENDAL_AZDFS_ENDPOINT: ${{ secrets.OPENDAL_AZDFS_ENDPOINT }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/service_test_cos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Load secret
id: op-load-secret
Expand All @@ -61,7 +63,4 @@ jobs:
- name: Test
shell: bash
working-directory: core
run: cargo test cos -- --show-output
env:
RUST_BACKTRACE: full
RUST_LOG: debug
run: cargo nextest run cos
6 changes: 3 additions & 3 deletions .github/workflows/service_test_dashmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test dashmap --features services-dashmap -- --show-output
run: cargo nextest run dashmap --features services-dashmap
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_DASHMAP_TEST: on
4 changes: 1 addition & 3 deletions .github/workflows/service_test_fs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ jobs:
- name: Test
shell: bash
working-directory: core
run: cargo test services_fs -- --show-output
run: cargo test services_fs
Xuanwo marked this conversation as resolved.
Show resolved Hide resolved
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_FS_TEST: on
OPENDAL_FS_ROOT: ${{ runner.temp }}/
6 changes: 3 additions & 3 deletions .github/workflows/service_test_ftp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test ftp --features services-ftp -- --show-output
run: cargo nextest run ftp --features services-ftp
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_FTP_TEST: on
OPENDAL_FTP_ENDPOINT: ftp://127.0.0.1:2121
OPENDAL_FTP_ROOT: /
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/service_test_gcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ concurrency:
jobs:
gcs:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'apache' }}
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
xyjixyjixyji marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test gcs -- --show-output
run: cargo nextest run gcs
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_GCS_TEST: ${{ secrets.OPENDAL_GCS_TEST }}
OPENDAL_GCS_ROOT: ${{ secrets.OPENDAL_GCS_ROOT }}
OPENDAL_GCS_BUCKET: ${{ secrets.OPENDAL_GCS_BUCKET }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/service_test_ghac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ concurrency:
jobs:
ghac:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'apache' }}
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Configure Cache Env
uses: actions/github-script@v6
Expand All @@ -55,10 +57,8 @@ jobs:
- name: Test
shell: bash
working-directory: core
run: cargo test ghac -- --show-output
run: cargo nextest run ghac
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_GHAC_TEST: ${{ secrets.OPENDAL_GHAC_TEST }}
OPENDAL_GHAC_ENABLE_CREATE_SIMULATION: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/service_test_hdfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Setup java env
uses: actions/setup-java@v3
Expand All @@ -60,10 +62,8 @@ jobs:
working-directory: core
run: |
export CLASSPATH=$(find $HADOOP_HOME -iname "*.jar" | xargs echo | tr ' ' ':')
cargo test services_hdfs --features services-hdfs -- --show-output
cargo nextest run services_hdfs --features services-hdfs
env:
RUST_BACKTRACE: full
RUST_LOG: debug
HADOOP_HOME: "/home/runner/hadoop-3.3.5"
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
OPENDAL_HDFS_TEST: on
Expand Down Expand Up @@ -101,6 +101,8 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Setup java env
uses: actions/setup-java@v3
Expand All @@ -118,10 +120,8 @@ jobs:
run: |
export CLASSPATH=$(find $HADOOP_HOME -iname "*.jar" | xargs echo | tr ' ' ':')

cargo test services_hdfs --features services-hdfs -- --show-output
cargo nextest run services_hdfs --features services-hdfs
env:
RUST_BACKTRACE: full
RUST_LOG: debug
HADOOP_HOME: "/home/runner/hadoop-3.1.3"
LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }}
OPENDAL_HDFS_TEST: on
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/service_test_http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ concurrency:

jobs:
nginx:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -56,14 +52,14 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true

- name: Test
shell: bash
working-directory: core
run: cargo test http -- --show-output
run: cargo nextest run http
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_HTTP_TEST: on
OPENDAL_HTTP_ENDPOINT: http://127.0.0.1:8080
OPENDAL_DISABLE_RANDOM_ROOT: true
Expand Down Expand Up @@ -94,13 +90,13 @@ jobs:

- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test http -- --show-output
run: cargo nextest run http
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_HTTP_TEST: on
OPENDAL_HTTP_ENDPOINT: http://127.0.0.1:8080
OPENDAL_DISABLE_RANDOM_ROOT: true
6 changes: 3 additions & 3 deletions .github/workflows/service_test_ipfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ jobs:
ipfs files ls /opendal-testdata -l
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test ipfs --features services-ipfs -- --show-output
run: cargo nextest run ipfs --features services-ipfs
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_IPFS_TEST: on
OPENDAL_IPFS_ROOT: /ipfs/QmPpCt1aYGb9JWJRmXRUnmJtVgeFFTJGzWFYEEX7bo9zGJ/
OPENDAL_IPFS_ENDPOINT: "http://127.0.0.1:8080"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/service_test_ipmfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test ipmfs -- --show-output
run: cargo nextest run ipmfs
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_IPFS_TEST: on
OPENDAL_IPFS_ROOT: /opendal/
OPENDAL_IPFS_ENDPOINT: "http://127.0.0.1:5001"
6 changes: 3 additions & 3 deletions .github/workflows/service_test_memcached.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test memcached --features services-memcached -- --show-output
run: cargo nextest run memcached --features services-memcached
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_MEMCACHED_TEST: on
OPENDAL_MEMCACHED_ENDPOINT: tcp://127.0.0.1:11211
OPENDAL_MEMCACHED_ROOT: /
12 changes: 4 additions & 8 deletions .github/workflows/service_test_memory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,16 @@ concurrency:

jobs:
memory:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
need-nextest: true
- name: Test
shell: bash
working-directory: core
run: cargo test memory -- --show-output
run: cargo nextest run memory
env:
RUST_BACKTRACE: full
RUST_LOG: debug
OPENDAL_MEMORY_TEST: on
Loading