Skip to content

Commit

Permalink
Add func test.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Aug 2, 2022
1 parent b69c7f5 commit 96ba7a7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/functional/isolate-icp-fcp/00-simple.t
@@ -0,0 +1,22 @@
#!/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 optinoal isolation of initial and final cycle point graphs.
. "$(dirname "$0")/test_header"
set_test_number 2
reftest
exit
30 changes: 30 additions & 0 deletions tests/functional/isolate-icp-fcp/00-simple/flow.cylc
@@ -0,0 +1,30 @@
# Test optional isolation of initial and final cycle point graphs.
[scheduler]
[[events]]
stall timeout = PT0S
abort on stall timeout = True
[scheduling]
cycling mode = integer
final cycle point = 3
isolate initial cycle point = True
isolate final cycle point = True
[[graph]]
R1 = "prep => foo"
P1 = "foo"
R1/$ = "foo => clean"
[runtime]
[[prep]]
script = "sleep 5"
[[foo]]
script = """
# No foo instance should start before prep is finished.
grep -s "1/prep running .* succeeded" "${CYLC_WORKFLOW_LOG_DIR}/log"
if ((CYLC_TASK_CYCLE_POINT == 1)); then
sleep 5
fi
"""
[[clean]]
script = """
# Clean should not run before 1/foo is finished.
grep -s "1/foo running .* succeeded" "${CYLC_WORKFLOW_LOG_DIR}/log"
"""
5 changes: 5 additions & 0 deletions tests/functional/isolate-icp-fcp/00-simple/reference.log
@@ -0,0 +1,5 @@
1/prep -triggered off [] in flow 1
1/foo -triggered off ['1/prep'] in flow 1
2/foo -triggered off [] in flow 1
3/foo -triggered off [] in flow 1
3/clean -triggered off ['3/foo'] in flow 1
1 change: 1 addition & 0 deletions tests/functional/isolate-icp-fcp/test_header

0 comments on commit 96ba7a7

Please sign in to comment.