Skip to content
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

fix(fill,execute): register new label type markers to prevent warnings #1245

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

danceratopz
Copy link
Member

🗒️ Description

Follow-up to #1220.

  1. Register the new label type markers that get applied to tests to avoid pytest test session warnings, e.g.:
    ================================================== warnings summary ===================================================
    
    src/pytest_plugins/shared/helpers.py:37
      /home/dtopz/code/github/danceratopz/eest/src/pytest_plugins/shared/helpers.py:37: PytestUnknownMarkWarning: Unknown pytest.mark.state_test_from_eof_test - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
        getattr(
    ...
    
    (can be reproduced via fill tests/osaka --fork=osaka).
  2. Additionally adds a description field to LabeledExecuteFormat and LabeledFixtureFormat that can be used in the marker doc.

Fill

Command to view markers:

fill --markers

Relevant output:

@pytest.mark.blockchain_test: Tests that generate a blockchain test fixture.
@pytest.mark.blockchain_test_engine: Tests that generate a blockchain test fixture in Engine API format.
@pytest.mark.eof_test: Tests that generate an EOF test fixture.
@pytest.mark.state_test: Tests that generate a state test fixture.
@pytest.mark.transaction_test: Tests that generate a transaction test fixture.
@pytest.mark.eof_state_test: Tests that generate an EOF state_test.
@pytest.mark.eof_blockchain_test: Tests that generate an EOF blockchain_test.
@pytest.mark.eof_blockchain_test_engine: Tests that generate an EOF blockchain_test_engine.
@pytest.mark.state_test_from_eof_test: A state_test generated from an eof_test.
@pytest.mark.blockchain_test_from_eof_test: A blockchain_test generated from an eof_test.
@pytest.mark.blockchain_test_engine_from_eof_test: A blockchain_test_engine generated from an eof_test.
@pytest.mark.blockchain_test_from_state_test: A blockchain_test generated from a state_test
@pytest.mark.blockchain_test_engine_from_state_test: A blockchain_test_engine generated from a state_test
@pytest.mark.blockchain_test_engine_only: Only generate a blockchain test engine fixture
@pytest.mark.blockchain_test_only: Only generate a blockchain test fixture
@pytest.mark.eof_test_only: Only generate an EOF test fixture
@pytest.mark.eof_test_only: Only generate an EOF test fixture
@pytest.mark.state_test_only: Only generate a state test fixture

Execute

Command to view markers:

uv run execute remote --markers --rpc-seed-key=0xa --rpc-endpoint=foo --rpc-chain-id=1 --fork=cancun

Relevant output:

@pytest.mark.transaction_post: Simple transaction sending, then post-check after all transactions are included
@pytest.mark.eof_transaction_post: Tests that generate an EOF transaction_post.
@pytest.mark.transaction_post_from_eof_test: A transaction_post generated from an eof_test.
@pytest.mark.blockchain_test_engine_only: Only generate a blockchain test engine fixture
@pytest.mark.blockchain_test_only: Only generate a blockchain test fixture
@pytest.mark.eof_test_only: Only generate an EOF test fixture
@pytest.mark.eof_test_only: Only generate an EOF test fixture
@pytest.mark.state_test_only: Only generate a state test fixture

🔗 Related Issues

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.

@danceratopz danceratopz added type:bug Something isn't working scope:fw Scope: Framework (evm|tools|forks|pytest) scope:fill Scope: fill command scope:execute Scope: Changes to the execute command labels Feb 21, 2025
@danceratopz
Copy link
Member Author

@marioevz please improve the descriptions, if you can! 🙂

@danceratopz danceratopz requested a review from marioevz February 21, 2025 23:08
@marioevz
Copy link
Member

It seems like #1238 does something similar but doesn't have descriptions!

I'll merge 1238 first and then rebase this on top of that one to bring both together 👍

@marioevz marioevz force-pushed the register-new-x_test_from_y_test-markers branch from dd44917 to 823aa20 Compare February 24, 2025 19:00
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I like the descriptions more than in my previous implementation, it's nice that we enforce some thought on describing the labels/markers so we can guarantee quality.

I left the previous approach in #1238 instead of the one in this PR, but that's the only change I made. Will merge now.

@marioevz marioevz merged commit ed958b8 into main Feb 24, 2025
21 checks passed
@marioevz marioevz deleted the register-new-x_test_from_y_test-markers branch February 24, 2025 19:15
@danceratopz
Copy link
Member Author

Thanks for incorporating the descriptions @marioevz! I totally missed #1238, I definitely prefer #1238's approach for tracking the labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:execute Scope: Changes to the execute command scope:fill Scope: fill command scope:fw Scope: Framework (evm|tools|forks|pytest) type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants