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(pytest): actually check the fork before issuing a fork mismatch warning for yul compilation #429

Conversation

danceratopz
Copy link
Member

@danceratopz danceratopz commented Feb 8, 2024

🗒️ Description

This PR fixes an error introduced in #418: src/pytest_plugins/test_filler/test_filler.py always issued a warning for an incorrect fork, regardless of whether get_closest_fork_with_solc_support() returned the requried fork, or not. For example,

fill tests/homestead/yul/test_yul_example.py --fork=Shanghai -v

with a solc that supports Shanghai incorrectly warns:

============================================= warnings summary ==============================================
tests/homestead/yul/test_yul_example.py::test_yul[fork_Shanghai-blockchain_test]
tests/homestead/yul/test_yul_example.py::test_yul[fork_Shanghai-blockchain_test_hive]
tests/homestead/yul/test_yul_example.py::test_yul[fork_Shanghai-state_test]
  /home/dtopz/code/github/danceratopz/execution-spec-tests/src/pytest_plugins/test_filler/test_filler.py:376:
 UserWarning: Compiling Yul for Shanghai, not Shanghai.
    warnings.warn(f"Compiling Yul for {solc_target_fork}, not {fork}.")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================= 3 passed, 3 warnings in 0.34s =======================================

🔗 Related Issues

None.

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md. Unreleased; skipping changelog.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@danceratopz danceratopz added type:bug Something isn't working scope:pytest Scope: Pytest plugins labels Feb 8, 2024
Copy link
Collaborator

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

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

LGTM

@spencer-tb spencer-tb merged commit a614b87 into ethereum:main Feb 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:pytest Scope: Pytest plugins type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants