Skip to content

Commit b5f1d95

Browse files
feat(fill,tests): add ported_from pytest marker (#1590)
* add ported_from test marker to converted from json tests * chore: fix test in md link in `converted-ethereum-tests.txt` * docs: update changelog * Update docs/CHANGELOG.md --------- Co-authored-by: danceratopz <danceratopz@gmail.com>
1 parent 147e4d2 commit b5f1d95

File tree

15 files changed

+156
-1
lines changed

15 files changed

+156
-1
lines changed

converted-ethereum-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ GeneralStateTests/VMTests/vmTests/push.json
252252
([#1067](https://github.com/ethereum/execution-spec-tests/pull/1067))
253253
GeneralStateTests/stPreCompiledContracts/blake2B.json
254254

255-
([#1067](https://github.com/ethereum/execution-spec-tests/pull/1120))
255+
([#1120](https://github.com/ethereum/execution-spec-tests/pull/1120))
256256
GeneralStateTests/stPreCompiledContracts/idPrecomps.json
257257

258258
([#1244](https://github.com/ethereum/execution-spec-tests/pull/1244))

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The output behavior of `fill` has changed ([#1608](https://github.com/ethereum/e
1919

2020
#### `fill`
2121

22+
- ✨ Add `ported_from` test marker to track Python test cases that were converted from static fillers in [ethereum/tests](https://github.com/ethereum/tests) repository [#1590](https://github.com/ethereum/execution-spec-tests/pull/1590).
2223
- 🔀 Refactor: Encapsulate `fill`'s fixture output options (`--output`, `--flat-output`, `--single-fixture-per-file`) into a `FixtureOutput` class ([#1471](https://github.com/ethereum/execution-spec-tests/pull/1471),[#1612](https://github.com/ethereum/execution-spec-tests/pull/1612)).
2324
- ✨ Don't warn about a "high Transaction gas_limit" for `zkevm` tests ([#1598](https://github.com/ethereum/execution-spec-tests/pull/1598)).
2425
- 🐞 `fill` no longer writes generated fixtures into an existing, non-empty output directory; it must now be empty or `--clean` must be used to delete it first ([#1608](https://github.com/ethereum/execution-spec-tests/pull/1608)).

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ testpaths = tests/
66
markers =
77
slow
88
pre_alloc_modify
9+
ported_from
910
addopts =
1011
-p pytest_plugins.concurrency
1112
-p pytest_plugins.filler.pre_alloc

tests/cancun/eip1153_tstore/test_basic_tload.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
REFERENCE_SPEC_VERSION = ref_spec_1153.version
1717

1818

19+
@pytest.mark.ported_from(
20+
[
21+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/01_tloadBeginningTxnFiller.yml",
22+
],
23+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
24+
)
1925
@pytest.mark.valid_from("Cancun")
2026
def test_basic_tload_transaction_begin(
2127
state_test: StateTestFiller,
@@ -61,6 +67,12 @@ def test_basic_tload_transaction_begin(
6167
state_test(env=Environment(), pre=pre, post=post, tx=tx)
6268

6369

70+
@pytest.mark.ported_from(
71+
[
72+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/02_tloadAfterTstoreFiller.yml",
73+
],
74+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
75+
)
6476
@pytest.mark.valid_from("Cancun")
6577
def test_basic_tload_works(
6678
state_test: StateTestFiller,
@@ -113,6 +125,12 @@ def test_basic_tload_works(
113125
state_test(env=Environment(), pre=pre, post=post, tx=tx)
114126

115127

128+
@pytest.mark.ported_from(
129+
[
130+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/03_tloadAfterStoreIs0Filler.yml",
131+
],
132+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
133+
)
116134
@pytest.mark.valid_from("Cancun")
117135
def test_basic_tload_other_after_tstore(
118136
state_test: StateTestFiller,
@@ -161,6 +179,12 @@ def test_basic_tload_other_after_tstore(
161179
state_test(env=Environment(), pre=pre, post=post, tx=tx)
162180

163181

182+
@pytest.mark.ported_from(
183+
[
184+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/16_tloadGasFiller.yml",
185+
],
186+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
187+
)
164188
@pytest.mark.valid_from("Cancun")
165189
def test_basic_tload_gasprice(
166190
state_test: StateTestFiller,
@@ -239,6 +263,12 @@ def test_basic_tload_gasprice(
239263
state_test(env=Environment(), pre=pre, post=post, tx=tx)
240264

241265

266+
@pytest.mark.ported_from(
267+
[
268+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/18_tloadAfterStoreFiller.yml",
269+
],
270+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
271+
)
242272
@pytest.mark.valid_from("Cancun")
243273
def test_basic_tload_after_store(
244274
state_test: StateTestFiller,

tests/cancun/eip1153_tstore/test_tload_calls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
REFERENCE_SPEC_VERSION = "1eb863b534a5a3e19e9c196ab2a7f3db4bb9da17"
1414

1515

16+
@pytest.mark.ported_from(
17+
[
18+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/04_tloadAfterCallFiller.yml",
19+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/12_tloadDelegateCallFiller.yml",
20+
],
21+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
22+
)
1623
@pytest.mark.valid_from("Cancun")
1724
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL])
1825
def test_tload_calls(state_test: StateTestFiller, pre: Alloc, call_type: Op):

tests/cancun/eip1153_tstore/test_tload_reentrancy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class CallDestType(Enum):
3333
EXTERNAL_CALL = 2
3434

3535

36+
@pytest.mark.ported_from(
37+
[
38+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/05_tloadReentrancyFiller.yml",
39+
],
40+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
41+
)
3642
@pytest.mark.valid_from("Cancun")
3743
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
3844
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])

tests/cancun/eip1153_tstore/test_tstore_reentrancy.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ class CallDestType(Enum):
3333
EXTERNAL_CALL = 2
3434

3535

36+
@pytest.mark.ported_from(
37+
[
38+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/06_tstoreInReentrancyCallFiller.yml",
39+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/07_tloadAfterReentrancyStoreFiller.yml",
40+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/08_revertUndoesTransientStoreFiller.yml",
41+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/09_revertUndoesAllFiller.yml",
42+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/11_tstoreDelegateCallFiller.yml",
43+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/13_tloadStaticCallFiller.yml",
44+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/Cancun/stEIP1153-transientStorage/20_oogUndoesTransientStoreInCallFiller.yml",
45+
],
46+
pr=["https://github.com/ethereum/execution-spec-tests/pull/440"],
47+
)
3648
@pytest.mark.valid_from("Cancun")
3749
@pytest.mark.parametrize("call_type", [Op.CALL, Op.CALLCODE, Op.DELEGATECALL, Op.STATICCALL])
3850
@pytest.mark.parametrize("call_return", [Op.RETURN, Op.REVERT, Om.OOG])

tests/constantinople/eip1014_create2/test_create_returndata.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
REFERENCE_SPEC_VERSION = ref_spec_1014.version
1616

1717

18+
@pytest.mark.ported_from(
19+
[
20+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_outsize_then_create2_successful_then_returndatasizeFiller.json",
21+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stCreate2/call_then_create2_successful_then_returndatasizeFiller.json",
22+
],
23+
pr=["https://github.com/ethereum/execution-spec-tests/pull/497"],
24+
)
1825
@pytest.mark.valid_from("Istanbul")
1926
@pytest.mark.parametrize("call_return_size", [35, 32, 0])
2027
@pytest.mark.parametrize("create_type", [Op.CREATE, Op.CREATE2])

tests/frontier/opcodes/test_all_opcodes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ def prepare_suffix(opcode: Opcode) -> Bytecode:
4646
return Op.STOP
4747

4848

49+
@pytest.mark.ported_from(
50+
[
51+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBadOpcode/badOpcodesFiller.json",
52+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stBugs/evmBytecodeFiller.json",
53+
],
54+
pr=["https://github.com/ethereum/execution-spec-tests/pull/748"],
55+
)
4956
@pytest.mark.valid_from("Frontier")
5057
def test_all_opcodes(state_test: StateTestFiller, pre: Alloc, fork: Fork):
5158
"""

tests/frontier/opcodes/test_calldatacopy.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
from ethereum_test_tools.vm.opcode import Opcodes as Op
88

99

10+
@pytest.mark.ported_from(
11+
[
12+
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/VMTests/vmTests/calldatacopyFiller.yml",
13+
],
14+
pr=["https://github.com/ethereum/execution-spec-tests/pull/1056"],
15+
)
1016
@pytest.mark.parametrize(
1117
"code,tx_data,code_address_storage,to_address_storage",
1218
[

0 commit comments

Comments
 (0)