Skip to content

Commit 9785964

Browse files
committed
Move Launch UUID print on client side
1 parent 112cb0b commit 9785964

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

pytest_reportportal/plugin.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ def pytest_sessionstart(session):
104104

105105
if is_control(config) and not config._reporter_config.rp_launch_id:
106106
config.py_test_service.start_launch()
107-
if config._reporter_config.rp_launch_uuid_print:
108-
launch_id = config.py_test_service.rp.launch_id
109-
print(f'Report Portal Launch UUID: {launch_id}', file=config._reporter_config.rp_launch_uuid_print_output)
110107
if config.pluginmanager.hasplugin('xdist') \
111108
or config.pluginmanager.hasplugin('pytest-parallel'):
112109
if not wait_launch(session.config.py_test_service.rp):

pytest_reportportal/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,9 @@ def start(self) -> None:
890890
retries=self._config.rp_api_retries,
891891
verify_ssl=self._config.rp_verify_ssl,
892892
launch_id=launch_id,
893-
log_batch_payload_size=self._config.rp_log_batch_payload_size
893+
log_batch_payload_size=self._config.rp_log_batch_payload_size,
894+
launch_uuid_print=self._config.rp_launch_uuid_print,
895+
print_output=self._config.rp_launch_uuid_print_output
894896
)
895897
if hasattr(self.rp, "get_project_settings"):
896898
self.project_settings = self.rp.get_project_settings()

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dill>=0.3.6
22
pytest>=3.8.0
3-
reportportal-client==5.3.5
3+
reportportal-client==5.4.0
44
aenum>=3.1.0
55
requests>=2.27.1

tests/integration/test_config_handling.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ def test_launch_uuid_print(mock_client_init):
304304

305305
assert int(result) == 0, 'Exit code should be 0 (no errors)'
306306
expect(mock_client_init.call_count == 1)
307-
308-
expect('Report Portal Launch UUID:' in str_io.getvalue())
307+
expect(mock_client_init.call_args_list[0].kwargs['launch_uuid_print'] == print_uuid)
308+
expect(mock_client_init.call_args_list[0].kwargs['print_output'] is str_io)
309309
assert_expectations()
310310

311311

@@ -326,8 +326,8 @@ def test_launch_uuid_print_stderr(mock_client_init):
326326

327327
assert int(result) == 0, 'Exit code should be 0 (no errors)'
328328
expect(mock_client_init.call_count == 1)
329-
330-
expect('Report Portal Launch UUID:' in str_io.getvalue())
329+
expect(mock_client_init.call_args_list[0].kwargs['launch_uuid_print'] == print_uuid)
330+
expect(mock_client_init.call_args_list[0].kwargs['print_output'] is str_io)
331331
assert_expectations()
332332

333333

@@ -348,8 +348,8 @@ def test_launch_uuid_print_invalid_output(mock_client_init):
348348

349349
assert int(result) == 0, 'Exit code should be 0 (no errors)'
350350
expect(mock_client_init.call_count == 1)
351-
352-
expect('Report Portal Launch UUID:' in str_io.getvalue())
351+
expect(mock_client_init.call_args_list[0].kwargs['launch_uuid_print'] == print_uuid)
352+
expect(mock_client_init.call_args_list[0].kwargs['print_output'] is str_io)
353353
assert_expectations()
354354

355355

0 commit comments

Comments
 (0)