From f16a283b33b36a3099a9facff575598a9ce8d6ae Mon Sep 17 00:00:00 2001 From: Alexandcoats Date: Fri, 1 Sep 2023 03:29:07 -0400 Subject: [PATCH] Use `ci-test` alias (#1112) * use ci-test alias * Add more aliases * fix coverage * try renaming coverage file * allow pow tests to take longer * adjustment --- .cargo/config.toml | 2 ++ .config/nextest.toml | 4 ++++ .github/workflows/build-and-test.yml | 4 +++- .github/workflows/coverage.yml | 13 ++----------- .github/workflows/private-tangle-tests.yml | 4 +++- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index add62220f6..399881c7e3 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -7,6 +7,8 @@ ci-check-nostd = "check --no-default-features -F serde -p iota-sdk --target risc ci-check-types = "check --no-default-features -p iota-sdk" ci-test = "nextest run --all-features --profile ci --cargo-profile ci -p iota-sdk -p iota-sdk-bindings-core" +ci-tangle-test = "nextest run --tests --all-features --run-ignored ignored-only --profile ci --cargo-profile ci -p iota-sdk -p iota-sdk-bindings-core" +ci-coverage = "llvm-cov nextest --lcov --output-path lcov.info --tests -p iota-sdk --all-features --run-ignored all --profile ci" ci-clippy = "clippy --all-targets --all-features -- -D warnings" diff --git a/.config/nextest.toml b/.config/nextest.toml index 4c00415a4f..448dccbba0 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -6,3 +6,7 @@ fail-fast = false retries = 2 test-threads = "num-cpus" slow-timeout = { period = "60s", terminate-after = 2 } + +[[profile.ci.overrides]] +filter = 'test(/^pow::/)' +slow-timeout = "5m" diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f7bc3ccc45..64e934f4b0 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -4,6 +4,7 @@ on: push: branches: [develop, production] paths: + - ".cargo/config.toml" - ".github/workflows/build-and-test.yml" - ".github/actions/**" - "**.rs" # Include all rust files @@ -13,6 +14,7 @@ on: pull_request: branches: [develop, production] paths: + - ".cargo/config.toml" - ".github/workflows/build-and-test.yml" - ".github/actions/**" - "**.rs" # Include all rust files @@ -50,4 +52,4 @@ jobs: uses: taiki-e/install-action@nextest - name: Run tests - run: cargo nextest run --all-features --profile ci --cargo-profile ci -p iota-sdk -p iota-sdk-bindings-core + run: cargo ci-test diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e691992458..b60ee9b935 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -4,6 +4,7 @@ on: push: branches: [develop, production] paths: + - ".cargo/config.toml" - ".github/workflows/coverage.yml" - ".github/actions/**" - "coverage.sh" @@ -54,16 +55,7 @@ jobs: uses: "./.github/actions/ledger-nano" - name: Collect coverage data - run: > - cargo llvm-cov nextest - --lcov - --output-path coverage.info - --tests - --package iota-sdk - --all-features - --run-ignored all - --test-threads "num-cpus" - --retries 2 + run: cargo ci-coverage - name: Tear down private tangle if: always() @@ -73,5 +65,4 @@ jobs: uses: coverallsapp/github-action@v2.2.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: coverage.info flag-name: Unit diff --git a/.github/workflows/private-tangle-tests.yml b/.github/workflows/private-tangle-tests.yml index 7b0eec51a3..5db264192b 100644 --- a/.github/workflows/private-tangle-tests.yml +++ b/.github/workflows/private-tangle-tests.yml @@ -4,6 +4,7 @@ on: push: branches: [develop, production] paths: + - ".cargo/config.toml" - ".github/workflows/private-tangle-tests.yml" - ".github/actions/**" - "**.rs" @@ -15,6 +16,7 @@ on: pull_request: branches: [develop, production] paths: + - ".cargo/config.toml" - ".github/workflows/private-tangle-tests.yml" - ".github/actions/**" - "**.rs" @@ -63,7 +65,7 @@ jobs: uses: "./.github/actions/ledger-nano" - name: Run tests - run: cargo nextest run --tests --all-features --run-ignored ignored-only --profile ci --cargo-profile ci -p iota-sdk -p iota-sdk-bindings-core + run: cargo ci-tangle-test - name: Tear down private tangle if: always()