Skip to content

Commit

Permalink
example test
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Dec 14, 2023
1 parent 9f11db2 commit ec76e2e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
2 changes: 2 additions & 0 deletions cylc/flow/scripts/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand All @@ -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,
Expand Down
12 changes: 0 additions & 12 deletions tests/functional/triggering/09-fail/flow.cylc

This file was deleted.

4 changes: 0 additions & 4 deletions tests/functional/triggering/09-fail/reference.log

This file was deleted.

1 change: 0 additions & 1 deletion tests/integration/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,9 +13,30 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# 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',)),
}

0 comments on commit ec76e2e

Please sign in to comment.