Skip to content

tests: MBT for votekeeper #5

tests: MBT for votekeeper

tests: MBT for votekeeper #5

Workflow file for this run

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
defaults:
run:
working-directory: Specs/Quint
env:
TRACES_DIR: 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
run: |
quint test --output $TRACES_DIR/voteBookkeeper_{}.itf.json voteBookkeeperTest.qnt
# 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: Remove traces from imported modules
run: rm $TRACES_DIR/*voteBookkeeperTest::*.*
- name: Store traces as an artifact
uses: actions/upload-artifact@v3
with:
name: trace-files
path: $TRACES_DIR/*.itf.json
test-traces:
needs: gen-traces
name: Execute traces as tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: Code/itf
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
run: cargo nextest run --workspace --all-features --no-run
- name: Retrieve traces from artifact
uses: actions/download-artifact@v3
with:
name: trace-files
path: tests/fixtures
- name: Run tests from traces
run: cargo nextest run --workspace --all-features test_itf