Repository navigation
Burn down small build/test-hygiene issues - #724
Merged
Merged
Conversation
… test incremental_compilation_covers_all_models chained TEST_MODELS (repo-relative paths) onto ALL_INCREMENTALLY_COMPILABLE_MODELS (../../-prefixed paths) and opened each with a bare File::open from the crate dir, so every TEST_MODELS entry hit the Err(_) => continue arm and was silently skipped -- the test only ever exercised the prefixed list while its name and panic denominator claimed the combined corpus. Add the ../../ prefix to TEST_MODELS entries (matching the generated corpus tests' concat!) and turn a failed file-open into a recorded failure instead of a silent skip, so a renamed or missing fixture cannot quietly shrink coverage again. The parse-stage and non-XMILE continue arms keep skipping by design. All TEST_MODELS entries pass incremental compilation with the loop actually running. Fixes #623
…test test_rank_and_filter_truncates_to_max_loops built MAX_LOOPS + 50 = 250 FoundLoops to trip the production cap, violating the documented rule against testing production threshold gates with fixtures large enough to trip them (docs/dev/rust.md#test-time-budgets). The test-only override it should have used (MaxLoopsGuard, added in 76db318) already existed and is used by the neighboring truncation-order tests. Switch to a cap of 3 with 5 loops; the assertion is unchanged in meaning and the fixture no longer scales with MAX_LOOPS if the production constant is ever raised. Fixes #667
db/tests.rs had grown to 5995 lines, five short of the 6000-line per-file cap that scripts/lint-project.sh enforces in pre-commit and CI, so the next non-trivial test addition would have blocked an unrelated commit with a forced split under duress. Move two cohesive sections (along the existing section headers) into sibling test modules, following the db/ precedent of one file per test concern: the incremental-compilation + AC acceptance-criteria tests into incremental_compile_tests.rs, and the PREVIOUS/INIT opcode + LTM incremental-verification tests into vm_verification_tests.rs. The move is behavior-preserving: test bodies are byte-identical, only the simple_project helper gains pub(crate) visibility so the siblings can keep sharing it. tests.rs lands at 2943 lines. Fixes #645
Nothing enforces prettier formatting on commit or in CI (eslint only loads eslint-config-prettier to disable conflicting rules, it does not check formatting), so 48 files across core, diagram, app, engine, server, and serve-web drifted prettier-dirty on main. Reformat everything in one isolated commit -- no behavior changes -- so the prettier --check gate added in the next commit starts from a clean tree and unrelated future PRs stop picking up reformatting noise. The sweep includes src/core, which the existing js-format script's egrep excluded (its 'core' filter was aimed at generated lib*/ output but also caught the real src/core sources); the gate commit fixes that glob.
Neither the pre-commit hook nor CI verified prettier formatting -- eslint loads eslint-config-prettier solely to disable conflicting rules -- so TypeScript files merged prettier-dirty and drift accumulated on main (cleared by the previous commit's sweep). Wire the existing js-needs-format script (prettier -l, exits nonzero on drift) into the pre-commit TypeScript pipeline and the CI frontend job, mirroring how cargo fmt --check is already enforced for Rust. The script's egrep exclusion drops its 'core' term: that filter was aimed at generated lib*/ output but also silently excluded the real src/core sources from both js-format and the check; the lib/, lib.browser/, and lib.module/ exclusions remain. Fixes #627
The pysimlin gate runs ruff check (the linter) but nothing verifies ruff format, so 9 lint-clean-but-format-dirty Python files drifted on main across simlin/, examples/, scripts/, and tests/. Reformat them in one isolated commit -- no behavior changes -- so the ruff format --check gate added in the next commit starts from a clean tree. This is the Python analogue of the prettier sweep two commits back.
The pysimlin pre-commit step ran ruff check (the linter) only, and the CI pysimlin job ran neither ruff command, so format drift accumulated undetected (cleared by the previous commit's sweep). Add ruff format --check to scripts/pysimlin-tests.sh (which the pre-commit hook's Python pipeline runs) and a ruff format/lint step to the CI pysimlin job, mirroring how cargo fmt --check and the new prettier gate are enforced for Rust and TypeScript. Fixes #664
The pre-commit Rust pipeline ran clippy --all-features and a 180s-wall-clock-capped cargo test concurrently against one shared build cache. cargo serializes same-target-dir builds on a file lock, so the capped test step's budget absorbed clippy's compile time: on a cold cache this tripped the cap and reported 'Rust tests failed' even for docs-only commits, and on macOS the budget also had to absorb all compilation, which CI explicitly excludes (ci.yaml compiles with cargo test --no-run before its 3-minute post-compile test cap). Run clippy, then cargo test --no-run, then the capped cargo test sequentially. Compilation and lock waits no longer count against the cap, which now measures what it was built to police: the PR #461 pathological-test-runtime regression class. Wall-clock cost is small because the hook's Rust pipeline runs concurrently with the slower TypeScript pipeline either way. The timeout diagnostic now reflects that a capped run is genuine test runtime. Fixes #629 Fixes #703
scripts/check-docs.py validates backtick path references in CLAUDE.md files against the filesystem, and src/engine's CLAUDE.md referenced the wasm output directory as core/ -- a gitignored build product that exists on dev machines (so the local pre-commit check passes) but not on a clean CI checkout. Every CI run since 4c4c9a4 has failed the Policy checks job on it. Reword the reference so the checker doesn't treat generated output as a tracked path; the prose still names the directory.
|
Reviewed the test-correctness changes, the build/test-hygiene plumbing, and spot-checked the prettier/ruff sweeps. Verdict: correct.
No blocking findings. |
|
Reviewed the patch across all 70 files / 9 commits. The substantive logic changes are tight and well-justified:
The remaining ~3400 lines of diff are pure prettier/ruff reformatting (verified on spot-checks across diagram, engine, core, server, serve-web, pysimlin) — no behavior changes. No actionable findings. Overall correctness verdict: correct. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A cluster of small, related build- and test-hygiene fixes, one issue per commit.
Test correctness (engine)
incremental_compilation_covers_all_modelschainedTEST_MODELS(repo-relative paths) onto a../../-prefixed list and silentlycontinued on failed opens, so everyTEST_MODELSentry was skipped while the test name and panic denominator claimed the combined corpus. Paths are now prefixed and a failed open is a recorded failure. All corpus models pass with the loop actually running.rank_and_filtertruncation test built 250 loops to trip the productionMAX_LOOPS=200; it now uses the existingMaxLoopsGuardtest override with a 5-loop fixture, per the documented rule in docs/dev/rust.md.Lint-cap headroom (engine)
db/tests.rswas at 5995/6000 lines -- five lines from the per-file lint cap. Split two cohesive sections into sibling modules (incremental_compile_tests.rs,vm_verification_tests.rs) along the existing section headers; test bodies are byte-identical andtests.rslands at 2943 lines.Formatting gates (build/CI)
js-needs-formatgate in the pre-commit TypeScript pipeline and the CI frontend job. The script's egrep no longer excludes the realsrc/coresources (itscorefilter was aimed at generatedlib*/output).ruff formatsweep of 9 drifted Python files (isolated commit), then aruff format --checkgate inscripts/pysimlin-tests.shand the CI pysimlin job.Pre-commit Rust pipeline (build)
cargo testpreviously ran concurrently against one shared build cache, so the cap absorbed compile time and lock waits -- tripping spuriously on cold caches (even for docs-only commits) and structurally on macOS, where the budget had to absorb all compilation. The pipeline now runs clippy, thencargo test --no-run(both untimed), then the capped test run, mirroring CI's compile-then-time structure. Every commit on this branch passed the restructured hook locally on macOS with ample headroom.Fixes #623
Fixes #667
Fixes #645
Fixes #627
Fixes #664
Fixes #629
Fixes #703