Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: Refactor of spec for blockchain & state test generation #307

Merged
merged 5 commits into from
Oct 11, 2023

Conversation

spencer-tb
Copy link
Collaborator

@spencer-tb spencer-tb commented Sep 22, 2023

🗒️ Description

The refactor proposal is to use make_fixture() and make_hive_fixture() within fill.py, to abstract all the filling logic to both state_test.py and blockchain_test.py. These additions should make it easier to add the correct StateTest fixture format in the future.

🔗 Related Issues

This is a follow up PR to address some comments on #301.

Resolves the following issue #43.

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@danceratopz
Copy link
Member

Rebased onto main following the merge of #322 (#322 used a squash commit).

Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

Nice, looks cleaner to me!

Nice to see engine / "NoProof" removed from the pytest interface... that seemed unnecessary back when we did the pytest port.

src/ethereum_test_tools/spec/blockchain_test.py Outdated Show resolved Hide resolved
src/ethereum_test_tools/spec/blockchain_test.py Outdated Show resolved Hide resolved
src/ethereum_test_tools/spec/blockchain_test.py Outdated Show resolved Hide resolved
src/pytest_plugins/test_filler/test_filler.py Outdated Show resolved Hide resolved
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

I really like the changes, I'd like to diff the fixtures against the ones currently generated on main, just to double check we are not breaking anything :)

@danceratopz
Copy link
Member

I really like the changes, I'd like to diff the fixtures against the ones currently generated on main, just to double check we are not breaking anything :)

I diff'd 52f8514.

  • Without --enable-hive: The only differences I see are changes in fixture names (as mentioned above).
  • With --enable-hive: Also differences in names. Only other difference is the presence of engineFcuVersion where it was previously missing (presumably a good thing? :))
diff '--color=auto' -r fixtures-geth-main-hive-ordered/shanghai/eip4895_withdrawals/withdrawals/use_value_in_tx.json fixtures-refactor-spec-hive-ordered/shanghai/eip4895_withdrawals/withdrawals/use_value_in_tx.json
7a8
>         "engineFcuVersion": "2",
187a189
>         "engineFcuVersion": "3",

image

This undoes any changes in the fixture names used in JSON fixture files.
Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

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

LGTM!

I decided not to use nodeid for fixture names in JSON within the scope of this PR, and created a ticket instead, see:

@danceratopz danceratopz merged commit 0992ed8 into ethereum:main Oct 11, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:fw Scope: Framework (evm|tools|forks|pytest) type:refactor Type: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants