Skip to content

all: Abstract fixtures, StateTest refactor #354

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

Merged

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Dec 6, 2023

🗒️ Description

Accomplishes the first steps to implement a fully functional StateTest generator in execution-spec-tests:

  • Abstracts Fixture into a BaseFixture, in order to be able to implement a new fixture type, that is StateTest
  • Refactors the existing functionality of StateTest (i.e. generating a simple blockchain test) into a class that generates a BlockchainTests. This class should, in a follow-up PR, generate a StateTestFixture, depending on the parameters used to run the test filler.
  • Refactored the spec folder to include a subfolder per test type (at the moment only blockchain and state)
  • Moved types FixtureHeader, FixtureExecutionPayload, FixtureEngineNewPayload, FixtureBlock and Fixture into spec/blockchain/types.py, since these types are pertinent only to the BlockchainTest type.

At the moment, the functionality and output fixtures are (or should be) unchanged.

Remaining tasks (follow-up PRs):

  • spec/state/types.py should have its own class Fixture that represents an output fixture of the state tests.
  • Refactor the FixtureCollector class so it behaves differently depending on the test type that it's collecting (in my opinion, we should collect only one type per run, so it should panic if it finds two different types, but this is open to discussion)

🔗 Related Issues

Towards fixing #343

✅ 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: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@marioevz marioevz added scope:tools Scope: Changes ethereum_test_tools package type:refactor Type: Refactor type:feat type: Feature labels Dec 6, 2023
@marioevz marioevz merged commit 4dc7364 into ethereum:feat/statetest Dec 7, 2023
marioevz added a commit that referenced this pull request Dec 22, 2023
* all: abstract fixtures, convert StateTest into a BlockchainTest generator

* fix: tox
marioevz added a commit that referenced this pull request Jan 6, 2024
* all: abstract fixtures, convert StateTest into a BlockchainTest generator

* fix: tox
marioevz added a commit that referenced this pull request Jan 10, 2024
* all: abstract fixtures, convert StateTest into a BlockchainTest generator

* fix: tox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:tools Scope: Changes ethereum_test_tools package type:feat type: Feature type:refactor Type: Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant