feat(forks,plugins): Fork transition test marker#1081
Merged
Conversation
3 tasks
420e221 to
270870b
Compare
danceratopz
reviewed
Jan 16, 2025
Member
danceratopz
left a comment
There was a problem hiding this comment.
How about:
@pytest.mark.valid_at_transition_to("Cancun", subsequent_transitions=True, until="Osaka")
0cf221b to
cef281f
Compare
Member
Author
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 |
16 tasks
10905cb to
53754e9
Compare
winsvega
reviewed
Jan 21, 2025
winsvega
reviewed
Jan 21, 2025
winsvega
reviewed
Jan 21, 2025
This was referenced Jan 22, 2025
* refactor(forks): make `name()` an abstractmethod * refactor(forks): add helper methods to simplify fork comparisons
Member
Author
|
@danceratopz merged your suggestion from the other PR, this one should be ready 😄 |
danceratopz
approved these changes
Jan 22, 2025
Member
danceratopz
left a comment
There was a problem hiding this comment.
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 <danceratopz@gmail.com>
Co-authored-by: danceratopz <danceratopz@gmail.com>
Co-authored-by: danceratopz <danceratopz@gmail.com>
fselmo
pushed a commit
to fselmo/execution-spec-tests
that referenced
this pull request
Jan 24, 2025
* 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 <danceratopz@gmail.com> * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <danceratopz@gmail.com> * Update src/pytest_plugins/forks/forks.py Co-authored-by: danceratopz <danceratopz@gmail.com> * fixup --------- Co-authored-by: danceratopz <danceratopz@gmail.com>
8 tasks
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
Adds two keyword parameters to the
valid_at_transition_tomarker: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
ShanghaiToCancunAtTime15kandCancunToPragueAtTime15k, 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
ValidAtTransitionTofor an example of how such a validity marker is defined.🔗 Related Issues
None
✅ Checklist
mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.