Skip to content

Commit 58ca2f7

Browse files
committed
test(mbt): Add Model Based Test for Emerald
This patch connects the newly added Quint specs to Emerald's code via the Quint Connect library.
1 parent 6343e8e commit 58ca2f7

22 files changed

+1786
-449
lines changed

.github/workflows/test.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: read
11+
packages: read
1112

1213
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR.
1314
# Ensures that we don't waste CI time, and returns results quicker.
@@ -57,11 +58,64 @@ jobs:
5758
- name: Run Forge build
5859
run: forge build
5960
if: steps.filter.outputs.code == 'true'
60-
- name: Run tests
61+
- name: Run unit tests
6162
run: |
6263
cargo nextest run \
6364
--workspace \
6465
--all-features \
6566
--no-fail-fast \
66-
--failure-output final
67+
--failure-output final \
68+
--filterset 'not package(emerald-mbt)'
69+
if: steps.filter.outputs.code == 'true'
70+
71+
mbt:
72+
name: MBT Tests
73+
runs-on: ubuntu-latest
74+
# XXX: Do not block on MBT initially until we gain confidence CI is not
75+
# flaky for any reason.
76+
continue-on-error: true
77+
steps:
78+
- name: Checkout
79+
uses: actions/checkout@v5
80+
with:
81+
submodules: recursive
82+
- id: filter
83+
uses: dorny/paths-filter@v3
84+
with:
85+
filters: |
86+
code:
87+
- '**/*.rs'
88+
- '**/*.qnt'
89+
- 'Makefile'
90+
- '**/Cargo.toml'
91+
- '**/Cargo.lock'
92+
- '**/*.sh'
93+
- '*/workflows/test.yml'
94+
- name: Setup Node.js
95+
uses: actions/setup-node@v4
96+
with:
97+
node-version: '22'
98+
- name: Install Quint
99+
run: npm install -g @informalsystems/quint
100+
- name: Login to GitHub Container Registry
101+
uses: docker/login-action@v3
102+
with:
103+
registry: ghcr.io
104+
username: ${{ github.actor }}
105+
password: ${{ secrets.GITHUB_TOKEN }}
106+
- name: Install Protoc
107+
uses: arduino/setup-protoc@v3
108+
with:
109+
repo-token: ${{ secrets.GITHUB_TOKEN }}
110+
- name: Setup Rust toolchain
111+
uses: actions-rust-lang/setup-rust-toolchain@v1
112+
with:
113+
toolchain: nightly
114+
- name: Install Foundry
115+
uses: foundry-rs/foundry-toolchain@v1
116+
- name: Run Forge build
117+
run: forge build
118+
if: steps.filter.outputs.code == 'true'
119+
- name: Run MBT tests
120+
run: make mbt-test
67121
if: steps.filter.outputs.code == 'true'

0 commit comments

Comments
 (0)