diff --git a/bot/check-test.sh b/bot/check-test.sh index 3b16e5c415..8ea6eddcb0 100755 --- a/bot/check-test.sh +++ b/bot/check-test.sh @@ -23,7 +23,6 @@ else [[ ${VERBOSE} -ne 0 ]] && echo " Slurm output file '"${job_out}"' NOT found" fi - # ReFrame prints e.g. #[----------] start processing checks #[ RUN ] GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=2_nodes %module_name=GROMACS/2021.3-foss-2021a /d597cff4 @snellius:rome+default @@ -76,7 +75,10 @@ fi if [[ ! -z ${grep_reframe_failed} ]]; then grep_reframe_result=${grep_reframe_failed} else - grep_reframe_result=${grep_reframe_success} + # Grep the entire output of ReFrame, so that we can report it in the foldable section of the test report + GP_success_full='(?s)\[----------\] start processing checks.*?\[==========\] Finished on [a-zA-Z0-9 ]*' + grep_reframe_success_full=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep -Pzo "${GP_success}") + grep_reframe_result=${grep_reframe_success_full} fi echo "[TEST]" > ${job_test_result_file} diff --git a/test_suite.sh b/test_suite.sh index e7151e00e7..1f0b91c477 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -198,10 +198,19 @@ fi # 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" -# Run with --debug for easier debugging in case there are issues: -python3 tests/eessi_test_mapping/map_software_to_test.py --module-list "${module_list}" --mapping-file "${mapping_config}" --debug -REFRAME_NAME_ARGS=$(python3 tests/eessi_test_mapping/map_software_to_test.py --module-list "${module_list}" --mapping-file "${mapping_config}") -test_selection_exit_code=$? +if [[ ! -f "$module_list" ]]; then + echo_green "File ${module_list} not found, so only running the default set of tests from ${mapping_config}" + # Run with --debug for easier debugging in case there are issues: + python3 tests/eessi_test_mapping/map_software_to_test.py --mapping-file "${mapping_config}" --debug --defaults-only + REFRAME_NAME_ARGS=$(python3 tests/eessi_test_mapping/map_software_to_test.py --mapping-file "${mapping_config}" --defaults-only) + test_selection_exit_code=$? +else + # Run with --debug for easier debugging in case there are issues: + python3 tests/eessi_test_mapping/map_software_to_test.py --module-list "${module_list}" --mapping-file "${mapping_config}" --debug + REFRAME_NAME_ARGS=$(python3 tests/eessi_test_mapping/map_software_to_test.py --module-list "${module_list}" --mapping-file "${mapping_config}") + test_selection_exit_code=$? +fi +# Check exit status if [[ ${test_selection_exit_code} -eq 0 ]]; then echo_green "Succesfully extracted names of tests to run: ${REFRAME_NAME_ARGS}" else diff --git a/tests/eessi_test_mapping/map_software_to_test.py b/tests/eessi_test_mapping/map_software_to_test.py index 24cf246ef1..a0da6258c8 100644 --- a/tests/eessi_test_mapping/map_software_to_test.py +++ b/tests/eessi_test_mapping/map_software_to_test.py @@ -33,29 +33,32 @@ def get_tests_for_software(software_name, mappings): return [] -def main(yaml_file, module_file, debug): +def main(yaml_file, module_file, debug, defaults_only): """Main function to process software names and their tests.""" mappings = load_mappings(yaml_file) if debug: print(f"Loaded mappings from '{yaml_file}'") - software_names = read_software_names(module_file) - if debug: - print(f"Read software names from '{module_file}'") + if not defaults_only: + software_names = read_software_names(module_file) + if debug: + print(f"Read software names from '{module_file}'") tests_to_run = [] arg_string = "" - # For each module name, get the relevant set of tests - for software_name in software_names: - additional_tests = get_tests_for_software(software_name, mappings) - for test in additional_tests: - if test not in tests_to_run: - tests_to_run.append(test) - - if additional_tests and debug: - print(f"Software: {software_name} -> Tests: {additional_tests}") - elif debug: - print(f"Software: {software_name} -> No tests found") + + if not defaults_only: + # For each module name, get the relevant set of tests + for software_name in software_names: + additional_tests = get_tests_for_software(software_name, mappings) + for test in additional_tests: + if test not in tests_to_run: + tests_to_run.append(test) + + if additional_tests and debug: + print(f"Software: {software_name} -> Tests: {additional_tests}") + elif debug: + print(f"Software: {software_name} -> No tests found") # Always add the default set of tests, if default_tests is specified if 'default_tests' in mappings: @@ -83,8 +86,10 @@ def main(yaml_file, module_file, debug): parser = argparse.ArgumentParser(description="Map software names to their tests based on a YAML configuration.") parser.add_argument('--mapping-file', type=str, help='Path to the YAML file containing the test mappings.') parser.add_argument('--module-list', type=str, help='Path to the file containing the list of software names.') - parser.add_argument('--debug', action='store_true', help='Enable debug output.') + defaults_help = "Don't consider the module-list file, only return the default tests from the mapping file" + parser.add_argument('--defaults-only', action='store_true', default=False, help=defaults_help) + parser.add_argument('--debug', action='store_true', default=False, help='Enable debug output.') args = parser.parse_args() - main(args.mapping_file, args.module_list, args.debug) + main(args.mapping_file, args.module_list, args.debug, args.defaults_only)