Skip to content

Commit 7bc95e1

Browse files
authored
feat(test-consume,deps): use register_multi_test_client to fix client logs in test reports (#2476)
* chore(deps): bump ethereum-hive to latest release No changes for single-test hive test/clients; this ethereum-hive release updates the name of the method and endpoint for registering tests agains a multi-test client, cf ethereum/hive-python-api#15. * feat(test-consume): activate per-test result reporting for enginex tests
1 parent f5a210f commit 7bc95e1

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

packages/testing/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ classifiers = [
2020
]
2121
dependencies = [
2222
"click>=8.1.0,<9",
23-
"ethereum-hive>=0.1.0a1,<1.0.0",
23+
"ethereum-hive>=0.1.0a5,<1.0.0",
2424
"ethereum-execution",
2525
"gitpython>=3.1.31,<4",
2626
"PyJWT>=2.3.0,<3",

packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/simulators/enginex/conftest.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,26 @@ def test_suite_description() -> str:
122122
)
123123

124124

125+
@pytest.fixture(scope="function", autouse=True)
126+
def _per_test_reporting(
127+
client: Client,
128+
hive_test: HiveTest,
129+
) -> None:
130+
"""
131+
Register a test for execution against a multi-test client.
132+
133+
Activate log segment capturing in the Hive backend for correct
134+
client log reporting in the multi-test client case.
135+
136+
Parameter order matters: `client` listed before `hive_test`
137+
ensures pytest sets up `client` first and tears it down last.
138+
This guarantees `hive_test` teardown (`test.end()`) runs while
139+
the hive node still exists, before `client` teardown calls
140+
`mark_test_completed` / `client.stop()`.
141+
"""
142+
hive_test.register_multi_test_client(client)
143+
144+
125145
@pytest.fixture(scope="function")
126146
def client(
127147
multi_test_hive_test: HiveTest,
@@ -179,6 +199,7 @@ def client(
179199
multi_test_client_manager.register_client(
180200
group_identifier, resolved_client
181201
)
202+
resolved_client.multi_test = True
182203

183204
try:
184205
yield resolved_client

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)