Skip to content

refactor(tests): inline resolved expect posts in ported static tests - #3284

Draft
spencer-tb wants to merge 1 commit into
ethereum:forks/amsterdamfrom
spencer-tb:inline-ported-expect-posts
Draft

refactor(tests): inline resolved expect posts in ported static tests#3284
spencer-tb wants to merge 1 commit into
ethereum:forks/amsterdamfrom
spencer-tb:inline-ported-expect-posts

Conversation

@spencer-tb

Copy link
Copy Markdown
Contributor

Description

Compiles away the runtime resolve_expect_post helper from 314 of the 331 ported static tests that still consume it (execution_testing.specs.static_state.expect_section).

Every consumer is fork-invariant modulo 5 files: its expect_entries_ table maps (d, g, v) index patterns to posts under a single fork constraint, so the resolver's first-match logic can be evaluated at rewrite time. The codemod resolves each parametrized (d, g, v) case statically and rewrites the test to construct its post directly — a single inline post = {...} where all cases share one result, or an expect_posts list plus a (d, g, v) → index mapping where they differ, with _exc mappings for the exception-carrying files.

Verified fixture-identical: A/B fill of all 331 consumers (12,375 cases, 993 fixture files) before/after, byte-equal apart from the _info source-line URLs.

17 files remain on the resolver (hand pile, for a follow-up): 5 with genuinely fork-varying expectations, 4 building entries programmatically, 4 with fork-keyed exception maps, 3 discarding a declared exception, and 1 using resolve_expect_post_fork. Once those are rewritten, expect_section's runtime role is gone and #3283's post_state_resolution.py relocation shrinks accordingly.

Codemod: one-off script, not committed; reproducible from the PR description if needed.

Related Issues or PRs

Part of the #3272 endgame (dissolving the legacy expect-table dialect). Reduces the surface #3283 must relocate.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.49%. Comparing base (9d6e6f8) to head (b0c93af).

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3284   +/-   ##
================================================
  Coverage            93.49%   93.49%           
================================================
  Files                  625      625           
  Lines                37032    37032           
  Branches              3385     3385           
================================================
  Hits                 34623    34623           
  Misses                1653     1653           
  Partials               756      756           
Flag Coverage Δ
unittests 93.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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