Skip to content

Commit

Permalink
New functional test.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Dec 22, 2024
1 parent da6b375 commit d46b191
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/functional/cylc-trigger/08-group-trigger.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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 group trigger.
# See https://github.com/cylc/cylc-flow/issues/6395

. "$(dirname "$0")/test_header"

set_test_number 2

install_workflow "${TEST_NAME_BASE}" "${TEST_NAME_BASE}"

run_ok "${TEST_NAME_BASE}-validate" cylc validate "${WORKFLOW_NAME}"

workflow_run_ok "${TEST_NAME_BASE}-run" \
cylc play --debug --no-detach --reference-test "${WORKFLOW_NAME}"

purge
22 changes: 22 additions & 0 deletions tests/functional/cylc-trigger/08-group-trigger/flow.cylc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[scheduler]
allow implicit tasks = True
[[events]]
expected task failures = 1/fail
[scheduling]
[[graph]]
R1 = """
x => a # spawn a into active pool
fail => a => b => c
fail => b
"""
[runtime]
[[fail]]
script = """
# this should automatically set off-flow prerequisites
# 1/x (already satisfied) and 1/fail (not satisfied).
# But internal deps "a => b => c" should be respected.
cylc trigger ${CYLC_WORKFLOW_ID} //1/a //1/b //1/c
false
"""
[[c]]
script = "cylc stop $CYLC_WORKFLOW_ID"
5 changes: 5 additions & 0 deletions tests/functional/cylc-trigger/08-group-trigger/reference.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1/fail -triggered off [] in flow 1
1/x -triggered off [] in flow 1
1/a -triggered off ['1/fail', '1/x'] in flow 1
1/b -triggered off ['1/a', '1/fail'] in flow 1
1/c -triggered off ['1/b'] in flow 1

0 comments on commit d46b191

Please sign in to comment.