refactor(tests): inline resolved expect posts in ported static tests - #3284
Draft
spencer-tb wants to merge 1 commit into
Draft
refactor(tests): inline resolved expect posts in ported static tests#3284spencer-tb wants to merge 1 commit into
spencer-tb wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
Compiles away the runtime
resolve_expect_posthelper 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 inlinepost = {...}where all cases share one result, or anexpect_postslist plus a(d, g, v)→ index mapping where they differ, with_excmappings 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
_infosource-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'spost_state_resolution.pyrelocation 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
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture