tests: MBT for votekeeper #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MBT | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- Specs/Quint/** | |
- Code/** | |
pull_request: | |
paths: | |
- Specs/Quint/** | |
- Code/** | |
jobs: | |
gen-traces: | |
name: Generate trace files | |
runs-on: ubuntu-latest | |
env: | |
TRACES_DIR: Specs/Quint/traces | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- run: npm install -g @informalsystems/quint | |
- run: mkdir -p $TRACES_DIR | |
- name: Generate traces | |
working-directory: Specs/Quint | |
run: | | |
quint test --output traces/voteBookkeeper_{}.itf.json voteBookkeeperTest.qnt | |
- name: Remove traces from imported modules | |
run: rm $TRACES_DIR/*voteBookkeeperTest::*.* | |
# This step is needed as a hack to clean the generated traces of repeated steps. The problem | |
# is that `quint test --output ...` on `run` statements registers in the traces the | |
# `allUnchanged` actions that are used when checking properties (see | |
# https://github.com/informalsystems/quint/issues/1252). | |
- name: Remove stuttering steps | |
run: find $TRACES_DIR -maxdepth 1 -type f -exec ./Scripts/trace-remove-stuttering-steps.sh {} \; | |
- name: Display generated files | |
run: ls -la $TRACES_DIR | |
- name: Upload traces to artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: trace-files | |
path: ${{ env.TRACES_DIR }}/* | |
if-no-files-found: error | |
test-traces: | |
needs: gen-traces | |
name: Execute traces as tests | |
runs-on: ubuntu-latest | |
env: | |
FIXTURES_DIR: Code/itf/tests/fixtures | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@cargo-nextest | |
- name: Build code | |
working-directory: Code/itf | |
run: cargo nextest run --workspace --all-features --no-run | |
- run: mkdir -p $FIXTURES_DIR | |
- name: Download traces from artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: trace-files | |
path: ${{ env.FIXTURES_DIR }} | |
- name: Run tests from traces | |
working-directory: Code/itf | |
run: cargo nextest run --workspace --all-features test_itf |