Skip to content

Commit

Permalink
Merge branch 'tomas/pos-sm-test' (#1837)
Browse files Browse the repository at this point in the history
* tomas/pos-sm-test:
  ci/automation: add a task to run PoS SM tests
  make: add recipe to `test-pos-sm`
  • Loading branch information
tzemanovic committed Aug 30, 2023
2 parents 1612bf1 + 55fd916 commit 9c88da7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
CHAIN_BUCKET: anoma-iac-files-master

jobs:
tasks:
with_py: # tasks that are using python scripts from anoma-ci-iac
if: ${{ github.event.issue.pull_request }}
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.make.timeout }}
Expand Down Expand Up @@ -75,6 +75,39 @@ jobs:
BINARIES_COMMIT_SHA: ${{ steps.comment-branch.outputs.head_sha }}
- name: Comment not found
if: steps.check.outputs.triggered != 'true'
run: echo "Comment $COMMENT not found"
run: echo "Comment \"$COMMENT\" not matched"
env:
COMMENT: ${{ matrix.make.comment }}
COMMENT: ${{ matrix.make.comment }}

tasks: # tasks with commands with no external deps
if: ${{ github.event.issue.pull_request }}
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.make.timeout }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
make:
- name: Run PoS state-machine tests
comment: pls run pos tests
command: PROPTEST_CASES=300 make test-pos-sm # PoS state machine tests
timeout: 600 # 10 hours

steps:
- uses: khan/[email protected]
id: check
with:
trigger: ${{ matrix.make.comment }}
reaction: eyes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: xt0rted/pull-request-comment-branch@v1
if: steps.check.outputs.triggered == 'true'
id: comment-branch
- uses: actions/checkout@v3
if: steps.check.outputs.triggered == 'true'
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Run task ${{ matrix.make.name }}
if: steps.check.outputs.triggered == 'true'
run: ${{ matrix.make.command }}
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ NAMADA_E2E_USE_PREBUILT_BINARIES ?= true
NAMADA_E2E_DEBUG ?= true
RUST_BACKTRACE ?= 1
NAMADA_MASP_TEST_SEED ?= 0
PROPTEST_CASES ?= 100

cargo := $(env) cargo
rustup := $(env) rustup
Expand Down Expand Up @@ -202,6 +203,14 @@ test-debug:
--nocapture \
-Z unstable-options --report-time

# Run PoS state machine tests
test-pos-sm:
cd proof_of_stake && \
RUST_BACKTRACE=1 \
PROPTEST_CASES=$(PROPTEST_CASES) \
RUSTFLAGS='-C debuginfo=2 -C debug-assertions=true -C overflow-checks=true' \
cargo test pos_state_machine_test --release

fmt-wasm = $(cargo) +$(nightly) fmt --manifest-path $(wasm)/Cargo.toml
fmt:
$(cargo) +$(nightly) fmt --all && \
Expand Down

0 comments on commit 9c88da7

Please sign in to comment.