Skip to content

Commit 90e7ed9

Browse files
committed
refactor: rename package + generalize framework + use consensus scope
- Rename the package to ``lean-ethereum-testing`` - Rename `uv` workspace package to ``packages/testing`` - Refactor the package into a generalized framework component and ``consensus_testing`` module that focuses on testing the consensus protocol. This opens up the possibility of adding execution-specific testing in the future. - Use `tests/consensus/{fork}` as consensus tests that generate vectors. - Uses a ``--layer`` flag for ``fill`` that defaults to ``consensus`` scope we don't even have to think about this separation for now.
1 parent d3a9abf commit 90e7ed9

File tree

36 files changed

+523
-295
lines changed

36 files changed

+523
-295
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ uv run tox # Everything (checks + tests + docs)
5050
2. **Spec tests** (`tests/spec_tests/`) - Generate JSON test vectors via fillers
5151

5252
**Test Filling Framework:**
53-
- Pytest plugin in `packages/tests/src/lean_spec_tests/pytest_plugins/filler.py`
53+
- Pytest plugin in `packages/testing/src/consensus_testing/pytest_plugins/filler.py`
5454
- Write spec tests using `state_transition_test` or `fork_choice_test` fixtures
5555
- These fixtures are type aliases that create test vectors when called
5656
- Run `uv run fill --fork=devnet --clean` to generate fixtures in `fixtures/`
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Lean Spec Tests
1+
# Lean Ethereum Specification Testing Framework
22

3-
Consensus test authoring framework for Lean Ethereum specifications.
3+
Testing framework for generating and running Lean Ethereum specification tests.
44

55
This package provides tools for generating consensus test fixtures, including:
66
- Pytest plugins for fixture generation
@@ -21,7 +21,7 @@ uv sync --all-extras
2121
Generate test fixtures using the `fill` command:
2222

2323
```bash
24-
uv run fill --fork=devnet --clean
24+
uv run fill --clean --fork=devnet
2525
```
2626

2727
See the main project documentation for more details.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ requires = ["setuptools>=77.0.3", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "lean-spec-tests"
6+
name = "lean-ethereum-testing"
77
version = "0.0.1"
8-
description = "Lean Ethereum consensus test authoring framework"
8+
description = "Lean Ethereum client test generation and runner framework"
99
readme = "README.md"
1010
authors = [
1111
{ name = "Ethereum Foundation", email = "thomas.coratger@ethereum.org" },
@@ -38,7 +38,7 @@ Source = "https://github.com/leanEthereum/lean-spec"
3838
Issues = "https://github.com/leanEthereum/lean-spec/issues"
3939

4040
[project.scripts]
41-
fill = "lean_spec_tests.cli.fill:fill"
41+
fill = "framework.cli.fill:fill"
4242

4343
[tool.setuptools.packages.find]
4444
where = ["src"]

packages/tests/src/lean_spec_tests/__init__.py renamed to packages/testing/src/consensus_testing/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from typing import Type
44

5-
from .base_types import CamelModel
5+
from framework.base_types import CamelModel
6+
67
from .builders import BlockBuilder
78
from .test_fixtures import (
89
BaseConsensusFixture,
File renamed without changes.

packages/tests/src/lean_spec_tests/forks/__init__.py renamed to packages/testing/src/consensus_testing/forks/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from typing import Type
44

5-
from .base import BaseFork, BaseForkMeta
5+
from framework.forks import BaseFork, BaseForkMeta
6+
67
from .forks import Devnet
78
from .helpers import (
89
ALL_FORKS,

packages/tests/src/lean_spec_tests/forks/forks.py renamed to packages/testing/src/consensus_testing/forks/forks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Devnet fork definition."""
22

3-
from .base import BaseFork
3+
from framework.forks import BaseFork
44

55

66
class Devnet(BaseFork):
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""Consensus layer fork discovery and helpers."""
2+
3+
from typing import FrozenSet, Set, Type
4+
5+
from framework.forks import BaseFork
6+
from framework.forks.helpers import (
7+
get_all_forks,
8+
get_forks_with_no_parents,
9+
get_from_until_fork_set,
10+
)
11+
from framework.forks.helpers import (
12+
get_fork_by_name as _get_fork_by_name,
13+
)
14+
from framework.forks.helpers import (
15+
get_forks as _get_forks,
16+
)
17+
18+
from . import forks
19+
20+
# Discover all consensus forks at module import time
21+
ALL_FORKS: FrozenSet[Type[BaseFork]] = get_all_forks(forks)
22+
"""All available consensus forks, excluding ignored forks."""
23+
24+
25+
def get_forks() -> Set[Type[BaseFork]]:
26+
"""
27+
Return the set of all available consensus forks.
28+
29+
Returns:
30+
Set of all non-ignored consensus fork classes.
31+
"""
32+
return _get_forks(ALL_FORKS)
33+
34+
35+
def get_fork_by_name(fork_name: str) -> Type[BaseFork] | None:
36+
"""
37+
Get a consensus fork class by its name.
38+
39+
Args:
40+
fork_name: Name of the fork (case-insensitive).
41+
42+
Returns:
43+
The fork class, or None if not found.
44+
"""
45+
return _get_fork_by_name(ALL_FORKS, fork_name)
46+
47+
48+
# Re-export the generic helpers for convenience
49+
__all__ = [
50+
"ALL_FORKS",
51+
"get_forks",
52+
"get_fork_by_name",
53+
"get_forks_with_no_parents",
54+
"get_from_until_fork_set",
55+
]
File renamed without changes.

packages/tests/src/lean_spec_tests/test_fixtures/__init__.py renamed to packages/testing/src/consensus_testing/test_fixtures/__init__.py

File renamed without changes.

0 commit comments

Comments
 (0)