Skip to content

Commit

Permalink
added a test for a fix to cylc/cylc-rose#319
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed May 15, 2024
1 parent 9557bc0 commit 44af171
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 0 deletions.
62 changes: 62 additions & 0 deletions t/rose-task-run/45-app-fcm-make-compat_mode.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------
# Copyright (C) British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose 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.
#
# Rose 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 Rose. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# Compatibility Mode Test
# Ensure that when Cylc Rose gets workflow config that
# compatibility run mode isn't changed.
# https://github.com/cylc/cylc-rose/issues/319
#-------------------------------------------------------------------------------
. "$(dirname "$0")/test_header"

if ! fcm help make 1>/dev/null 2>&1; then
skip_all '"fcm make" unavailable'
fi
if ! gfortran --version 1>/dev/null 2>&1; then
skip_all '"gfortran" unavailable'
fi
JOB_HOST="$(rose config --default= 't' 'job-host')"
if [[ -n "${JOB_HOST}" ]]; then
JOB_HOST="$(rose host-select -q "${JOB_HOST}")"
fi
if [[ -z "${JOB_HOST}" ]]; then
skip_all '"[t]job-host" not defined or not available'
fi

tests 2
export ROSE_CONF_PATH=
get_reg

run_pass "${TEST_KEY_BASE}-install" \
cylc install \
--workflow-name="${FLOW}" \
--no-run-name \
-S "HOST='${JOB_HOST}'" \
"${TEST_SOURCE_DIR}/${TEST_KEY_BASE}"

run_pass "${TEST_KEY_BASE}-play" \
timeout 120 \
cylc play \
"${FLOW}" \
--abort-if-any-task-fails \
--host='localhost' \
--no-detach \
--debug

purge
exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps=extract mirror
extract.ns=foo
extract.location[foo]=$HERE/src
mirror.prop{config-file.steps}=build
build.target{task}=link
build.prop{file-ext.bin}=
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
program hello
write(*, '(a)') 'Hello World!'
end program hello
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
meta=fcm_make
mode=fcm_make
make-name-cont=-bin
orig-cont-map=make:make-bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[command]
default=hello >"${ROSE_SUITE_DIR}/share/hello.txt"
Empty file.
17 changes: 17 additions & 0 deletions t/rose-task-run/45-app-fcm-make-compat_mode/suite.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!jinja2
[cylc]
UTC mode = True
[scheduling]
[[dependencies]]
graph = """
hello-make:finish & hello-make => fin
"""

[runtime]
[[hello-make]]
script = rose task-run --app-key=make --new
[[hello-make-bin]]
script = rose task-run --app-key=make
[[[remote]]]
host = {{HOST}}
[[fin]]

0 comments on commit 44af171

Please sign in to comment.