Skip to content

tests: MBT for votekeeper #4

tests: MBT for votekeeper

tests: MBT for votekeeper #4

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
env:
FIXTURES_DIR: Code/itf/tests/fixtures/votekeeper
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "18"
- run: npm install -g @informalsystems/quint
- name: Generate traces
working-directory: Specs/Quint
run: |
quint test --output ../../${FIXTURES_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 ${FIXTURES_DIR} -maxdepth 1 -type f -exec ./Scripts/trace-remove-stuttering-steps.sh {} \;
# This step removes trace files generated from tests defined in imported modules.
- name: Remove tests from imported modules
run: rm ${FIXTURES_DIR}/*voteBookkeeperTest::*.*
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: Run tests
run: cargo nextest run --workspace --all-features