Skip to content

Commit 0fdd974

Browse files
authored
fix(tests): Mark slowest deployed tests as slow (#1925)
* fix(tests): Mark slowest deployed tests as slow * fix(tests): Update test_scenarios.py with coveraged missed reason
1 parent d906a14 commit 0fdd974

File tree

4 files changed

+43
-41
lines changed

4 files changed

+43
-41
lines changed

tests/frontier/scenarios/common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ def result(self) -> ProgramResult:
135135
"""Test program result."""
136136
pass
137137

138+
def __str__(self) -> str:
139+
"""Return the ID (for use as pytest test name)."""
140+
return self.id
141+
138142

139143
@dataclass
140144
class ScenarioDebug:

tests/frontier/scenarios/test_scenarios.py

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -104,44 +104,6 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
104104
return scenarios_list
105105

106106

107-
program_classes = [
108-
ProgramSstoreSload(),
109-
ProgramTstoreTload(),
110-
ProgramLogs(),
111-
ProgramSuicide(),
112-
ProgramInvalidOpcode(),
113-
ProgramAddress(),
114-
ProgramBalance(),
115-
ProgramOrigin(),
116-
ProgramCaller(),
117-
ProgramCallValue(),
118-
ProgramCallDataLoad(),
119-
ProgramCallDataSize(),
120-
ProgramCallDataCopy(),
121-
ProgramCodeCopyCodeSize(),
122-
ProgramGasPrice(),
123-
ProgramExtCodeCopyExtCodeSize(),
124-
ProgramReturnDataSize(),
125-
ProgramReturnDataCopy(),
126-
ProgramExtCodehash(),
127-
ProgramBlockhash(),
128-
ProgramCoinbase(),
129-
ProgramTimestamp(),
130-
ProgramNumber(),
131-
ProgramDifficultyRandao(),
132-
ProgramGasLimit(),
133-
ProgramChainid(),
134-
ProgramSelfbalance(),
135-
ProgramBasefee(),
136-
ProgramBlobhash(),
137-
ProgramBlobBaseFee(),
138-
ProgramTload(),
139-
ProgramMcopy(),
140-
ProgramPush0(),
141-
ProgramAllFrontierOpcodes(),
142-
]
143-
144-
145107
@pytest.mark.ported_from(
146108
[
147109
"https://github.com/ethereum/tests/blob/v13.3/src/Templates/DiffPlaces/templateGen.js",
@@ -151,6 +113,7 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
151113
"https://github.com/ethereum/tests/blob/v13.3/src/GeneralStateTestsFiller/stSelfBalance/diffPlacesFiller.yml",
152114
],
153115
pr=["https://github.com/ethereum/execution-spec-tests/pull/808"],
116+
coverage_missed_reason=("Original test pre-sets storage of some of the deployed accounts."),
154117
)
155118
@pytest.mark.valid_from("Frontier")
156119
@pytest.mark.parametrize(
@@ -169,8 +132,42 @@ def scenarios(fork: Fork, pre: Alloc, test_program: ScenarioTestProgram) -> List
169132
)
170133
@pytest.mark.parametrize(
171134
"test_program",
172-
program_classes,
173-
ids=[cls.id for cls in program_classes],
135+
[
136+
ProgramSstoreSload(),
137+
ProgramTstoreTload(),
138+
ProgramLogs(),
139+
ProgramSuicide(),
140+
pytest.param(ProgramInvalidOpcode(), marks=[pytest.mark.slow()]),
141+
ProgramAddress(),
142+
ProgramBalance(),
143+
ProgramOrigin(),
144+
ProgramCaller(),
145+
ProgramCallValue(),
146+
ProgramCallDataLoad(),
147+
ProgramCallDataSize(),
148+
ProgramCallDataCopy(),
149+
ProgramCodeCopyCodeSize(),
150+
ProgramGasPrice(),
151+
ProgramExtCodeCopyExtCodeSize(),
152+
ProgramReturnDataSize(),
153+
ProgramReturnDataCopy(),
154+
ProgramExtCodehash(),
155+
pytest.param(ProgramBlockhash(), marks=[pytest.mark.slow()]),
156+
ProgramCoinbase(),
157+
ProgramTimestamp(),
158+
ProgramNumber(),
159+
ProgramDifficultyRandao(),
160+
ProgramGasLimit(),
161+
ProgramChainid(),
162+
ProgramSelfbalance(),
163+
ProgramBasefee(),
164+
ProgramBlobhash(),
165+
ProgramBlobBaseFee(),
166+
ProgramTload(),
167+
ProgramMcopy(),
168+
ProgramPush0(),
169+
ProgramAllFrontierOpcodes(),
170+
],
174171
)
175172
def test_scenarios(
176173
blockchain_test: BlockchainTestFiller,

tests/prague/eip2537_bls_12_381_precompiles/test_bls12_variable_length_input_contracts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
REFERENCE_SPEC_GIT_PATH = ref_spec_2537.git_path
1717
REFERENCE_SPEC_VERSION = ref_spec_2537.version
1818

19-
pytestmark = pytest.mark.valid_from("Prague")
19+
pytestmark = [pytest.mark.valid_from("Prague"), pytest.mark.slow]
2020

2121
G1_MSM_K_INPUT_LENGTH = len(PointG1() + Scalar())
2222
G2_MSM_K_INPUT_LENGTH = len(PointG2() + Scalar())

tests/prague/eip2935_historical_block_hashes_from_state/test_block_hashes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def generate_block_check_code(
9999
[1, Spec.BLOCKHASH_OLD_WINDOW + 1],
100100
],
101101
)
102+
@pytest.mark.slow()
102103
@pytest.mark.valid_at_transition_to("Prague")
103104
def test_block_hashes_history_at_transition(
104105
blockchain_test: BlockchainTestFiller,

0 commit comments

Comments
 (0)