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

feat(consume): Add consume cache, and --input flag accepts versioned release names #1044

Merged
merged 16 commits into from
Feb 7, 2025

Conversation

marioevz
Copy link
Member

@marioevz marioevz commented Dec 26, 2024

🗒️ Description

consume cache command

Takes same inputs as other consume commands, but it's only used to download and cache fixtures.

Useful to create docker containers and download the fixtures during the image creation process instead of each time the container runs.

The --cache-folder flag can also be specified to use a specific folder as cache, and when omitted it defaults to ethereum-execution-spec-tests/cached_downloads placed inside of the folder returned by platformdirs.user_cache_dir.

Release name parsing for --input flag

The --input flag now accepts release tags in the form <RELEASE_NAME>@<RELEASE_VERSION>, where <RELEASE_VERSION> can be in format v1.2.3 or the keyword latest to automatically fetch the latest version.

It uses the GitHub API to fetch the list of releases and automatically download the specified version for the given release name.

The list of releases is cached and only re-downloaded after 10 minutes have passed since the last query, except when running inside of a docker container or in CI, in order to cache only during image creation.

Keywords latest-stable-release and latest-develop-release are deprecated in favor of stable@latest or develop@latest respectively.

Hive instance information

The /hive endpoint of the hive server is now used to fetch information about the hive instance being used to execute the tests.

Information such as the client file used to configure the clients is now fetched and placed inside of the test description to aid on reproducibility.

🔗 Related Issues

Closes #787

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • 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.

@marioevz marioevz added scope:consume Scope: Consume command suite scope:fw Scope: Framework (evm|tools|forks|pytest) scope:tooling Scope: Python tools (uv, ruff, tox,...) type:feat type: Feature labels Dec 26, 2024
@marioevz marioevz changed the title feat(consume): Add consume cache and --release flag feat(consume): Add consume cache, and --input flag accepts versioned release names Jan 6, 2025
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.

Awesome PR, thanks for adding this - its so much better! Some comments below :)

consume cache

I love the hacky test_cache.py solution, I did try to find an alternative nonetheless. I think we can remove the --cache-only flag. Please follow comments for suggestions. With some of these the --help flag for both cache and non-cache commands look clean.

--input and releases

I validated that we could download any pre-release or url on my end, as well as stable@latest and develop@latest, including eip7692@latest which is awesome. I had to add pagination for the github api to get it work - more below. It could be nice to have an non-url method to download older stable releases but I don't think its necessary.

hive
I still need to validate the hiveview updates are propagated but looks good from my end.

src/pytest_plugins/consume/consume.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/consume.py Outdated Show resolved Hide resolved
src/cli/pytest_commands/consume.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/consume.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/consume.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/consume.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/consume.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/consume.py Show resolved Hide resolved
src/pytest_plugins/consume/releases.py Outdated Show resolved Hide resolved
src/pytest_plugins/consume/releases.py Outdated Show resolved Hide resolved
@marioevz
Copy link
Member Author

marioevz commented Feb 5, 2025

@spencer-tb Applied all the comments, thanks for the review!

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! :)

@marioevz marioevz merged commit b480efd into main Feb 7, 2025
21 checks passed
@marioevz marioevz deleted the consume-cache branch February 7, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:consume Scope: Consume command suite scope:fw Scope: Framework (evm|tools|forks|pytest) scope:tooling Scope: Python tools (uv, ruff, tox,...) type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(consume): refine the --input flag for fixture releases
2 participants