-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat(pytest): add two commands that consume blockchain test fixtures #339
feat(pytest): add two commands that consume blockchain test fixtures #339
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.
…ate-pytest-command To get changes from feat(pytest): use node id as fixture name ethereum#342.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments, but overall it's really impressive!
src/pytest_plugins/consume_via_engine_api/consume_via_engine_api.py
Outdated
Show resolved
Hide resolved
…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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
🗒️ 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 direct
command that takes a directory containing JSON fixture files and an evm tool as command-line arguments (currently geth evm tool only).For example:
consume rlp
command that implements the hive/simulators/ethereum/consensus simulator as a pytest plugin. If a hive server is started in--dev
mode, such as:HIVE_SIMULATOR
evn 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 direct
This 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
blocktest
command using--single-test
(see ethereum/go-ethereum#28421) to execute the tests on a per-fixture level:If
--run
/--single-fixture
is not available inblocktest
, it falls back to the usualblocktest
behaviour of executing all fixtures within the provided json file:Further ideas:
_info
sections usingfill
that 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.xml
option 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 rlp
Requires: https://github.com/danceratopz/hive.py/tree/fix/client/files-def-in-post-with-files
A re-write of the
hive/simulators/ethereum/consensus
simulator 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 rlp
will parametrize each blockchain test byclient_type
.Dockerized Usage with Hive
The simulator be ran (without
--dev
mode) 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:
fill
andconsume
. Need to make it clear thatfill
generates test cases andconsume
executes them as a module test.fill | consume direct
and merge feat(pytest): enable piping offill
's json toconsume rlp
danceratopz/execution-spec-tests#26consume rlp
.🔗 Related Issues
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.