Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rerun when reusing exisitng launch_uuid #252

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions reportportal_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ class RPClient(RP):
_skip_analytics: str
_item_stack: LifoQueue
_log_batcher: LogBatcher[RPRequestLog]
is_rerun: bool

@property
def launch_uuid(self) -> Optional[str]:
Expand Down Expand Up @@ -523,6 +524,7 @@ def __init__(
self.launch_uuid_print = launch_uuid_print
self.print_output = print_output
self.truncate_attributes = truncate_attributes
self.is_rerun = False # will be updated in start_launch

self.api_key = api_key
if not self.api_key:
Expand Down Expand Up @@ -567,7 +569,8 @@ def start_launch(
'rerun' option.
:return: Launch UUID if successfully started or None.
"""
if not self.use_own_launch:
self.is_rerun = rerun
if not self.use_own_launch and not self.is_rerun:
return self.launch_uuid
url = uri_join(self.base_url_v2, "launch")
request_payload = LaunchStartRequest(
Expand All @@ -576,6 +579,7 @@ def start_launch(
attributes=verify_value_length(attributes) if self.truncate_attributes else attributes,
description=description,
mode=self.mode,
uuid=self.launch_uuid,
rerun=rerun,
rerun_of=rerun_of,
).payload
Expand Down Expand Up @@ -745,7 +749,7 @@ def finish_launch(
PASSED, FAILED, STOPPED, SKIPPED, CANCELLED
:param attributes: Launch attributes
"""
if self.use_own_launch:
if self.use_own_launch or self.is_rerun:
if self.launch_uuid is NOT_FOUND or not self.launch_uuid:
logger.warning("Attempt to finish non-existent launch")
return
Expand Down
Loading