Skip to content

Commit 565eee9

Browse files
committed
CI: smoke-test state space script
Signed-off-by: Andrew Helwer <[email protected]>
1 parent 8c5d3fb commit 565eee9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/scripts/record_model_state_space.py

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
parser.add_argument('--tlapm_lib_path', help='Path to the TLA+ proof manager module directory; .tla files should be in this directory', required=True)
1515
parser.add_argument('--community_modules_jar_path', help='Path to the CommunityModules-deps.jar file', required=True)
1616
parser.add_argument('--manifest_path', help='Path to the tlaplus/examples manifest.json file', required=True)
17+
parser.add_argument('--skip', nargs='+', help='Space-separated list of models to skip checking', required=False, default=[])
18+
parser.add_argument('--only', nargs='+', help='If provided, only check models in this space-separated list', required=False, default=[])
1719
parser.add_argument('--enable_assertions', help='Enable Java assertions (pass -enableassertions to JVM)', action='store_true')
1820
args = parser.parse_args()
1921

@@ -24,6 +26,8 @@
2426
community_jar_path = normpath(args.community_modules_jar_path)
2527
manifest_path = normpath(args.manifest_path)
2628
examples_root = dirname(manifest_path)
29+
skip_models = args.skip
30+
only_models = args.only
2731
enable_assertions = args.enable_assertions
2832

2933
def check_model(module, model):
@@ -85,11 +89,18 @@ def check_model(module, model):
8589
)
8690
# This model is nondeterministic due to use of the Random module
8791
and model['path'] != 'specifications/SpanningTree/SpanTreeRandom.cfg'
92+
# This model generates the same distinct states but order varies
93+
and model['path'] != 'specifications/ewd998/EWD998ChanTrace.cfg'
94+
and model['path'] not in skip_models
95+
and (only_models == [] or model['path'] in only_models)
8896
],
8997
key = lambda m: m[2],
9098
reverse=True
9199
)
92100

101+
for path in skip_models:
102+
logging.info(f'Skipping {path}')
103+
93104
for module, model, _ in small_models:
94105
success = check_model(module, model)
95106
if not success:

.github/workflows/CI.yml

+9
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,13 @@ jobs:
170170
--manifest_path manifest.json \
171171
--ci_ignore_path .ciignore
172172
git diff -a
173+
- name: Smoke-test state space script
174+
run: |
175+
git reset --hard HEAD
176+
python $SCRIPT_DIR/record_model_state_space.py \
177+
--tools_jar_path $DEPS_DIR/tools/tla2tools.jar \
178+
--tlapm_lib_path $DEPS_DIR/tlapm/library \
179+
--community_modules_jar_path $DEPS_DIR/community/modules.jar \
180+
--manifest_path manifest.json
181+
git diff -a
173182

0 commit comments

Comments
 (0)