Skip to content

fix(consume): fixes for index generation with ethereum/tests #1303

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

Merged
merged 4 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Test fixtures for use by clients are available for each release on the [Github r

**Key:** ✨ = New, 🐞 = Fixed, 🔀 = Changed.

## 🔜 [Unreleased]

### 💥 Breaking Change

### 🛠️ Framework

#### `consume`

- 🐞 Improve index generation of ethereum/tests fixtures: Allow generation at any directory level and include `generatedTestHash` in the index file for the `fixture_hash` [#1303](https://github.com/ethereum/execution-spec-tests/pull/1303).

### 📋 Misc

### 🧪 Test Cases

## [v4.1.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v4.1.0) - 2025-03-11

### 💥 Breaking Changes
Expand Down
17 changes: 3 additions & 14 deletions src/cli/gen_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@

from .hasher import HashableItem

# TODO: remove when these tests are ported or fixed within ethereum/tests.
fixtures_to_skip = {
# These fixtures have invalid fields that we can't load into our pydantic models (bigint).
"BlockchainTests/GeneralStateTests/stTransactionTest/ValueOverflowParis.json",
"BlockchainTests/InvalidBlocks/bc4895-withdrawals/withdrawalsAmountBounds.json",
"BlockchainTests/InvalidBlocks/bc4895-withdrawals/withdrawalsIndexBounds.json",
"BlockchainTests/InvalidBlocks/bc4895-withdrawals/withdrawalsValidatorIndexBounds.json",
"BlockchainTests/InvalidBlocks/bc4895-withdrawals/withdrawalsAddressBounds.json",
}


def count_json_files_exclude_index(start_path: Path) -> int:
"""
Expand Down Expand Up @@ -155,9 +145,6 @@ def generate_fixtures_index(
for file in input_path.rglob("*.json"):
if file.name == "index.json" or ".meta" in file.parts:
continue
if any(fixture in str(file) for fixture in fixtures_to_skip):
rich.print(f"Skipping '{file}'")
continue

try:
fixtures: Fixtures = Fixtures.model_validate_json(file.read_text())
Expand All @@ -171,7 +158,9 @@ def generate_fixtures_index(
TestCaseIndexFile(
id=fixture_name,
json_path=relative_file_path,
fixture_hash=fixture.info.get("hash", None),
# eest uses hash; ethereum/tests uses generatedTestHash
fixture_hash=fixture.info.get("hash")
or f"0x{fixture.info.get('generatedTestHash')}",
fork=fixture.get_fork(),
format=fixture.__class__,
)
Expand Down