diff --git a/.config/nextest.toml b/.config/nextest.toml index 9e9c5b857..0529a1244 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -1,3 +1,6 @@ [profile.default] slow-timeout = { period = "120s", terminate-after = 1 } -retries = 3 # for flaky tests +retries = 3 # for flaky tests + +[profile.integration] +slow-timeout = { period = "3600s", terminate-after = 1 } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bcbc7e686..1a0f13471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,36 +81,31 @@ jobs: integration-test: name: Integration Test Suite runs-on: [self-hosted, linux] - needs: test + needs: rustfmt steps: - uses: actions/checkout@v3 - name: Install Clang run: sudo apt-get update && sudo apt-get install -y clang - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + - uses: taiki-e/install-action@cargo-llvm-cov + - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - uses: extractions/setup-just@v2 - - name: Run integration tests + - name: Run integration tests with coverage env: RUST_LOG: warn - run: just run_integration_tests - - cli-builds: - name: tycho-cli check - runs-on: [self-hosted, linux] - needs: rustfmt - steps: - - uses: actions/checkout@v3 - - name: Install Clang - run: sudo apt-get update && sudo apt-get install -y clang - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 + run: just run_integration_tests_cov + - name: Upload integration test coverage to Codecov + uses: codecov/codecov-action@v3 + if: github.repository == 'broxus/tycho' with: - cache-on-failure: true - - uses: extractions/setup-just@v2 - - name: Build CLI - run: just build + token: ${{ secrets.CODECOV_TOKEN }} + files: integration_codecov.json + fail_ci_if_error: true metrics: name: Metrics diff --git a/justfile b/justfile index 188271e75..96b8afa70 100644 --- a/justfile +++ b/justfile @@ -79,7 +79,31 @@ update_rpc_proto: cargo run -p tycho-gen-protos # === Integration tests stuff === +run_integration_tests_cov: prepare_integration_tests + #!/usr/bin/env bash + set -euo pipefail + export INTEGRATION_TEST=1 + if [ -n "${CI:-}" ]; then + # Running in CI + RUST_BACKTRACE=1 cargo llvm-cov nextest \ + --package tycho-core \ + --profile integration \ + --cargo-profile release_check \ + --test archives heavy_archives \ + --run-ignored all \ + --output-path integration_codecov.json \ + --codecov + else + # Running locally - show coverage report in browser + RUST_BACKTRACE=1 cargo llvm-cov nextest \ + --package tycho-core \ + --profile integration \ + --cargo-profile release_check \ + --test archives heavy_archives \ + --run-ignored all \ + --open + fi # Runs all tests including ignored. Will take a lot of time to run. run_integration_tests: prepare_integration_tests ./scripts/run-integration-tests.sh diff --git a/scripts/common.sh b/scripts/common.sh old mode 100644 new mode 100755 diff --git a/scripts/coverage.py b/scripts/coverage.py index 7fdc5abe4..11e49d52b 100755 --- a/scripts/coverage.py +++ b/scripts/coverage.py @@ -3,10 +3,11 @@ import sys -blacklist = ["25519", "tokio"] - - def main(): + blacklist = ["25519", "tokio"] + + if os.environ.get("INTEGRATION_TEST"): + blacklist += ["everscale_types" ,"sha2", "digest", "typenum", "ahash"] # otherwise it will took eternity to run the tests # The first argument is the path to rustc, followed by its arguments args = sys.argv[1:]