Skip to content

Derive test counts from judge fixtures - #230

Merged
jserv merged 1 commit into
sysprog21:mainfrom
moon-jam:fix/validate-judge-case-counts
Oct 7, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
moon-jam:fix/validate-judge-case-counts

Conversation

@moon-jam

@moon-jam moon-jam commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

This follows up on the review of #117 by removing hard-coded browser case counts and validating the saved report total against the judge fixtures.

Browser checks previously repeated judge case counts as numeric literals, requiring manual updates whenever cases changed. They now resolve each problem through web/problem-pages.json and read the count from its generated fixture under web/judges/.

This also corrects tests/golden/report-python.json from 0/4 to 0/5 and checks its total against the Two Sum judge during fixture-only report validation. The offline gate validates that every mapped problem has a nonempty case list. Regression tests cover changing counts, missing problem IDs, malformed case lists, and stale report totals.

Tests

  • node scripts/judge-case-counts.cjs
  • REPORT_PARITY_CHECK_VALIDATE_FIXTURES_ONLY=1 ./scripts/report-parity-check.sh
  • ./node_modules/.bin/eslint scripts/browser-check.cjs scripts/judge-case-counts.cjs tests/browser/judge-case-counts.test.js

Refs #117


Summary by cubic

Derives judge case counts from generated fixtures so browser checks and the report parity check no longer drift when cases change.

  • Browser checks resolve each problem's judge and read its case count instead of hard-coded literals.
  • The report parity check validates the live report total against the current judge and compares passing counts with the saved capture; the saved total stays historical.
  • scripts/judge-case-counts.cjs maps problem IDs to fixtures and fails when any judge has no cases.
  • Regression tests cover changing counts, missing problem IDs, malformed case lists, and stale report totals.

Written for commit 896f76c. Summary will update on new commits.

Review in cubic

@moon-jam
moon-jam force-pushed the fix/validate-judge-case-counts branch from 0551500 to 3c652ef Compare October 3, 2026 13:23
@jserv
jserv requested review from ColtenOuO and alanhc October 3, 2026 13:32
Comment thread scripts/test.sh Outdated
@moon-jam
moon-jam force-pushed the fix/validate-judge-case-counts branch from 3c652ef to 45da8b0 Compare October 3, 2026 14:06
Comment thread scripts/browser-check.cjs Outdated
Comment thread scripts/report-parity-check.sh Outdated
@moon-jam
moon-jam force-pushed the fix/validate-judge-case-counts branch 2 times, most recently from d537ebc to 1a7d0b8 Compare October 5, 2026 11:12
@jserv
jserv requested a review from ColtenOuO October 5, 2026 12:58

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase latest main branch and resolve conflicts.

Repeated browser totals and literal report comparisons drift when
judge cases change. Resolve flow judges before browser startup and
reuse their counts. Validate live report totals against current
fixtures while comparing passing counts with the saved capture.
Keep its total historical so case additions do not require updates.
@moon-jam
moon-jam force-pushed the fix/validate-judge-case-counts branch from 1a7d0b8 to 896f76c Compare October 7, 2026 01:47
@jserv
jserv merged commit 16267ee into sysprog21:main Oct 7, 2026
6 checks passed
@jserv

jserv commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thank @moon-jam for contributing!

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.

3 participants