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 test use nextest #2275

Merged
merged 7 commits into from
Aug 22, 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
8 changes: 8 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ jobs:
`
})
return data.data.id
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
toolchain: nightly-2023-04-15
components: rustfmt
target: wasm32-unknown-unknown
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Setup cmake
uses: jwlawson/[email protected]
- name: Run benchmarking tests
Expand Down Expand Up @@ -113,6 +115,8 @@ jobs:
toolchain: nightly-2023-04-15
components: rustfmt
target: wasm32-unknown-unknown
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Setup cmake
uses: jwlawson/[email protected]
- name: Run runtime tests
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml.src
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
toolchain: nightly-2023-04-15
components: rustfmt
target: wasm32-unknown-unknown
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Check format
run: cargo fmt --all -- --check
- name: Build
Expand Down
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# use `cargo nextest run` if cargo-nextest is installed
cargo_test = $(shell which cargo-nextest >/dev/null && echo "cargo nextest run" || echo "cargo test")

.PHONY: run
run:
cargo run --features with-mandala-runtime -- --dev -lruntime=debug --instant-sealing
Expand Down Expand Up @@ -137,27 +140,28 @@ try-runtime-acala:

.PHONY: test
test: githooks
SKIP_WASM_BUILD= cargo test --features with-mandala-runtime --all
SKIP_WASM_BUILD= ${cargo_test} --features with-mandala-runtime --all

.PHONY: test-eth
test-eth: githooks test-evm
SKIP_WASM_BUILD= cargo test -p runtime-common --features with-ethereum-compatibility schedule_call_precompile_should_work
SKIP_WASM_BUILD= cargo test -p runtime-integration-tests --features with-mandala-runtime --features with-ethereum-compatibility should_not_kill_contract_on_transfer_all
SKIP_WASM_BUILD= cargo test -p runtime-integration-tests --features with-mandala-runtime --features with-ethereum-compatibility schedule_call_precompile_should_handle_invalid_input
SKIP_WASM_BUILD= ${cargo_test} -p runtime-common --features with-ethereum-compatibility schedule_call_precompile_should_work
SKIP_WASM_BUILD= ${cargo_test} -p runtime-integration-tests --features with-mandala-runtime --features with-ethereum-compatibility should_not_kill_contract_on_transfer_all
SKIP_WASM_BUILD= ${cargo_test} -p runtime-integration-tests --features with-mandala-runtime --features with-ethereum-compatibility schedule_call_precompile_should_handle_invalid_input

.PHONY: test-evm
test-evm: githooks
SKIP_WASM_BUILD= cargo test --release -p evm-jsontests --features evm-tests
SKIP_WASM_BUILD= ${cargo_test} --release -p evm-jsontests --features evm-tests

.PHONY: test-runtimes
test-runtimes:
SKIP_WASM_BUILD= cargo test --all --features with-all-runtime --lib
SKIP_WASM_BUILD= cargo test -p runtime-integration-tests --features=with-mandala-runtime --lib
SKIP_WASM_BUILD= cargo test -p runtime-integration-tests --features=with-karura-runtime --lib
SKIP_WASM_BUILD= cargo test -p runtime-integration-tests --features=with-acala-runtime --lib
SKIP_WASM_BUILD= ${cargo_test} --all --features with-all-runtime --lib
SKIP_WASM_BUILD= ${cargo_test} -p runtime-integration-tests --features=with-mandala-runtime --lib
SKIP_WASM_BUILD= ${cargo_test} -p runtime-integration-tests --features=with-karura-runtime --lib
SKIP_WASM_BUILD= ${cargo_test} -p runtime-integration-tests --features=with-acala-runtime --lib

.PHONY: test-e2e
test-e2e:
# TODO: use cargo-nextest
cargo test --release --package test-service -- --include-ignored --skip test_full_node_catching_up --skip simple_balances_test --test-threads=1

.PHONY: test-ts
Expand All @@ -166,8 +170,8 @@ test-ts: build-mandala-internal-release

.PHONY: test-benchmarking
test-benchmarking:
cargo test --features bench --package module-evm --package runtime-common
cargo test --features runtime-benchmarks --features with-all-runtime --all benchmarking
SKIP_WASM_BUILD= ${cargo_test} --features bench --package module-evm --package runtime-common
SKIP_WASM_BUILD= ${cargo_test} --features runtime-benchmarks --features with-all-runtime --all benchmarking

.PHONY: test-all
test-all: test-runtimes test-eth test-benchmarking
Expand Down
Loading