diff --git a/.config/nextest.toml b/.config/nextest.toml index fe1754adf184..7bfd4a0e3791 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -17,4 +17,4 @@ [profile.default] fail-fast = false -slow-timeout = { period = "60s", terminate-after = 2 } +slow-timeout = { period = "60s", terminate-after = 10 } diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 13de94259967..7d1b13f13bd2 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -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" @@ -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 cargo-nextest@0.9.53 --locked + - name: Setup rust on linux if: runner.os == 'Linux' && inputs.need-rocksdb == 'true' shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3329c0f9978c..ac5eb9aac2ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/.github/workflows/service_test_azblob.yml b/.github/workflows/service_test_azblob.yml index 999c57ca0c98..eeee47b73381 100644 --- a/.github/workflows/service_test_azblob.yml +++ b/.github/workflows/service_test_azblob.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/service_test_azdfs.yml b/.github/workflows/service_test_azdfs.yml index d686d0c9c923..e65f90fda237 100644 --- a/.github/workflows/service_test_azdfs.yml +++ b/.github/workflows/service_test_azdfs.yml @@ -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 }} diff --git a/.github/workflows/service_test_cos.yml b/.github/workflows/service_test_cos.yml index 3fb71a96b68f..181fd11d47e8 100644 --- a/.github/workflows/service_test_cos.yml +++ b/.github/workflows/service_test_cos.yml @@ -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 @@ -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 diff --git a/.github/workflows/service_test_dashmap.yml b/.github/workflows/service_test_dashmap.yml index 0aed4cbea536..c4726afd9eaa 100644 --- a/.github/workflows/service_test_dashmap.yml +++ b/.github/workflows/service_test_dashmap.yml @@ -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 diff --git a/.github/workflows/service_test_fs.yml b/.github/workflows/service_test_fs.yml index 9c1ba5e9576d..c3789a6cf545 100644 --- a/.github/workflows/service_test_fs.yml +++ b/.github/workflows/service_test_fs.yml @@ -51,9 +51,7 @@ jobs: - name: Test shell: bash working-directory: core - run: cargo test services_fs -- --show-output + run: cargo test services_fs env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_FS_TEST: on OPENDAL_FS_ROOT: ${{ runner.temp }}/ diff --git a/.github/workflows/service_test_ftp.yml b/.github/workflows/service_test_ftp.yml index 837218c91b5d..03dab83ca1d9 100644 --- a/.github/workflows/service_test_ftp.yml +++ b/.github/workflows/service_test_ftp.yml @@ -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: / diff --git a/.github/workflows/service_test_gcs.yml b/.github/workflows/service_test_gcs.yml index 40838834c0be..53c3246444a5 100644 --- a/.github/workflows/service_test_gcs.yml +++ b/.github/workflows/service_test_gcs.yml @@ -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 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 }} diff --git a/.github/workflows/service_test_ghac.yml b/.github/workflows/service_test_ghac.yml index e61d09a30c01..3f46ea7a6303 100644 --- a/.github/workflows/service_test_ghac.yml +++ b/.github/workflows/service_test_ghac.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/service_test_hdfs.yml b/.github/workflows/service_test_hdfs.yml index 4f7d7083e55a..7bc6e8786453 100644 --- a/.github/workflows/service_test_hdfs.yml +++ b/.github/workflows/service_test_hdfs.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/service_test_http.yml b/.github/workflows/service_test_http.yml index ce32448a9852..cd67e0e5b830 100644 --- a/.github/workflows/service_test_http.yml +++ b/.github/workflows/service_test_http.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/service_test_ipfs.yml b/.github/workflows/service_test_ipfs.yml index b7138586d7b4..f63e2b260029 100644 --- a/.github/workflows/service_test_ipfs.yml +++ b/.github/workflows/service_test_ipfs.yml @@ -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" diff --git a/.github/workflows/service_test_ipmfs.yml b/.github/workflows/service_test_ipmfs.yml index a31b0e1511d6..efffa0f71261 100644 --- a/.github/workflows/service_test_ipmfs.yml +++ b/.github/workflows/service_test_ipmfs.yml @@ -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" diff --git a/.github/workflows/service_test_memcached.yml b/.github/workflows/service_test_memcached.yml index 74b5b2da23ef..30aa3fe29fa1 100644 --- a/.github/workflows/service_test_memcached.yml +++ b/.github/workflows/service_test_memcached.yml @@ -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: / diff --git a/.github/workflows/service_test_memory.yml b/.github/workflows/service_test_memory.yml index f339c5b1bbf5..deb01275ce5f 100644 --- a/.github/workflows/service_test_memory.yml +++ b/.github/workflows/service_test_memory.yml @@ -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 diff --git a/.github/workflows/service_test_moka.yml b/.github/workflows/service_test_moka.yml index 7ee58c742a2d..b242b0a6a756 100644 --- a/.github/workflows/service_test_moka.yml +++ b/.github/workflows/service_test_moka.yml @@ -38,20 +38,16 @@ concurrency: jobs: moka: - 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 moka --features services-moka -- --show-output + run: cargo nextest run moka --features services-moka env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_MOKA_TEST: on diff --git a/.github/workflows/service_test_obs.yml b/.github/workflows/service_test_obs.yml index fca4b747cdfa..bf3c9ca9d503 100644 --- a/.github/workflows/service_test_obs.yml +++ b/.github/workflows/service_test_obs.yml @@ -39,18 +39,18 @@ concurrency: jobs: obs: 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 obs -- --show-output + run: cargo nextest run obs env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_OBS_TEST: ${{ secrets.OPENDAL_OBS_TEST }} OPENDAL_OBS_BUCKET: ${{ secrets.OPENDAL_OBS_BUCKET }} OPENDAL_OBS_ENDPOINT: ${{ secrets.OPENDAL_OBS_ENDPOINT }} diff --git a/.github/workflows/service_test_oss.yml b/.github/workflows/service_test_oss.yml index 90c0afd3cec6..a04d7f141fc3 100644 --- a/.github/workflows/service_test_oss.yml +++ b/.github/workflows/service_test_oss.yml @@ -39,18 +39,18 @@ concurrency: jobs: oss: 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 oss -- --show-output + run: cargo nextest run oss env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_OSS_TEST: ${{ secrets.OPENDAL_OSS_TEST }} OPENDAL_OSS_BUCKET: ${{ secrets.OPENDAL_OSS_BUCKET }} OPENDAL_OSS_ENDPOINT: ${{ secrets.OPENDAL_OSS_ENDPOINT }} diff --git a/.github/workflows/service_test_redis.yml b/.github/workflows/service_test_redis.yml index 690e5811c871..c35c50dc06cb 100644 --- a/.github/workflows/service_test_redis.yml +++ b/.github/workflows/service_test_redis.yml @@ -48,17 +48,18 @@ 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 redis --features services-redis -- --show-output + run: cargo nextest run redis --features services-redis env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_REDIS_TEST: on OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379 OPENDAL_REDIS_ROOT: / OPENDAL_REDIS_DB: 0 + dragonfly: runs-on: ubuntu-latest services: @@ -70,13 +71,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 redis --features services-redis -- --show-output + run: cargo nextest run redis --features services-redis env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_REDIS_TEST: on OPENDAL_REDIS_ENDPOINT: tcp://127.0.0.1:6379 OPENDAL_REDIS_ROOT: / diff --git a/.github/workflows/service_test_rocksdb.yml b/.github/workflows/service_test_rocksdb.yml index 6f15870fa338..caa9d4c79925 100644 --- a/.github/workflows/service_test_rocksdb.yml +++ b/.github/workflows/service_test_rocksdb.yml @@ -36,8 +36,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true - - jobs: rocksdb: runs-on: ubuntu-latest @@ -47,14 +45,13 @@ jobs: uses: ./.github/actions/setup with: need-rocksdb: true + need-nextest: true - name: Test shell: bash working-directory: core - run: cargo test rocksdb --features services-rocksdb -- --show-output --test-threads=1 + run: cargo nextest run rocksdb --features services-rocksdb -j=1 env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_ROCKSDB_TEST: on OPENDAL_ROCKSDB_ROOT: / OPENDAL_ROCKSDB_DATADIR: /tmp/opendal/rocksdb/ diff --git a/.github/workflows/service_test_s3.yml b/.github/workflows/service_test_s3.yml index 605bc8a88ad8..88266f81c822 100644 --- a/.github/workflows/service_test_s3.yml +++ b/.github/workflows/service_test_s3.yml @@ -39,18 +39,18 @@ concurrency: jobs: aws_s3: 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 s3 -- --show-output + run: cargo nextest run s3 env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_S3_TEST: ${{ secrets.OPENDAL_S3_TEST }} OPENDAL_S3_ROOT: ${{ secrets.OPENDAL_S3_ROOT }} OPENDAL_S3_BUCKET: ${{ secrets.OPENDAL_S3_BUCKET }} @@ -61,18 +61,18 @@ jobs: aws_s3_with_virtual_host: 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 s3 -- --show-output + run: cargo nextest run s3 env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_S3_TEST: ${{ secrets.OPENDAL_S3_TEST }} OPENDAL_S3_ROOT: ${{ secrets.OPENDAL_S3_ROOT }} OPENDAL_S3_BUCKET: ${{ secrets.OPENDAL_S3_BUCKET }} @@ -84,18 +84,18 @@ jobs: aws_s3_with_sse_c: 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 s3 -- --show-output + run: cargo nextest run s3 env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_S3_TEST: ${{ secrets.OPENDAL_S3_TEST }} OPENDAL_S3_ROOT: ${{ secrets.OPENDAL_S3_ROOT }} OPENDAL_S3_BUCKET: ${{ secrets.OPENDAL_S3_BUCKET }} @@ -130,13 +130,13 @@ jobs: run: aws --endpoint-url http://127.0.0.1:9000/ s3 mb s3://test - name: Setup Rust toolchain uses: ./.github/actions/setup + with: + need-nextest: true - name: Test shell: bash working-directory: core - run: cargo test s3 -- --show-output + run: cargo nextest run s3 env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_S3_TEST: on OPENDAL_S3_BUCKET: test OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000" @@ -167,13 +167,13 @@ jobs: ./mc anonymous set public local/test - name: Setup Rust toolchain uses: ./.github/actions/setup + with: + need-nextest: true - name: Test shell: bash working-directory: core - run: cargo test s3 -- --show-output + run: cargo nextest run s3 env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_S3_TEST: on OPENDAL_S3_BUCKET: test OPENDAL_S3_ENDPOINT: "http://127.0.0.1:9000" diff --git a/.github/workflows/service_test_sftp.yml b/.github/workflows/service_test_sftp.yml index 374a90bec3b2..c8c3e0c545af 100644 --- a/.github/workflows/service_test_sftp.yml +++ b/.github/workflows/service_test_sftp.yml @@ -54,14 +54,14 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup + with: + need-nextest: true - name: Test shell: bash timeout-minutes: 10 working-directory: core - run: cargo test sftp --features services-sftp -- --show-output + run: cargo nextest run sftp --features services-sftp env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_SFTP_TEST: on OPENDAL_SFTP_ENDPOINT: ssh://127.0.0.1:2222 OPENDAL_SFTP_ROOT: /upload/sftp_test/ diff --git a/.github/workflows/service_test_sled.yml b/.github/workflows/service_test_sled.yml index e84fdda6075b..05a9583538db 100644 --- a/.github/workflows/service_test_sled.yml +++ b/.github/workflows/service_test_sled.yml @@ -43,10 +43,12 @@ 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 sled --features services-sled -- --show-output --test-threads=1 + run: cargo nextest run sled --features services-sled -j=1 env: RUST_BACKTRACE: full RUST_LOG: debug diff --git a/.github/workflows/service_test_supabase.yml b/.github/workflows/service_test_supabase.yml index 883096c5651d..1b529021a848 100644 --- a/.github/workflows/service_test_supabase.yml +++ b/.github/workflows/service_test_supabase.yml @@ -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 @@ -60,7 +62,4 @@ jobs: - name: Test shell: bash working-directory: core - run: cargo test supabase --features=services-supabase -- --show-output - env: - RUST_BACKTRACE: full - RUST_LOG: debug + run: cargo nextest run supabase --features=services-supabase diff --git a/.github/workflows/service_test_wasabi.yml b/.github/workflows/service_test_wasabi.yml index dfbee891fc71..b50f2e85d483 100644 --- a/.github/workflows/service_test_wasabi.yml +++ b/.github/workflows/service_test_wasabi.yml @@ -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 @@ -62,7 +64,4 @@ jobs: - name: Test shell: bash working-directory: core - run: cargo test wasabi --features=services-wasabi -- --show-output - env: - RUST_BACKTRACE: full - RUST_LOG: debug + run: cargo nextest run wasabi --features=services-wasabi diff --git a/.github/workflows/service_test_webdav.yml b/.github/workflows/service_test_webdav.yml index 384c086c83aa..1d445c65f344 100644 --- a/.github/workflows/service_test_webdav.yml +++ b/.github/workflows/service_test_webdav.yml @@ -47,6 +47,8 @@ jobs: - uses: actions/checkout@v3 - name: Setup Rust toolchain uses: ./.github/actions/setup + with: + need-nextest: true - name: Install nginx full for dav_ext modules run: sudo apt install nginx-full @@ -61,10 +63,8 @@ jobs: - name: Test shell: bash working-directory: core - run: cargo test webdav -- --show-output + run: cargo nextest run webdav env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_WEBDAV_TEST: on OPENDAL_WEBDAV_ENDPOINT: http://127.0.0.1:8080 @@ -78,6 +78,8 @@ jobs: - uses: actions/checkout@v3 - name: Setup Rust toolchain uses: ./.github/actions/setup + with: + need-nextest: true - name: Install nginx full for dav_ext modules run: sudo apt install nginx-full @@ -93,10 +95,8 @@ jobs: - name: Test empty password shell: bash working-directory: core - run: cargo test webdav -- --show-output + run: cargo nextest run webdav env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_WEBDAV_TEST: on OPENDAL_WEBDAV_ENDPOINT: http://127.0.0.1:8080 OPENDAL_WEBDAV_USERNAME: foo @@ -104,25 +104,21 @@ jobs: - name: Test with password shell: bash working-directory: core - run: cargo test webdav -- --show-output + run: cargo nextest run webdav env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_WEBDAV_TEST: on OPENDAL_WEBDAV_ENDPOINT: http://127.0.0.1:8080 OPENDAL_WEBDAV_USERNAME: bar OPENDAL_WEBDAV_PASSWORD: bar nginx_with_redirect: - 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: Install nginx full for dav_ext modules run: sudo apt install nginx-full @@ -134,18 +130,16 @@ jobs: mkdir -p /tmp/static mkdir -p /var/lib/nginx # make nginx worker has permission to operate it - chmod a+rw /tmp/static/ + chmod a+rw /tmp/static/ # make nginx worker has permission to operate it - sudo chmod 777 /var/lib/nginx/body + sudo chmod 777 /var/lib/nginx/body nginx -c `pwd`/src/services/webdav/fixtures/nginx.conf - name: Test with redirect shell: bash working-directory: core run: | - cargo test webdav -- --show-output + cargo nextest run webdav env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_WEBDAV_TEST: on OPENDAL_WEBDAV_ENDPOINT: http://127.0.0.1:8081 diff --git a/.github/workflows/service_test_webhdfs.yml b/.github/workflows/service_test_webhdfs.yml index ba33b7a6e317..eb84a274ac9d 100644 --- a/.github/workflows/service_test_webhdfs.yml +++ b/.github/workflows/service_test_webhdfs.yml @@ -66,14 +66,14 @@ jobs: - name: Setup Rust toolchain uses: ./.github/actions/setup + with: + need-nextest: true - name: Test shell: bash working-directory: core - run: cargo test webhdfs -- --show-output + run: cargo nextest run webhdfs env: - RUST_BACKTRACE: full - RUST_LOG: debug OPENDAL_WEBHDFS_TEST: on OPENDAL_WEBHDFS_ROOT: / OPENDAL_WEBHDFS_ENDPOINT: http://127.0.0.1:9870 diff --git a/core/tests/behavior/append.rs b/core/tests/behavior/append.rs index 8a1075b08b67..49871a9078e3 100644 --- a/core/tests/behavior/append.rs +++ b/core/tests/behavior/append.rs @@ -16,6 +16,8 @@ // under the License. use anyhow::Result; +use futures::io::BufReader; +use futures::io::Cursor; use log::warn; use opendal::EntryMode; use opendal::ErrorKind; @@ -209,7 +211,9 @@ pub async fn test_appender_futures_copy(op: Operator) -> Result<()> { Err(err) => return Err(err.into()), }; - futures::io::copy(&mut content.as_slice(), &mut a).await?; + // Wrap a buf reader here to make sure content is read in 1MiB chunks. + let mut cursor = BufReader::with_capacity(1024 * 1024, Cursor::new(content.clone())); + futures::io::copy(&mut cursor, &mut a).await?; a.close().await?; let meta = op.stat(&path).await.expect("stat must succeed"); diff --git a/core/tests/behavior/write.rs b/core/tests/behavior/write.rs index 2efe228d53aa..cff78532b01d 100644 --- a/core/tests/behavior/write.rs +++ b/core/tests/behavior/write.rs @@ -19,6 +19,8 @@ use std::str::FromStr; use std::time::Duration; use anyhow::Result; +use futures::io::BufReader; +use futures::io::Cursor; use futures::AsyncReadExt; use futures::AsyncSeekExt; use futures::StreamExt; @@ -1134,7 +1136,9 @@ pub async fn test_writer_futures_copy(op: Operator) -> Result<()> { Err(err) => return Err(err.into()), }; - futures::io::copy(&mut content.as_slice(), &mut w).await?; + // Wrap a buf reader here to make sure content is read in 1MiB chunks. + let mut cursor = BufReader::with_capacity(1024 * 1024, Cursor::new(content.clone())); + futures::io::copy_buf(&mut cursor, &mut w).await?; w.close().await?; let meta = op.stat(&path).await.expect("stat must succeed");