Skip to content

Commit 2c7de0a

Browse files
authored
Merge pull request #1579 from mvdbeek/fix_no_wait_run_exit_state
Don't report failed workflow run with --no_wait
2 parents b5bc19f + f1a1be3 commit 2c7de0a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

planemo/galaxy/activity.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ def invocation_to_run_response(
333333
log=log,
334334
start_datetime=start_datetime,
335335
end_datetime=datetime.now(),
336+
no_wait=no_wait,
336337
)
337338

338339

@@ -707,6 +708,7 @@ def __init__(
707708
error_message=None,
708709
start_datetime=None,
709710
end_datetime=None,
711+
no_wait=False,
710712
):
711713
super().__init__(
712714
ctx=ctx,
@@ -724,6 +726,7 @@ def __init__(
724726
self.history_state = history_state
725727
self.invocation_state = invocation_state
726728
self.error_message = error_message
729+
self._no_wait = no_wait
727730
self._invocation_details = self.collect_invocation_details(invocation_id)
728731

729732
def to_galaxy_output(self, runnable_output):
@@ -794,6 +797,10 @@ def _invocation(self):
794797

795798
@property
796799
def was_successful(self):
800+
# When --no_wait is used, we haven't waited for completion, so we consider it successful
801+
# if the invocation was created without error (i.e., not in a failed/cancelled state)
802+
if self._no_wait:
803+
return self.invocation_state not in ["failed", "cancelled"]
797804
return self.history_state in ["ok", "skipped", None] and self.invocation_state == "scheduled"
798805

799806
def export_invocation(self, output_path, export_format="rocrate.zip"):

0 commit comments

Comments
 (0)