-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added functional tests to check dealing with optional configs set by …
…ENV or rose-suite.conf:opts=
- Loading branch information
Showing
12 changed files
with
243 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 SUITE 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 jinja2 from rose-suite.conf file is processed into a suite. | ||
. "$(dirname "$0")/test_header" | ||
#------------------------------------------------------------------------------- | ||
set_test_number 1 | ||
install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
|
||
export ROSE_SUITE_OPT_CONF_KEYS=Gaelige | ||
|
||
cylc view -p --stdout "${SUITE_NAME}" > processed.conf.test | ||
|
||
cmp_ok processed.conf.test processed.conf.control | ||
|
||
purge | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!jinja2 | ||
[meta] | ||
title = "Add jinja2 vars from a rose-suite.conf" | ||
description = """ | ||
Natively, in Cylc! | ||
""" | ||
|
||
[scheduling] | ||
initial cycle point = {{ICP}} | ||
final cycle point = {{FCP}} | ||
cycling mode = integer | ||
[[graph]] | ||
{% for member in MEMBERS %} | ||
P1 = {{TASK1}} => {{TASK2}}_{{member}} => {{TASK3}} | ||
{% endfor %} | ||
{% for key, value in SAMUELJOHNSON.items() %} | ||
P1 = {{TASK3}} => {{value}}_auf_deutsch_ist_{{key}} => fin | ||
{% endfor %} | ||
|
||
[runtime] | ||
[[root]] | ||
script = echo "This task is ${CYLC_TASK_ID}" | ||
|
||
[[{{ TASK1 }}]] | ||
|
||
{% for member in MEMBERS %} | ||
[[{{ TASK2 }}_{{member}}]] | ||
{% endfor %} | ||
|
||
[[{{ TASK3 }}]] | ||
|
||
{% for key, value in SAMUELJOHNSON.items() %} | ||
[[{{value}}_auf_deutsch_ist_{{key}}]] | ||
{% endfor %} | ||
|
||
[[fin]] |
8 changes: 8 additions & 0 deletions
8
tests/functional/rose-conf/04-opts-set-from-env/opt/rose-suite-Cymraeg.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[jinja2:suite.rc] | ||
ICP=1 | ||
FCP=1 | ||
TASK1="mynd" | ||
TASK2="bwyta" | ||
TASK3="prynu" | ||
MEMBERS=["control", "un", "dau", "tri"] | ||
SAMUELJOHNSON={"ein": 1, "zwei": 2, "drei": 3} |
8 changes: 8 additions & 0 deletions
8
tests/functional/rose-conf/04-opts-set-from-env/opt/rose-suite-Gaelige.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[jinja2:suite.rc] | ||
ICP=1 | ||
FCP=1 | ||
TASK1="cuir" # to put | ||
TASK2="tog" # to lift | ||
TASK3="gabh" # to take | ||
MEMBERS=["control", "aon", "dhà", "trì"] | ||
SAMUELJOHNSON={"ein": 1, "zwei": 2, "drei": 3} |
30 changes: 30 additions & 0 deletions
30
tests/functional/rose-conf/04-opts-set-from-env/processed.conf.control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[meta] | ||
title = "Add jinja2 vars from a rose-suite.conf" | ||
description = """ | ||
Natively, in Cylc! | ||
""" | ||
[scheduling] | ||
initial cycle point = 1 | ||
final cycle point = 1 | ||
cycling mode = integer | ||
[[graph]] | ||
P1 = cuir => tog_control => gabh | ||
P1 = cuir => tog_aon => gabh | ||
P1 = cuir => tog_dhà => gabh | ||
P1 = cuir => tog_trì => gabh | ||
P1 = gabh => 1_auf_deutsch_ist_ein => fin | ||
P1 = gabh => 2_auf_deutsch_ist_zwei => fin | ||
P1 = gabh => 3_auf_deutsch_ist_drei => fin | ||
[runtime] | ||
[[root]] | ||
script = echo "This task is ${CYLC_TASK_ID}" | ||
[[cuir]] | ||
[[tog_control]] | ||
[[tog_aon]] | ||
[[tog_dhà]] | ||
[[tog_trì]] | ||
[[gabh]] | ||
[[1_auf_deutsch_ist_ein]] | ||
[[2_auf_deutsch_ist_zwei]] | ||
[[3_auf_deutsch_ist_drei]] | ||
[[fin]] |
8 changes: 8 additions & 0 deletions
8
tests/functional/rose-conf/04-opts-set-from-env/rose-suite.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[jinja2:suite.rc] | ||
ICP=1 | ||
FCP=1 | ||
TASK1="respond" | ||
TASK2="plunge" | ||
TASK3="allow" | ||
MEMBERS=["control", "yan", "tan", "tethera"] | ||
SAMUELJOHNSON={"ein": 1, "zwei": 2, "drei": 3} |
31 changes: 31 additions & 0 deletions
31
tests/functional/rose-conf/05-opts-set-from-rose-suite.conf.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 SUITE 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 jinja2 from rose-suite.conf file is processed into a suite. | ||
. "$(dirname "$0")/test_header" | ||
#------------------------------------------------------------------------------- | ||
set_test_number 1 | ||
install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
|
||
export ROSE_SUITE_OPT_CONF_KEYS="" | ||
|
||
cylc view -p --stdout "${SUITE_NAME}" > processed.conf.test | ||
|
||
cmp_ok processed.conf.test processed.conf.control | ||
|
||
purge | ||
exit |
36 changes: 36 additions & 0 deletions
36
tests/functional/rose-conf/05-opts-set-from-rose-suite.conf/flow.cylc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!jinja2 | ||
[meta] | ||
title = "Add jinja2 vars from a rose-suite.conf" | ||
description = """ | ||
Natively, in Cylc! | ||
""" | ||
|
||
[scheduling] | ||
initial cycle point = {{ICP}} | ||
final cycle point = {{FCP}} | ||
cycling mode = integer | ||
[[graph]] | ||
{% for member in MEMBERS %} | ||
P1 = {{TASK1}} => {{TASK2}}_{{member}} => {{TASK3}} | ||
{% endfor %} | ||
{% for key, value in SAMUELJOHNSON.items() %} | ||
P1 = {{TASK3}} => {{value}}_auf_deutsch_ist_{{key}} => fin | ||
{% endfor %} | ||
|
||
[runtime] | ||
[[root]] | ||
script = echo "This task is ${CYLC_TASK_ID}" | ||
|
||
[[{{ TASK1 }}]] | ||
|
||
{% for member in MEMBERS %} | ||
[[{{ TASK2 }}_{{member}}]] | ||
{% endfor %} | ||
|
||
[[{{ TASK3 }}]] | ||
|
||
{% for key, value in SAMUELJOHNSON.items() %} | ||
[[{{value}}_auf_deutsch_ist_{{key}}]] | ||
{% endfor %} | ||
|
||
[[fin]] |
8 changes: 8 additions & 0 deletions
8
tests/functional/rose-conf/05-opts-set-from-rose-suite.conf/opt/rose-suite-Cymraeg.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[jinja2:suite.rc] | ||
ICP=1 | ||
FCP=1 | ||
TASK1="mynd" | ||
TASK2="bwyta" | ||
TASK3="prynu" | ||
MEMBERS=["control", "un", "dau", "tri"] | ||
SAMUELJOHNSON={"ein": 1, "zwei": 2, "drei": 3} |
8 changes: 8 additions & 0 deletions
8
tests/functional/rose-conf/05-opts-set-from-rose-suite.conf/opt/rose-suite-Gaelige.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[jinja2:suite.rc] | ||
ICP=1 | ||
FCP=1 | ||
TASK1="cuir" # to put | ||
TASK2="tog" # to lift | ||
TASK3="gabh" # to take | ||
MEMBERS=["control", "aon", "dhà", "trì"] | ||
SAMUELJOHNSON={"ein": 1, "zwei": 2, "drei": 3} |
30 changes: 30 additions & 0 deletions
30
tests/functional/rose-conf/05-opts-set-from-rose-suite.conf/processed.conf.control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[meta] | ||
title = "Add jinja2 vars from a rose-suite.conf" | ||
description = """ | ||
Natively, in Cylc! | ||
""" | ||
[scheduling] | ||
initial cycle point = 1 | ||
final cycle point = 1 | ||
cycling mode = integer | ||
[[graph]] | ||
P1 = mynd => bwyta_control => prynu | ||
P1 = mynd => bwyta_un => prynu | ||
P1 = mynd => bwyta_dau => prynu | ||
P1 = mynd => bwyta_tri => prynu | ||
P1 = prynu => 1_auf_deutsch_ist_ein => fin | ||
P1 = prynu => 2_auf_deutsch_ist_zwei => fin | ||
P1 = prynu => 3_auf_deutsch_ist_drei => fin | ||
[runtime] | ||
[[root]] | ||
script = echo "This task is ${CYLC_TASK_ID}" | ||
[[mynd]] | ||
[[bwyta_control]] | ||
[[bwyta_un]] | ||
[[bwyta_dau]] | ||
[[bwyta_tri]] | ||
[[prynu]] | ||
[[1_auf_deutsch_ist_ein]] | ||
[[2_auf_deutsch_ist_zwei]] | ||
[[3_auf_deutsch_ist_drei]] | ||
[[fin]] |
9 changes: 9 additions & 0 deletions
9
tests/functional/rose-conf/05-opts-set-from-rose-suite.conf/rose-suite.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
opts=Cymraeg | ||
[jinja2:suite.rc] | ||
ICP=1 | ||
FCP=1 | ||
TASK1="respond" | ||
TASK2="plunge" | ||
TASK3="allow" | ||
MEMBERS=["control", "yan", "tan", "tethera"] | ||
SAMUELJOHNSON={"ein": 1, "zwei": 2, "drei": 3} |