diff --git a/bot/test.sh b/bot/test.sh index 93907de5..da7d40cd 100755 --- a/bot/test.sh +++ b/bot/test.sh @@ -189,6 +189,10 @@ EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type") export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux} echo "bot/test.sh: EESSI_OS_TYPE='${EESSI_OS_TYPE}'" +# Get node_type from .architecture.node_type in ${JOB_CFG_FILE} +export BOT_NODE_TYPE=$(cfg_get_value "architecture" "node_type") +echo "bot/test.sh: BOT_NODE_TYPE='${BOT_NODE_TYPE}" + # prepare arguments to eessi_container.sh common to build and tarball steps declare -a COMMON_ARGS=() COMMON_ARGS+=("--verbose") @@ -237,6 +241,9 @@ fi if [[ ${SHARED_FS_PATH} ]]; then TEST_SUITE_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}") fi +if [[ ${BOT_NODE_TYPE} ]]; then + TEST_SUITE_ARGS+=("--partition" "${BOT_NODE_TYPE}") +fi # [[ ! -z ${BUILD_LOGS_DIR} ]] && TEST_SUITE_ARGS+=("--build-logs-dir" "${BUILD_LOGS_DIR}") # [[ ! -z ${SHARED_FS_PATH} ]] && TEST_SUITE_ARGS+=("--shared-fs-path" "${SHARED_FS_PATH}") diff --git a/test_suite.sh b/test_suite.sh index b6fdf274..44f7062e 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -13,6 +13,7 @@ display_help() { echo "usage: $0 [OPTIONS]" echo " -g | --generic - instructs script to test for generic architecture target" + echo " -p | --partition - the partition name on which to test (used by ReFrame to load the right config)" echo " -h | --help - display this usage information" echo " -x | --http-proxy URL - provides URL for the environment variable http_proxy" echo " -y | --https-proxy URL - provides URL for the environment variable https_proxy" @@ -26,6 +27,10 @@ while [[ $# -gt 0 ]]; do DETECTION_PARAMETERS="--generic" shift ;; + -p|--partition) + REFRAME_PARTITION_NAME="${2}" + shift 2 + ;; -h|--help) display_help # Call your function # no shifting needed here, we're done. @@ -153,13 +158,6 @@ export RFM_CHECK_SEARCH_PATH=$TESTSUITEPREFIX/eessi/testsuite/tests export RFM_CHECK_SEARCH_RECURSIVE=1 export RFM_PREFIX=$PWD/reframe_runs -# Get the correct partition name -REFRAME_PARTITION_NAME=${EESSI_SOFTWARE_SUBDIR//\//_} -if [ ! -z "$EESSI_ACCELERATOR_TARGET_OVERRIDE" ]; then - REFRAME_PARTITION_NAME=${REFRAME_PARTITION_NAME}_${EESSI_ACCELERATOR_TARGET_OVERRIDE//\//_} -fi -echo "Constructed partition name based on EESSI_SOFTWARE_SUBDIR and EESSI_ACCELERATOR_TARGET: ${REFRAME_PARTITION_NAME}" - # Set the reframe system name, including partition export RFM_SYSTEM="BotBuildTests:${REFRAME_PARTITION_NAME}" @@ -185,6 +183,28 @@ else fatal_error "Failed to run 'reframe --version'" fi +# Check if the partition specified by RFM_SYSTEM is in the config file +# Redirect to /dev/null because we don't want to print an ERROR, we want to try a fallback +reframe --show-config | grep -v "could not find a configuration entry for the requested system/partition combination" > /dev/null +if [[ $? -eq 1 ]]; then + # There was a match by grep, so we failed to find the system/partition combination + # Try the previous approach for backwards compatibility + # This fallback can be scrapped once all bots have adopted the new naming convention + # (i.e. using the node_type name from app.cfg) for ReFrame partitions + # Get the correct partition name + echo "Falling back to old naming scheme for REFRAME_PARTITION_NAME." + echo "This naming scheme is deprecated, please update your partition names in the ReFrame config file." + REFRAME_PARTITION_NAME=${EESSI_SOFTWARE_SUBDIR//\//_} + if [ ! -z "$EESSI_ACCELERATOR_TARGET_OVERRIDE" ]; then + REFRAME_PARTITION_NAME=${REFRAME_PARTITION_NAME}_${EESSI_ACCELERATOR_TARGET_OVERRIDE//\//_} + fi + echo "Constructed partition name based on EESSI_SOFTWARE_SUBDIR and EESSI_ACCELERATOR_TARGET: ${REFRAME_PARTITION_NAME}" + export RFM_SYSTEM="BotBuildTests:${REFRAME_PARTITION_NAME}" +fi + +# Log the config for this partition: +reframe --show-config + # Get the subset of test names based on the test mapping and tags (e.g. CI, 1_node) module_list="module_files.list.txt" mapping_config="tests/eessi_test_mapping/software_to_tests.yml"