-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI JJOB Tests using CMake #3214
base: develop
Are you sure you want to change the base?
Changes from 103 commits
987ae5b
61fcf83
f5f6595
cbe3bab
6a50e14
bcebeca
be7a890
2811629
70a8183
72e5a9c
1f1fcd6
ee27b02
bc76ddf
38838a6
d18ad01
ef0e066
519a919
f813a1b
8238228
bf579ee
28ef1af
374927f
8b4fc4f
ce37d86
d4e3266
bb12cda
f78181c
46cddb7
d6c3a49
434f869
99df88d
e186173
c4a2780
0183667
3088bff
9d06df7
674f8d6
68ca6ee
f7bbd40
36d497e
808a4cf
81e640f
a1d0f20
2cbf4ee
687217f
55766bd
f69fb68
3cc83c6
e1e1858
5ce988f
cefaccd
bec03d9
5f9451b
74fbf45
19600f1
2caa229
749e54f
75450e1
0fc5d76
ea01737
e9c46f1
2602166
1950af4
c691c0e
276a9bd
283000e
b2a6fec
9525c74
74f7268
5cd1c5f
c132786
87674f2
e873722
32c5f87
128d0e6
abb2952
1d54caf
2532576
0967f10
8231519
30466b9
3deeb41
099a2cb
94dd64e
a98d55d
29517e3
60a6136
b977e52
95be9f2
e9b0b6a
a72827c
4f010a4
b79d445
16cd19f
fffb13d
5c5ac0f
06c8e8f
edde418
d68b02e
b0602bc
30b3f3a
42084e7
8d71151
cf7be28
a49a642
466831d
2d18461
53b13e3
4ee8d81
b3518ca
54f633b
a182c44
fd8a8bc
472d89c
45d2901
8ca4d7a
91d76e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(FunctionalTests) | ||
enable_testing() | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
function(set_from_env_or_default VAR_NAME ENV_VAR DEFAULT_VALUE) | ||
if (DEFINED ENV{${ENV_VAR}} AND NOT DEFINED ${VAR_NAME}) | ||
set(${VAR_NAME} $ENV{${ENV_VAR}} CACHE STRING "Set from environment variable ${ENV_VAR}") | ||
elseif(NOT DEFINED ${VAR_NAME}) | ||
set(${VAR_NAME} ${DEFAULT_VALUE} CACHE STRING "Default value for ${VAR_NAME}") | ||
endif() | ||
endfunction() | ||
|
||
if (DEFINED ENV{GW_BASELINE_DIR} AND NOT DEFINED GW_BASELINE_DIR) | ||
set(GW_BASELINE_DIR $ENV{GW_BASELINE_DIR} CACHE FILEPATH "Path to global-workflow baselines") | ||
else() | ||
get_filename_component(GW_BASELINE_DIR ${CMAKE_SOURCE_DIR}/../.. ABSOLUTE) | ||
endif() | ||
|
||
# If GW_BASELINE_DIR is not defined, tests will not be run, return | ||
if(NOT DEFINED GW_BASELINE_DIR) | ||
message(WARNING "gw: GW_BASELINE_DIR is not defined. Tests will not be run.") | ||
return() | ||
endif() | ||
|
||
set_from_env_or_default(RUNTESTS RUNTESTS "${CMAKE_BINARY_DIR}/RUNTESTS") | ||
|
||
set_from_env_or_default(MACHINE_ID MACHINE_ID "NOT_DEFINED") | ||
if(${MACHINE_ID} STREQUAL "NOT_DEFINED") | ||
execute_process( | ||
COMMAND bash -c "source ${GW_BASELINE_DIR}/ush/detect_machine.sh && echo \$MACHINE_ID" | ||
OUTPUT_VARIABLE MACHINE_ID | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
endif() | ||
|
||
set_from_env_or_default(HPC_ACCOUNT HPC_ACCOUNT "NOT_DEFINED") | ||
if(${HPC_ACCOUNT} STREQUAL "NOT_DEFINED") | ||
execute_process( | ||
COMMAND bash -c "source ${GW_BASELINE_DIR}/ci/platforms/config.${MACHINE_ID} && echo \$HPC_ACCOUNT" | ||
OUTPUT_VARIABLE HPC_ACCOUNT | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
endif() | ||
|
||
set_from_env_or_default(ICSDIR_ROOT ICSDIR_ROOT "NOT_DEFINED") | ||
if(${ICSDIR_ROOT} STREQUAL "NOT_DEFINED") | ||
execute_process( | ||
COMMAND bash -c "source ${GW_BASELINE_DIR}/ci/platforms/config.${MACHINE_ID} && echo \$ICSDIR_ROOT" | ||
OUTPUT_VARIABLE ICSDIR_ROOT | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
set(ICSDIR_ROOT ${ICSDIR_ROOT} CACHE FILEPATH "Path to ICS directory") | ||
endif() | ||
|
||
message(STATUS "MACHINE_ID: '${MACHINE_ID}'") | ||
message(STATUS "gw: global-workflow baselines will be used from: '${GW_BASELINE_DIR}'") | ||
message(STATUS "gw: global-workflow tests will be run at: '${RUNTESTS}'") | ||
message(STATUS "gw: global-workflow tests will use the allocation: '${HPC_ACCOUNT}'") | ||
message(STATUS "gw: global-workflow tests will use ICSDIR_ROOT: '${ICSDIR_ROOT}'") | ||
|
||
# Prepare test scripts | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/setup.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/setup.sh @ONLY) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/stage.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/stage.sh @ONLY) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/execute.sh.in | ||
${CMAKE_CURRENT_BINARY_DIR}/scripts/execute.sh @ONLY) | ||
|
||
function(AddFunctionalTest) | ||
|
||
set(prefix ARG) | ||
set(novals NOTRAPFPE NOVALGRIND) | ||
set(singlevals CASE JOB) | ||
set(multivals TEST_DEPENDS) | ||
|
||
cmake_parse_arguments(${prefix} | ||
"${novals}" "${singlevals}" "${multivals}" | ||
${ARGN}) | ||
|
||
set(TEST_NAME ${ARG_CASE}_${ARG_JOB}) | ||
set(CASE_PATH ${GW_BASELINE_DIR}/ci/cases/pr) | ||
set(CASE_YAML ${CASE_PATH}/${ARG_CASE}.yaml) | ||
|
||
add_test(NAME test_${TEST_NAME}_setup | ||
COMMAND ./setup.sh ${TEST_NAME} ${CASE_YAML} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts) | ||
set_tests_properties(test_${TEST_NAME}_setup PROPERTIES LABELS "${ARG_CASE};${ARG_JOB}") | ||
|
||
add_test(NAME test_${TEST_NAME}_stage | ||
COMMAND ./stage.sh ${TEST_NAME} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts) | ||
set_tests_properties(test_${TEST_NAME}_stage PROPERTIES DEPENDS test_${TEST_NAME}_setup LABELS "${ARG_CASE};${ARG_JOB}") | ||
|
||
add_test(NAME test_${TEST_NAME}_execute | ||
#TODO Need to get the idate for rocotoboot get the right cycle for the test (hard coded for now) | ||
#TODO Need to add a loop to check for when job has been completed | ||
COMMAND ./execute.sh ${TEST_NAME} ${ARG_JOB} 2021032312 | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts) | ||
set_tests_properties(test_${TEST_NAME}_execute PROPERTIES DEPENDS test_${TEST_NAME}_stage LABELS "${ARG_CASE};${ARG_JOB}") | ||
|
||
add_test(NAME test_${TEST_NAME}_validate | ||
COMMAND bash -c "${GW_BASELINE_DIR}/ci/ctests/scripts/validate.sh ${TEST_NAME}") | ||
set_tests_properties(test_${TEST_NAME}_validate PROPERTIES DEPENDS test_${TEST_NAME}_execute LABELS "${ARG_CASE};${ARG_JOB}") | ||
endfunction() | ||
|
||
AddFunctionalTest( | ||
CASE "C48_ATM" | ||
JOB "gfs_fcst_seg0" | ||
) |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||||
input_files: | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
something like this if one needs test specific local info. For e.g. in the DA jobs, we will need prior dates that are 6 hours behind |
||||||||
mkdir: | ||||||||
- "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}//gfs.{{PDY}}/{{HH}}/model/atmos/input" | ||||||||
copy: | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_ctrl.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}//gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_ctrl.nc"] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_data.tile1.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}//gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_data.tile1.nc"] | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_data.tile2.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}//gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_data.tile2.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_data.tile3.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_data.tile3.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_data.tile4.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}//gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_data.tile4.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_data.tile5.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}///gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_data.tile5.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/gfs_data.tile6.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/gfs_data.tile6.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/sfc_data.tile1.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/sfc_data.tile1.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/sfc_data.tile2.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/sfc_data.tile2.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/sfc_data.tile3.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/sfc_data.tile3.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/sfc_data.tile4.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/sfc_data.tile4.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/sfc_data.tile5.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/sfc_data.tile5.nc"] | ||||||||
- ["{{ STAGED_FUNCTIONAL_TEST_DIR }}/{{ TEST_NAME }}/gfs.{{ PDY }}/{{ HH }}/model/atmos/input/sfc_data.tile6.nc", "{{RUNTESTS}}/COMROOT/{{ TEST_NAME }}/gfs.{{PDY}}/{{HH}}/model/atmos/input/sfc_data.tile6.nc"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xe | ||
|
||
TEST_NAME=${1:?"Name of the test is required"} | ||
JOB=${2:?"Job name is required"} | ||
# TODO - adding idate by hand for now, need to get this from the test somehow | ||
idate=$3 | ||
|
||
#TODO - add rocotoboot_dryrun to repo some how | ||
rocotoboot_dryrun=/work2/noaa/global/mterry/rocoto_dryrun/bin/rocotoboot | ||
CASEDIR="@CMAKE_CURRENT_BINARY_DIR@/RUNTESTS/EXPDIR/${TEST_NAME}" | ||
cd "${CASEDIR}" | ||
rm -f *.db | ||
Check notice Code scanning / shellcheck Use ./glob or -- glob so names with dashes won't become options. Note
Use ./*glob* or -- *glob* so names with dashes won't become options.
|
||
rm -f jobcard | ||
|
||
job_card=$(yes | ${rocotoboot_dryrun} -d ${TEST_NAME}.db -w ${TEST_NAME}.xml -v 10 -c ${idate}00 -t ${JOB} 2> jobcard) | ||
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
|
||
cat jobcard | sed '/^{{\|^}}/d' | sed '1d' > "${TEST_NAME}.sub" | ||
|
||
|
||
#TODO - Generalize for batch system (hard coded to slurm) | ||
|
||
output=$(sbatch "${TEST_NAME}.sub") | ||
job_id=$(echo $output | awk '{print $4}') | ||
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
|
||
echo "Job ${job_id} submitted for test ${TEST_NAME} with job name ${JOB}" | ||
stdout_file=$(scontrol show job $job_id | grep StdOut | awk -F= '{print $2}') | ||
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
Check notice Code scanning / shellcheck Double quote to prevent globbing and word splitting. Note
Double quote to prevent globbing and word splitting.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). Note
Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
|
||
|
||
# Check the status of the Slurm job | ||
check_stdout_file() { | ||
last_line=$(tail -n 1 "$stdout_file") | ||
|
||
if [[ "$last_line" == "End"* && "$last_line" == *"error code 0"* ]]; then | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
echo "Job ${job_id} completed successfully with END and error code 0." | ||
exit 0 | ||
else | ||
echo "Job ${job_id} did not complete successfully. Last line: $last_line" | ||
|
||
exit -1 | ||
|
||
fi | ||
} | ||
|
||
# Check the status of the Slurm job | ||
timeout=0 | ||
TIMEOUT=60 | ||
while true; do | ||
job_status=$(squeue --job $job_id --noheader --format "%T") | ||
|
||
if [[ "$job_status" == "COMPLETED" ]]; then | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
echo "Job ${job_id} completed successfully." | ||
check_stdout_file | ||
elif [[ "$job_status" == "FAILED" || "$job_status" == "CANCELLED" || "$job_status" == "TIMEOUT" ]]; then | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
echo "Job ${job_id} failed with status: $job_status." | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
exit -1 | ||
|
||
elif [[ -z "$job_status" ]]; then | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
echo "Job ${job_id} is no longer in the queue. Checking stdout file." | ||
check_stdout_file | ||
else | ||
echo "Job ${job_id} is still running with status: $job_status." | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
sleep 60 # Check every 60 seconds | ||
timeout=$((timeout+1)) | ||
if [[ $timeout -gt $TIMEOUT ]]; then | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
|
||
echo "Job ${job_id} has been running for more than $TIMEOUT minutes. Exiting." | ||
Check notice Code scanning / shellcheck Prefer putting braces around variable references even when not strictly required. Note
Prefer putting braces around variable references even when not strictly required.
|
||
exit -1 | ||
|
||
fi | ||
fi | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ux | ||
|
||
TEST_NAME=${1:?"Name of the test is required"} | ||
YAML_FILE=${2:?"Name of the CI yaml file for the test"} | ||
|
||
# CMake to fill these variables | ||
HOMEgfs="@GW_BASELINE_DIR@" | ||
TerrenceMcGuinness-NOAA marked this conversation as resolved.
Show resolved
Hide resolved
|
||
RUNTESTS="@RUNTESTS@" | ||
ICSDIR_ROOT="@ICSDIR_ROOT@" | ||
HPC_ACCOUNT="@HPC_ACCOUNT@" | ||
|
||
set +x | ||
source "${HOMEgfs}/workflow/gw_setup.sh" | ||
set -x | ||
|
||
pslot="${TEST_NAME}" \ | ||
RUNTESTS="${RUNTESTS}" \ | ||
ICSDIR_ROOT="${ICSDIR_ROOT}" \ | ||
HPC_ACCOUNT="${HPC_ACCOUNT}" \ | ||
"${HOMEgfs}/workflow/create_experiment.py" --yaml "${YAML_FILE}" --overwrite | ||
rc=$? | ||
if [[ "${rc}" -ne 0 ]]; then | ||
set +x | ||
echo "Failed to create test experiment for '${TEST_NAME}' with yaml file '${YAML_FILE}'" | ||
set -x | ||
exit "${rc}" | ||
fi | ||
|
||
exit 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os, sys | ||
import shutil | ||
_here = os.path.dirname(__file__) | ||
_top = os.path.abspath(os.path.join(os.path.abspath(_here), '../../..')) | ||
sys.path.insert(0, _top) | ||
|
||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
from wxflow import Configuration, AttrDict, parse_j2yaml, Logger, logit, which, CommandNotFoundError, ProcessError, FileHandler | ||
from workflow.hosts import Host | ||
|
||
logger = Logger(level=os.environ.get("LOGGING_LEVEL", "DEBUG"), colored_log=False) | ||
|
||
def parse_args(): | ||
""" | ||
Parse command line arguments. | ||
|
||
Returns | ||
------- | ||
argparse.Namespace | ||
The parsed command line arguments. | ||
""" | ||
description = """Arguments for creating and updating error log files | ||
""" | ||
parser = ArgumentParser(description=description) | ||
|
||
parser.add_argument('--build_dir', help='CMake build directory', required=False, type=Path, default=None) | ||
parser.add_argument('-y', '--yaml', help='full path to yaml file describing the job test configuration', type=Path, required=True) | ||
return parser.parse_args() | ||
|
||
if __name__ == '__main__': | ||
|
||
# Parse command line arguments | ||
args = parse_args() | ||
data = AttrDict(HOMEgfs=_top) | ||
data.update(os.environ) | ||
|
||
# Initialize host and platform configuration for getting PATH to staged data per machine | ||
host = Host() | ||
cfg = Configuration(f'{data.HOMEgfs}/ci/platforms') | ||
platform_config = cfg.parse_config(f'config.{host.machine.lower()}') | ||
data.update(platform_config) | ||
|
||
#pr_case_cfg = parse_j2yaml(path=pr_case_yaml_path, data=data) | ||
#data["PDY"]=str(pr_case_cfg.arguments.idate)[0:8] | ||
#data["HH"]=str(pr_case_cfg.arguments.idate)[8:10] | ||
|
||
# TODO get idate in lue of above | ||
idate = "2021032312" | ||
|
||
data["PDY"]=str(idate)[0:8] | ||
data["HH"]=str(idate)[8:10] | ||
data["RUNTESTS"]=Path.joinpath(args.build_dir,"RUNTESTS") | ||
data["TEST_NAME"]=args.yaml.stem | ||
case_cfg = parse_j2yaml(path=args.yaml, data=data) | ||
FileHandler(case_cfg.input_files).sync() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ux | ||
|
||
TEST_NAME=${1:?"Name of the test is required"} | ||
|
||
# CMake to fill these variables | ||
HOMEgfs="@GW_BASELINE_DIR@" | ||
|
||
# Load the runtime environment for this script (needs wxflow and its dependencies) | ||
set +x | ||
source "${HOMEgfs}/workflow/gw_setup.sh" | ||
rc=$? | ||
[[ "${rc}" -ne 0 ]] && exit "${status}" | ||
set -x | ||
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src" | ||
export PYTHONPATH | ||
|
||
INPUTS_YAML="${HOMEgfs}/ci/ctests/cases/${TEST_NAME}.yaml" | ||
|
||
"${HOMEgfs}/ci/ctests/scripts/stage.py" --build_dir "@CMAKE_CURRENT_BINARY_DIR@" --yaml "${INPUTS_YAML}" | ||
rc=$? | ||
if [[ "${rc}" -ne 0 ]]; then | ||
set +x | ||
echo "Failed to stage inputs for '${TEST_NAME}' with '${INPUTS_YAML}'" | ||
set -x | ||
exit "${rc}" | ||
fi | ||
|
||
exit 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env bash | ||
echo "This is a stub for the validate script." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.