Skip to content

Commit 7af6c71

Browse files
feat(execute): Use test spec names as markers for execute (#1367)
* fix(specs): Use labeled execute formats always * docs: Changelog * Update docs/CHANGELOG.md --------- Co-authored-by: danceratopz <[email protected]>
1 parent 4870360 commit 7af6c71

File tree

6 files changed

+30
-13
lines changed

6 files changed

+30
-13
lines changed

docs/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ consume cache --help
4343
- 🐞 Fix the node id for state tests marked by transition forks ([#1313](https://github.com/ethereum/execution-spec-tests/pull/1313)).
4444
- ✨ Add `static_filler` plug-in which allows to fill static YAML and JSON tests (from [ethereum/tests](https://github.com/ethereum/tests)) by adding flag `--fill-static-tests` to `uv run fill` ([#1336](https://github.com/ethereum/execution-spec-tests/pull/1336)).
4545

46+
#### `execute`
47+
48+
- 🔀 Test IDs have changed to include the name of the test spec where the test came from (e.g. `state_test`, `blockchain_test`, etc) ([#1367](https://github.com/ethereum/execution-spec-tests/pull/1367)).
49+
- ✨ Markers can now be used to execute only tests from a specific test spec type (e.g. `-m state_test`, `-m blockchain_test`, etc) ([#1367](https://github.com/ethereum/execution-spec-tests/pull/1367)).
50+
4651
### 📋 Misc
4752

4853
- 🔀 Bump the version of `execution-specs` used by the framework to the package [`ethereum-execution==1.17.0rc6.dev1`](https://pypi.org/project/ethereum-execution/1.17.0rc6.dev1/); bump the version used for test fixture generation for forks < Prague to current `execution-specs` master, [fa847a0](https://github.com/ethereum/execution-specs/commit/fa847a0e48309debee8edc510ceddb2fd5db2f2e) ([#1310](https://github.com/ethereum/execution-spec-tests/pull/1310)).

src/ethereum_test_specs/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class BaseTest(BaseModel):
5252
_t8n_call_counter: Iterator[int] = count(0)
5353

5454
supported_fixture_formats: ClassVar[Sequence[FixtureFormat | LabeledFixtureFormat]] = []
55-
supported_execute_formats: ClassVar[Sequence[ExecuteFormat | LabeledExecuteFormat]] = []
55+
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = []
5656

5757
supported_markers: ClassVar[Dict[str, str]] = {}
5858

src/ethereum_test_specs/blockchain.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,12 @@ class BlockchainTest(BaseTest):
297297
BlockchainFixture,
298298
BlockchainEngineFixture,
299299
]
300-
supported_execute_formats: ClassVar[Sequence[ExecuteFormat | LabeledExecuteFormat]] = [
301-
TransactionPost,
300+
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
301+
LabeledExecuteFormat(
302+
TransactionPost,
303+
"blockchain_test",
304+
"An execute test derived from a blockchain test",
305+
),
302306
]
303307

304308
supported_markers: ClassVar[Dict[str, str]] = {

src/ethereum_test_specs/eof.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ class EOFTest(BaseTest):
241241
for fixture_format in StateTest.supported_fixture_formats
242242
]
243243

244-
supported_execute_formats: ClassVar[Sequence[ExecuteFormat | LabeledExecuteFormat]] = [
244+
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
245245
LabeledExecuteFormat(
246246
execute_format,
247-
f"{execute_format.format_name}_from_eof_test",
248-
f"A {execute_format.format_name} generated from an eof_test.",
247+
f"{execute_format.label}_from_eof_test",
248+
f"A {execute_format.label} generated from an eof_test.",
249249
)
250250
for execute_format in StateTest.supported_execute_formats
251251
]
@@ -526,11 +526,11 @@ class EOFStateTest(EOFTest, Transaction):
526526
for fixture_format in StateTest.supported_fixture_formats
527527
]
528528

529-
supported_execute_formats: ClassVar[Sequence[ExecuteFormat | LabeledExecuteFormat]] = [
529+
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
530530
LabeledExecuteFormat(
531531
execute_format,
532-
f"eof_{execute_format.format_name}",
533-
f"Tests that generate an EOF {execute_format.format_name}.",
532+
f"eof_{execute_format.label}",
533+
f"Tests that generate an EOF {execute_format.label}.",
534534
)
535535
for execute_format in StateTest.supported_execute_formats
536536
]

src/ethereum_test_specs/state.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ class StateTest(BaseTest):
5858
)
5959
for fixture_format in BlockchainTest.supported_fixture_formats
6060
]
61-
supported_execute_formats: ClassVar[Sequence[ExecuteFormat | LabeledExecuteFormat]] = [
62-
TransactionPost,
61+
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
62+
LabeledExecuteFormat(
63+
TransactionPost,
64+
"state_test",
65+
"An execute test derived from a state test",
66+
),
6367
]
6468

6569
supported_markers: ClassVar[Dict[str, str]] = {

src/ethereum_test_specs/transaction.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ class TransactionTest(BaseTest):
3333
supported_fixture_formats: ClassVar[Sequence[FixtureFormat | LabeledFixtureFormat]] = [
3434
TransactionFixture,
3535
]
36-
supported_execute_formats: ClassVar[Sequence[ExecuteFormat | LabeledExecuteFormat]] = [
37-
TransactionPost,
36+
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
37+
LabeledExecuteFormat(
38+
TransactionPost,
39+
"transaction_test",
40+
"An execute test derived from a transaction test",
41+
),
3842
]
3943

4044
def make_transaction_test_fixture(

0 commit comments

Comments
 (0)