feat(pytest): add two commands that consume blockchain test fixtures#339
Merged
danceratopz merged 94 commits intoethereum:mainfrom May 8, 2024
Conversation
…ate-pytest-command
If blocktest is unavailable exit pytest before the test session starts. If --single-test is supported test individual fixtures using that, otherwise test per fixture file, not per single fixture.
6 tasks
…ate-pytest-command To get changes from feat(pytest): use node id as fixture name ethereum#342.
spencer-tb
reviewed
Nov 21, 2023
Collaborator
There was a problem hiding this comment.
Really appreciate this PR - its going to be very useful in the future once every client has a blocktest-like sub-command! Let's get this CI up and running :D
All further ideas are great as well! We should add the coverage to this weekly testing report for each client team
marioevz
reviewed
Nov 28, 2023
Member
marioevz
left a comment
There was a problem hiding this comment.
Few comments, but overall it's really impressive!
…ate-pytest-command This adds: ethereum#341, ethereum#342, ethereum#347.
…ate-pytest-command
This reverts commit cf17a4b.
Remove engine api WIP to reduce scope of the PR - it will be added at a later date.
marioevz
approved these changes
May 7, 2024
Member
marioevz
left a comment
There was a problem hiding this comment.
LGTM! I think we should be able to merge directly to main.
As introduced for `fill` in ethereum#542.
…command' of github.com:danceratopz/execution-spec-tests into feat/pytest/add-a-verify-fixtures-as-a-separate-pytest-command
kclowes
pushed a commit
to kclowes/execution-spec-tests
that referenced
this pull request
Oct 20, 2025
Co-authored-by: spencer <spencer.taylor-brown@ethereum.org> Co-authored-by: Mario Vega <marioevz@gmail.com>
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
This PR:
consume, which acts as a base command with sub-commands corresponding to the different way clients can consume json test fixtures.consume directcommand that takes a directory containing JSON fixture files and an evm tool as command-line arguments (currently geth evm tool only).For example:
consume rlpcommand that implements the hive/simulators/ethereum/consensus simulator as a pytest plugin. If a hive server is started in--devmode, such as:HIVE_SIMULATORevn var must be set) as: example:The skeleton is there to add a re-write of the "pyspec" (consume-via-engine-api) simulator, but this is currently not implemented.
consume directThis is another pytest-based command that dynamically generates test cases for every fixture in the fixture files located in the fixture directory. Each test case executes the

blocktestcommand using--single-test(see ethereum/go-ethereum#28421) to execute the tests on a per-fixture level:If

--run/--single-fixtureis not available inblocktest, it falls back to the usualblocktestbehaviour of executing all fixtures within the provided json file:Further ideas:
_infosections usingfillthat can be used when generating the tests in fill, for example, which eips are required to run the test; xfail if not supported.--junit-xml=test_results.xmloption and the publish-test-results Github Action, for example. Can also be combined with xdist to get parallelisation out of the box.This is how consume fits in within execution-spec-tests and alongside other ways of consuming fixtures:

consume rlpRequires: https://github.com/danceratopz/hive.py/tree/fix/client/files-def-in-post-with-files
A re-write of the
hive/simulators/ethereum/consensussimulator as a pytest plugin.Lots to talk about and still lots to fix 😄
Currently works with go-ethereum and besu. This is also possible:
then
consume rlpwill parametrize each blockchain test byclient_type.Dockerized Usage with Hive
The simulator be ran (without
--devmode) in Hive with:using this Dockerfile:
https://github.com/danceratopz/hive/blob/mek-it-snek/simulators/ethereum/eest-block-rlp/Dockerfile#L1-L15
This currently has no testing and no docs.
TODO:
fillandconsume. Need to make it clear thatfillgenerates test cases andconsumeexecutes them as a module test.fill | consume directand merge feat(pytest): enable piping offill's json toconsume rlpdanceratopz/execution-spec-tests#26consume rlp.🔗 Related Issues
✅ Checklist
mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.