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

update tests to use cargo-nextest if present #1243

Merged
merged 5 commits into from
May 16, 2024
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
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ jobs:
- name: Check targets are installed correctly
run: rustup target list --installed

- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin

- name: Check all features compilation
run: cargo check --verbose --features try-runtime,runtime-benchmarks --locked

- name: Run all tests
run: cargo test --features try-runtime,runtime-benchmarks --locked
run: make test-all

native-linux:
needs: checks-and-tests
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
test-runtimes:
tests:
runs-on: [self-hosted, Linux, X64]
steps:
- name: Checkout the source code
Expand All @@ -26,5 +26,8 @@ jobs:
- name: Check targets are installed correctly
run: rustup target list --installed

- name: Runtime integration tests
run: make test-runtimes
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin

- name: Run all tests
run: make test-all
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@ runtime-upgrade-test:
cargo build -p $(runtime)-runtime --release --locked
cd tests/e2e && yarn --frozen-lockfile && yarn test:runtime-upgrade-$(runtime)

# use `cargo nextest run` if cargo-nextest is installed, fallback cargo test
cargo_test = $(shell which cargo-nextest >/dev/null && echo "cargo nextest run" || echo "cargo test")

.PHONY: test
test:
${cargo_test} --workspace

.PHONY: test-features
test-features:
${cargo_test} --workspace --features try-runtime,runtime-benchmarks,evm-tracing

.PHONY: test-runtimes
test-runtimes:
SKIP_WASM_BUILD= cargo test -p integration-tests --features=shibuya
SKIP_WASM_BUILD= cargo test -p integration-tests --features=shiden
SKIP_WASM_BUILD= cargo test -p integration-tests --features=astar
SKIP_WASM_BUILD= ${cargo_test} -p integration-tests --features=shibuya
SKIP_WASM_BUILD= ${cargo_test} -p integration-tests --features=shiden
SKIP_WASM_BUILD= ${cargo_test} -p integration-tests --features=astar

.PHONY: test-all
test-all: test test-runtimes test-features
Loading