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

πŸ“„ docs: A guide to porting tests #1165

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

raxhvl
Copy link
Contributor

@raxhvl raxhvl commented Feb 1, 2025

πŸ—’οΈ Description

Everything I know about porting tests.

πŸ”— Related Issues

Closes #1153

βœ… Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.


## Background

EEST is the successor to [ethereum/tests](https://github.com/ethereum/tests) (aka "legacy tests"), a repository that defined EVM test cases from the [Frontier](https://ethereum.org/en/history/#frontier) phase up to and including [The Merge](https://ethereum.org/en/history/#paris). These test cases are specified as YAML (and occasionally JSON) files in the [`./src/`](https://github.com/ethereum/tests/tree/develop/src) sub-directory. JSON test fixtures, which are fully-populated tests that can be executed against clients, are generated using [ethereum/retesteth](https://github.com/ethereum/retesteth). These JSON artifacts are regenerated when needed and added to the repository, typically in the [`./GeneralStateTests/`](https://github.com/ethereum/tests/tree/develop/GeneralStateTests) sub-directory.
Copy link
Contributor

@winsvega winsvega Feb 3, 2025

Choose a reason for hiding this comment

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

confusion here as legacy tests are in ethereum/legacytests. (actual tests from Frontier to Cancun)
in ethereum/tests are the most recent version of test vectors currently being filled for cancun and possibly prague.

it is actually mostly json fillers than yaml.


!!! note "Expected coverage loss"

EEST uses [pytest](https://docs.pytest.org/en/stable/), a Python testing library, for testing Ethereum specifications, while legacy tests relied on the EVM to handle much of the execution. This difference can lead to coverage gaps. EEST favors dynamic contract creation for each test vector, while legacy tests preferred a single static contract with multiple test vectors determined by transaction input data.
Copy link
Contributor

Choose a reason for hiding this comment

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

as a note here that yul tests or some tests used calldataload that might no longer needed when designing a test with python. but we should always investigate if an opcode is not covered anymore to see if its ok

Copy link
Contributor

@winsvega winsvega left a comment

Choose a reason for hiding this comment

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

Added clarification comments

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.

Create documentation guide on how to deal with coverage errors on PRs porting legacy tests
2 participants