-
Notifications
You must be signed in to change notification settings - Fork 107
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(forks,plugins): Fork transition test marker #1081
Conversation
420e221
to
270870b
Compare
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.
How about:
@pytest.mark.valid_at_transition_to("Cancun", subsequent_transitions=True, until="Osaka")
0cf221b
to
cef281f
Compare
Addresed on the latest commit, which also includes a nice refactor of all validity markers into separate classes: execution-spec-tests/src/pytest_plugins/forks/forks.py Lines 711 to 747 in 73ab2c9
|
10905cb
to
53754e9
Compare
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.
have a couple of questions
* refactor(forks): make `name()` an abstractmethod * refactor(forks): add helper methods to simplify fork comparisons
@danceratopz merged your suggestion from the other PR, this one should be ready 😄 |
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.
The refactoring of the validity markers is really nice! It adds much more structure to this plugin (I think this is one of the most complex parts of our pytest code). And really nice additional tests for these, btw! Few minor comments below.
Co-authored-by: danceratopz <[email protected]>
Co-authored-by: danceratopz <[email protected]>
Co-authored-by: danceratopz <[email protected]>
* feat(forks): Adds `supports_blobs` method * fix(forks): Transition fork comparisons * refactor,fix(plugins/forks): `fork_transition_test` marker * docs: add documentation, changelog * refactor(plugins/forks): Validity markers as classes * fix: fork set handling * fix(plugins): config variable usage in other plugins * fix(plugins/forks): Self-documenting code for validity marker classes * whitelist * refactor(forks): suggestions for fork transition marker changes (ethereum#1104) * refactor(forks): make `name()` an abstractmethod * refactor(forks): add helper methods to simplify fork comparisons * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <[email protected]> * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <[email protected]> * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <[email protected]> * fixup --------- Co-authored-by: danceratopz <[email protected]>
* feat(forks): Adds `supports_blobs` method * fix(forks): Transition fork comparisons * refactor,fix(plugins/forks): `fork_transition_test` marker * docs: add documentation, changelog * refactor(plugins/forks): Validity markers as classes * fix: fork set handling * fix(plugins): config variable usage in other plugins * fix(plugins/forks): Self-documenting code for validity marker classes * whitelist * refactor(forks): suggestions for fork transition marker changes (ethereum#1104) * refactor(forks): make `name()` an abstractmethod * refactor(forks): add helper methods to simplify fork comparisons * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <[email protected]> * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <[email protected]> * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <[email protected]> * fixup --------- Co-authored-by: danceratopz <[email protected]>
🗒️ Description
Adds two keyword parameters to the
valid_at_transition_to
marker:subsequent_forks: bool
: If set to True, the test will be generated for the transition fork to the specified fork name, but also for all subsequent transition forks. Default is False.until: str | None
: Specify an end to the fork transitions to be filed when usingsubsequent_forks=True
. Impliessubsequent_forks=True
. Default isNone
.E.g.
@pytest.mark.valid_at_transition_to("Cancun", subsequent_forks=True)
produces tests on
ShanghaiToCancunAtTime15k
andCancunToPragueAtTime15k
, and any transition fork after that.Also added unit tests in
src/pytest_plugins/forks/tests/test_markers.py
.Implementing tests for EIP-7691 in a separate PR, as required by lack of coverage pointed out in this thread: https://discord.com/channels/595666850260713488/1329093054698881087
Validity Markers Refactor
All validity markers are now defined as classes that subclass a base validity marker class,
ValidityMarker
.This allows simpler validity marker definition, and easier handling of keyword arguments if it is the case that a validity marker supports them. See
ValidAtTransitionTo
for an example of how such a validity marker is defined.🔗 Related Issues
None
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.