diff --git a/cylc/flow/scripts/trigger.py b/cylc/flow/scripts/trigger.py index 9818bae329a..3e4a3da96f7 100755 --- a/cylc/flow/scripts/trigger.py +++ b/cylc/flow/scripts/trigger.py @@ -140,6 +140,7 @@ def _validate(options): async def run(options: 'Values', workflow_id: str, *tokens_list): pclient = get_client(workflow_id, timeout=options.comms_timeout) + mutation_kwargs = { 'request_string': MUTATION, 'variables': { @@ -164,6 +165,7 @@ def main(parser: COP, options: 'Values', *ids: str): if options.flow is None: options.flow = [FLOW_ALL] # default to all active flows _validate(options) + call_multi( partial(run, options), *ids, diff --git a/tests/functional/triggering/09-fail/flow.cylc b/tests/functional/triggering/09-fail/flow.cylc deleted file mode 100644 index b4048e27ae5..00000000000 --- a/tests/functional/triggering/09-fail/flow.cylc +++ /dev/null @@ -1,12 +0,0 @@ -[scheduler] - [[events]] - expected task failures = 1/foo - -[scheduling] - [[graph]] - R1 = "foo:fail => bar" -[runtime] - [[foo]] - script = "false" - [[bar]] - script = "true" diff --git a/tests/functional/triggering/09-fail/reference.log b/tests/functional/triggering/09-fail/reference.log deleted file mode 100644 index 1a9f846c98d..00000000000 --- a/tests/functional/triggering/09-fail/reference.log +++ /dev/null @@ -1,4 +0,0 @@ -Initial point: 1 -Final point: 1 -1/foo -triggered off [] -1/bar -triggered off ['1/foo'] diff --git a/tests/integration/test_examples.py b/tests/integration/test_examples.py index 005ab551982..da8b156503d 100644 --- a/tests/integration/test_examples.py +++ b/tests/integration/test_examples.py @@ -260,7 +260,6 @@ async def test_reflog(flow, scheduler, run, reflog, complete): async with run(schd): triggers = reflog(schd) # Note: add flow_nums=True to capture flows - breakpoint() await complete(schd) assert triggers == { diff --git a/tests/functional/triggering/09-fail.t b/tests/integration/triggering.py similarity index 54% rename from tests/functional/triggering/09-fail.t rename to tests/integration/triggering.py index 0f4698ec2ac..0486dadab1b 100644 --- a/tests/functional/triggering/09-fail.t +++ b/tests/integration/triggering.py @@ -1,7 +1,6 @@ -#!/usr/bin/env bash # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or @@ -14,9 +13,30 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -#------------------------------------------------------------------------------- -# Test fail triggering -. "$(dirname "$0")/test_header" -set_test_number 2 -reftest -exit + +async def test_fail(flow, scheduler, run, reflog, complete, validate): + id_ = flow({ + 'scheduler': { + 'allow implicit tasks': 'true' + }, + 'scheduling': { + 'graph': { + 'R1': 'foo:failed => bar' + } + }, + 'runtime': { + 'foo': { + 'simulation': {'fail cycle points': 'all'} + } + } + }) + schd = scheduler(id_, paused_start=False) + + async with run(schd): + triggers = reflog(schd) + await complete(schd) + + assert triggers == { + ('1/foo', None), + ('1/bar', ('1/foo',)), + }