Skip to content

refactor(tests): Enhance heavy ported tests#2623

Merged
marioevz merged 12 commits intoethereum:forks/amsterdamfrom
marioevz:enhance-heavy-ported-tests
Apr 10, 2026
Merged

refactor(tests): Enhance heavy ported tests#2623
marioevz merged 12 commits intoethereum:forks/amsterdamfrom
marioevz:enhance-heavy-ported-tests

Conversation

@marioevz
Copy link
Copy Markdown
Member

@marioevz marioevz commented Apr 6, 2026

🗒️ Description

Manually enhance some of the heaviest python ported tests in tests/ported_static, by programatically generating the bytecode contained in them instead of hard-coding them.

Removes ~322k lines of python code.

@leolara I've added:

@manually-enhanced: Do not overwrite. This test has been manually reviewed and
enhanced.

To the docstring in the header of each test, so we can check for @manually-enhanced to skip these tests when running the script again, wdyt? cc @spencer-tb

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

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

@marioevz marioevz changed the title Enhance heavy ported tests refactor(tests): Enhance heavy ported tests Apr 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.24%. Comparing base (d986207) to head (8570523).
⚠️ Report is 7 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #2623   +/-   ##
================================================
  Coverage            86.24%   86.24%           
================================================
  Files                  599      599           
  Lines                36984    36984           
  Branches              3795     3795           
================================================
  Hits                 31895    31895           
  Misses                4525     4525           
  Partials               564      564           
Flag Coverage Δ
unittests 86.24% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@leolara
Copy link
Copy Markdown
Member

leolara commented Apr 6, 2026

@marioevz I feel that if we do this, we are going to lose the opportunity to do the last step of the automatic porting to eliminate the hardcoded addresses.

I created this PR: #2535 that is in need of review, to be able to do the step of doing that by comparing traces.

I think it would be a good idea to discuss if we want to compare the traces by ignoring the stack or we can have access to the immediate values that are currently not in the trace.

@leolara leolara self-requested a review April 7, 2026 09:24
@marioevz marioevz force-pushed the enhance-heavy-ported-tests branch from 8a55e68 to 71046f9 Compare April 8, 2026 01:52
@marioevz
Copy link
Copy Markdown
Member Author

marioevz commented Apr 8, 2026

I've condensed the stTimeConsuming further to make it:

  • Much more legible: test cases now show exactly what they are trying to achieve.
  • Condensed: All tests now use a pytest parametrize into a single test function.

Commit 3b850b6 can be verified using --verify-traces and --verify-traces-comparator exact-no-stack-no-gas, but further commits break the naming of the tests so they cannot be verified like this.

@marioevz marioevz requested a review from spencer-tb April 8, 2026 01:54
@marioevz
Copy link
Copy Markdown
Member Author

marioevz commented Apr 8, 2026

cc @spencer-tb I believe this change is necessary because otherwise it would be a pain to verify what happens in each different file and test case for 8037.

Copy link
Copy Markdown
Contributor

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

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

LGTM! Just want to confirm the valid from changes were intentional :)
If so feel free to merge!

@marioevz marioevz merged commit 7f3ab55 into ethereum:forks/amsterdam Apr 10, 2026
18 checks passed
@marioevz marioevz deleted the enhance-heavy-ported-tests branch April 10, 2026 18:27
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