Skip to content

Commit

Permalink
test added
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsutherland authored and hjoliver committed Apr 2, 2024
1 parent 9700127 commit 1712460
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/functional/workflow-state/08-other-run-dir.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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 cylc workflow-state "template" option
. "$(dirname "$0")/test_header"
#-------------------------------------------------------------------------------
set_test_number 1
#-------------------------------------------------------------------------------
install_workflow "${TEST_NAME_BASE}" other-run-dir
#-------------------------------------------------------------------------------
TEST_NAME="${TEST_NAME_BASE}-run"
workflow_run_ok "${TEST_NAME}" cylc play --debug --no-detach "${WORKFLOW_NAME}"
#-------------------------------------------------------------------------------
rm -rfv ~/cylc-run-other-test
purge
#-------------------------------------------------------------------------------
exit 0
39 changes: 39 additions & 0 deletions tests/functional/workflow-state/other-run-dir/flow.cylc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[meta]
title = "Checks task state of alternate run dir"
[scheduler]
UTC mode = True
[[events]]
inactivity timeout = PT1M
abort on inactivity timeout = True
[scheduling]
initial cycle point = 20240101T00
[[xtriggers]]
up_dir_foo = workflow_state(\
workflow=other-run-dir, \
task=foo, \
point=20240101T0000Z, \
cylc_run_dir=~/cylc-run-other-test \
):PT10S
[[graph]]
R1 = """
foo
@up_dir_foo => bar
"""
[runtime]
[[foo]]
script = """
mkdir -pv ~/cylc-run-other-test
cd ~/cylc-run-other-test
echo 'Current directory:'
pwd
echo 'Creating link to original run dir:'
ln -sfv ${CYLC_RUN_DIR}/${CYLC_WORKFLOW_NAME} other-run-dir
"""
[[bar]]
script = """
cylc workflow-state --debug other-run-dir \
--run-dir=~/cylc-run-other-test \
--task=foo \
--point=20240101T0000Z
rm -rfv ~/cylc-run-other-test
"""

0 comments on commit 1712460

Please sign in to comment.