-
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 cylc install and functional test
stub tests for rose fileinstall added cylc install and functional test
- Loading branch information
Showing
25 changed files
with
168 additions
and
491 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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# 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/>. | ||
|
||
"""cylc install [OPTIONS] ARGS | ||
Test communication with a running suite. | ||
If suite REG is running or TASK in suite REG is currently running, | ||
exit with success status, else exit with error status.""" | ||
|
||
import os | ||
import pkg_resources | ||
|
||
from cylc.flow.option_parsers import CylcOptionParser as COP | ||
from cylc.flow.terminal import cli_function | ||
from cylc.flow.pathutil import get_suite_run_dir | ||
|
||
|
||
def get_option_parser(): | ||
parser = COP( | ||
__doc__, comms=True, | ||
argdoc=[('REG', 'Suite name')]) | ||
|
||
return parser | ||
|
||
|
||
@cli_function(get_option_parser) | ||
def main(parser, options, suite): | ||
for entry_point in pkg_resources.iter_entry_points( | ||
'cylc.post_install' | ||
): | ||
entry_point.resolve()( | ||
dir_=os.getcwd(), | ||
opts=options, | ||
dest_root=get_suite_run_dir(suite) | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
This file was deleted.
Oops, something went wrong.
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
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
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,51 @@ | ||
#!/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" | ||
#------------------------------------------------------------------------------- | ||
python -c "import cylc.rose" > /dev/null 2>&1 || | ||
skip_all "cylc.rose not installed in environment." | ||
|
||
set_test_number 3 | ||
install_suite "${TEST_NAME_BASE}" "${TEST_NAME_BASE}" | ||
|
||
sed -i "s@REPLACE_THIS@${CYLC_REPO_DIR}/tests/functional/rose-conf/fileinstall_data@g" rose-suite.conf | ||
|
||
|
||
run_ok "${TEST_NAME_BASE}-validate" cylc install "${SUITE_NAME}" | ||
|
||
# Test that data files have been concatenated. | ||
DATA_INSTALLED_PATH="${SUITE_RUN_DIR}/data" | ||
DATA_ORIGIN_PATH="${CYLC_REPO_DIR}/tests/functional/rose-conf/fileinstall_data/" | ||
if [[ $(cat "${DATA_ORIGIN_PATH}randoms1.data"; cat "${DATA_ORIGIN_PATH}randoms3.data") == $(cat "${DATA_INSTALLED_PATH}") ]]; then | ||
ok "${TEST_NAME_BASE}.File installed from wildcards name." | ||
else | ||
fail "${TEST_NAME_BASE}.File not installed from wildcards name." | ||
fi | ||
|
||
# Test that lion.py has been installed in a sub directory. | ||
LION_INSTALLED_PATH="${SUITE_RUN_DIR}/lib/python/lion.py" | ||
LION_ORIGIN_PATH="${CYLC_REPO_DIR}/tests/functional/rose-conf/fileinstall_data/lion.py" | ||
if [[ $(cat "${LION_INSTALLED_PATH}") == $(cat "${LION_ORIGIN_PATH}") ]]; then | ||
ok "${TEST_NAME_BASE}.File installed to subfolder" | ||
else | ||
fail "${TEST_NAME_BASE}.File not installed to subfolder" | ||
fi | ||
|
||
purge | ||
exit |
Oops, something went wrong.