Skip to content

test: run the unit suite against both validation engines (#467)#487

Open
SJrX wants to merge 1 commit into
issue-345-17from
issue-345-18
Open

test: run the unit suite against both validation engines (#467)#487
SJrX wants to merge 1 commit into
issue-345-17from
issue-345-18

Conversation

@SJrX

@SJrX SJrX commented Jun 23, 2026

Copy link
Copy Markdown
Owner

What

Runs the whole unit-test suite against both validation engines — the original SyntacticMatch/SemanticMatch and the new list-of-successes parse() — so the new engine is exercised across every grammar before any of this is released, rather than trusted on a handful of e2e tests.

Stacked on #486 (issue-345-17).

How

  • GrammarOptionValue.FORCE_PARSE_ENGINE — a system property (-Dsystemd.unit.grammarParseEngine=true) forces validation onto the new engine regardless of the per-project experimental flag. Crucially it forces only validation — the cosmetic annotators (coloring, key marker, deprecation, IPv6) stay on the user flag. So problem counts are unchanged between engines and only exact error spans/messages can differ. That keeps the parity comparison clean (otherwise the cosmetic annotators' INFORMATION highlights would break every assertSize).
  • build.gradle.kts forwards the property to the forked test JVM. Run locally with:
    ./gradlew test                                          # original engine
    ./gradlew test -Dsystemd.unit.grammarParseEngine=true   # new engine
    
  • CI (main.yml) gains a grammarParseEngine: [false, true] matrix dimension — both engines run in parallel, each publishing its own test results. (Mirror this on the Kubernetes jobs by duplicating with the -D flag.)

Result — strong parity signal

The entire suite passes under both engines. The only test needing engine-aware expectations is InvalidValueInspectionForCGroupSocketBind, where the new engine localizes two errors differently (and arguably better):

  • ipv6::tcp → highlights :tcp (after consuming ipv6:) vs ::tcp
  • ipv6:tcp:12--21485 → points at the out-of-range port -21485 vs the dash -

Counts and validity verdicts match everywhere else — i.e. the new engine reproduces the original's validation behavior across all grammars, differing only in where a couple of errors are underlined.

Refs #467

🤖 Generated with Claude Code

To gain confidence before any of this is released, run the whole suite twice — once on
the original SyntacticMatch/SemanticMatch engine and once on the new list-of-successes
engine — rather than relying on a couple of e2e tests.

- GrammarOptionValue.FORCE_PARSE_ENGINE: a system property
  (-Dsystemd.unit.grammarParseEngine=true) forces validation onto the new engine,
  independent of the per-project experimental flag. Only validation is forced; the
  cosmetic annotators (coloring, key marker) stay on the user flag, so problem COUNTS
  are unchanged and only exact error spans can differ between engines.
- build.gradle.kts forwards the property to the forked test JVM.
- CI (main.yml) gains a grammarParseEngine: [false, true] matrix dimension, running both
  engines in parallel.

Result: the entire suite passes under BOTH engines. The only test needing engine-aware
expectations is InvalidValueInspectionForCGroupSocketBind, where the new engine localizes
two errors differently (and arguably better): "ipv6::tcp" highlights ":tcp" after the
consumed "ipv6:" rather than "::tcp"; "12--21485" points at the out-of-range port
"-21485" rather than the dash. Counts/validity match everywhere else — strong evidence
the new engine is at parity.

Refs #467

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Unit Test Results (grammar engine false)

1 159 tests   1 159 ✅  50s ⏱️
  308 suites      0 💤
  308 files        0 ❌

Results for commit 5b746be.

@github-actions

Copy link
Copy Markdown

Unit Test Results (grammar engine true)

1 159 tests   1 159 ✅  49s ⏱️
  308 suites      0 💤
  308 files        0 ❌

Results for commit 5b746be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant