Skip to content

Conversation

danceratopz
Copy link
Owner

@danceratopz danceratopz commented Nov 28, 2023

🗒️ Description

This allows a user to pipe the JSON generated by fill directly to consume rlp without writing any intermediate files.

For example:

fill --output=stdout --fork=Merge | consume rlp -v

This is bit tricky as both commands are pytest-based and pytest is not designed for this purpose. Therefore, the click interface modifies command-line options:

  • for fill based on whether --output=stdout is set (in order to get pytest to not output anything else on its stdout). I didn't manage to add flags dynamically within a plugin. But perhaps this method is less hacky??! 🤣
  • for consume rlp if it detects that it's receiving input on stdin.

🔗 Related Issues

This could be an alternative solution to ethereum#324.

✅ Checklist

These should be ticked off in the main PR in execution-spec-tests: https://github.com/ethereum/execution-spec-tests/discussions

  • 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: 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.

This will only work if fixtures are generated from a single test module.
This is required to ensure that the json is correctly formatted even if it is generated from test cases that span multiple test modules. This is because by default fixture collection is performed on a test module level.
@danceratopz danceratopz merged commit 50085b6 into feat/pytest/add-a-verify-fixtures-as-a-separate-pytest-command Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant