Skip to content

Commit 2cc73e3

Browse files
authored
chore(cli): consume direct geth blocktest fail fix (#1502)
* chore(cli): consume direct geth blocktest fail fix. * chore(docs): add changelog.
1 parent 175f2e9 commit 2cc73e3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Users can expect that all tests currently living in [ethereum/tests](https://git
2626

2727
#### `consume`
2828

29+
- 🐞 Fix consume direct fails for geth blockchain tests ([#1502](https://github.com/ethereum/execution-spec-tests/pull/1502)).
30+
2931
### 📋 Misc
3032

3133
### 🧪 Test Cases

src/ethereum_clis/clis/geth.py

+12
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,18 @@ def consume_blockchain_test(
268268
f"Unexpected exit code:\n{' '.join(command)}\n\n Error:\n{result.stderr}"
269269
)
270270

271+
result_json = json.loads(result.stdout)
272+
if not isinstance(result_json, list):
273+
raise Exception(f"Unexpected result from evm blocktest: {result_json}")
274+
275+
if any(not test_result["pass"] for test_result in result_json):
276+
exception_text = "Blockchain test failed: \n" + "\n".join(
277+
f"{test_result['name']}: " + test_result["error"]
278+
for test_result in result_json
279+
if not test_result["pass"]
280+
)
281+
raise Exception(exception_text)
282+
271283
@cache # noqa
272284
def consume_state_test_file(
273285
self,

0 commit comments

Comments
 (0)