From e0738ba5c30e2ad29d159cf3f849ba050fdf70d4 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Mon, 23 Sep 2024 11:37:56 -0600 Subject: [PATCH] More verbose tests on cdash (#1300) * Always attach test log files. * Try cat on log file for tests. --- reg_tests/CTestList.cmake | 62 +++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 2cd7d7365..50f1c7b94 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -24,7 +24,7 @@ macro(setup_test testname np) set(OUTPUT_FILE_R0 "${testname}_R0.log") set(OUTPUT_FILE_R1 "${testname}_R0.log") set(OUTPUT_FILE_NP "${testname}Np${np}.log") - set(RUN_COMMAND "${MPI_COMMAND} -i ${INPUT_FILE} -o ${OUTPUT_FILE}") + set(RUN_COMMAND "${MPI_COMMAND} -i ${INPUT_FILE} -o ${OUTPUT_FILE} 2>&1; cat ${OUTPUT_FILE}") set(RUN_COMMAND_RST "${MPI_COMMAND} -i ${INPUT_FILE_RST} -o ${OUTPUT_FILE_RST}") set(RUN_COMMAND_R0 "${MPI_COMMAND} -i ${INPUT_FILE_R0} -o ${OUTPUT_FILE_R0}") set(RUN_COMMAND_R1 " && ${MPI_COMMAND} -i ${INPUT_FILE_R1} -o ${OUTPUT_FILE_R1}") @@ -52,23 +52,15 @@ function(add_test_r testname np) setup_test(${testname} ${np}) add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND}") set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "regression") + set_tests_properties(${testname} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE}") endfunction(add_test_r) -# Standard performance test -function(add_test_p testname np) - setup_test(${testname} ${np}) - add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND}") - set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "performance") -endfunction(add_test_p) - # Regression test with single restart function(add_test_r_rst testname np) setup_test(${testname} ${np}) add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND}; ${RUN_COMMAND_RST}${COMPARE_GOLDS_COMMAND_RST}") set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "regression") + set_tests_properties(${testname} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE_RST}") endfunction(add_test_r_rst) # Regression test with postprocessing @@ -76,7 +68,7 @@ function(add_test_r_post testname np) setup_test(${testname} ${np}) add_test(${testname} sh -c "${RUN_COMMAND}${COMPARE_GOLDS_COMMAND_NC}") set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "regression") + set_tests_properties(${testname} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE}") endfunction(add_test_r_post) # Verification test comparing solution norms @@ -84,7 +76,7 @@ function(add_test_v_sol_norm testname np) setup_test(${testname} ${np}) add_test(${testname} sh -c "${RUN_COMMAND}${CHECK_SOL_NORMS_COMMAND}") set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "verification") + set_tests_properties(${testname} PROPERTIES LABELS "verification" ATTACHED_FILES "${OUTPUT_FILE}") endfunction(add_test_v_sol_norm) # Verification test with two resolutions @@ -92,7 +84,7 @@ function(add_test_v2 testname np) setup_test(${testname} ${np}) add_test(${testname} sh -c "${RUN_COMMAND_R0}${RUN_COMMAND_R1}${COMPARE_GOLDS_COMMAND_ERRORS}") set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "verification") + set_tests_properties(${testname} PROPERTIES LABELS "verification" ATTACHED_FILES "${OUTPUT_FILE_R0};${OUTPUT_FILE_R1}") endfunction(add_test_v2) # Regression test that runs with different numbers of processes @@ -100,7 +92,7 @@ function(add_test_r_np testname np) setup_test(${testname} ${np}) add_test(${testname}Np${np} sh -c "${RUN_COMMAND_NP}${COMPARE_GOLDS_COMMAND_NP}") set_properties(${testname}Np${np}) - set_tests_properties(${testname}Np${np} PROPERTIES LABELS "regression") + set_tests_properties(${testname}Np${np} PROPERTIES LABELS "regression" ATTACHED_FILES "${OUTPUT_FILE_NP}") endfunction(add_test_r_np) # Standard unit test @@ -111,7 +103,7 @@ function(add_test_u testname np) else() unset(GTEST_SHUFFLE) endif() - add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS} ${GTEST_SHUFFLE}") + add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS} ${GTEST_SHUFFLE} 2>&1") set_properties(${testname}) set_tests_properties(${testname} PROPERTIES LABELS "unit") if(ENABLE_OPENFAST) @@ -126,7 +118,7 @@ endfunction(add_test_u) # GPU unit test function(add_test_u_gpu testname np) setup_test(${testname} ${np}) - add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS}") + add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${utest_ex_name} ${MPIEXEC_POSTFLAGS} 2>&1") set_properties(${testname}) set_tests_properties(${testname} PROPERTIES LABELS "unit") if(ENABLE_OPENFAST) @@ -139,23 +131,23 @@ function(add_test_u_gpu testname np) endfunction(add_test_u_gpu) # Regression test with catalyst capability -function(add_test_r_cat testname np ncat) - if(ENABLE_PARAVIEW_CATALYST) - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml) - setup_test(${testname} ${np}) - add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${nalu_ex_catalyst_name} ${MPIEXEC_POSTFLAGS} -i ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml -o ${testname}.log && ${CMAKE_CURRENT_SOURCE_DIR}/pass_fail_catalyst.sh ${testname} ${ncat}") - set_properties(${testname}) - set_tests_properties(${testname} PROPERTIES LABELS "regression") - set(CATALYST_FILE_INPUT_DECK_COMMAND "catalyst_file_name: catalyst.txt") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml - ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml @ONLY) - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/catalyst.txt - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}) - endif() - else() - add_test_r(${testname} ${np}) - endif() -endfunction(add_test_r_cat) +#function(add_test_r_cat testname np ncat) +# if(ENABLE_PARAVIEW_CATALYST) +# if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml) +# setup_test(${testname} ${np}) +# add_test(${testname} sh -c "${MPI_PREAMBLE} ${CMAKE_BINARY_DIR}/${nalu_ex_catalyst_name} ${MPIEXEC_POSTFLAGS} -i ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml -o ${testname}.log && ${CMAKE_CURRENT_SOURCE_DIR}/pass_fail_catalyst.sh ${testname} ${ncat}") +# set_properties(${testname}) +# set_tests_properties(${testname} PROPERTIES LABELS "regression") +# set(CATALYST_FILE_INPUT_DECK_COMMAND "catalyst_file_name: catalyst.txt") +# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/${testname}.template.yaml +# ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}/${testname}_catalyst.yaml @ONLY) +# file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_files/${testname}/catalyst.txt +# DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/test_files/${testname}) +# endif() +# else() +# add_test_r(${testname} ${np}) +# endif() +#endfunction(add_test_r_cat) if(NOT ENABLE_CUDA AND NOT ENABLE_ROCM) @@ -171,7 +163,7 @@ if(NOT ENABLE_CUDA AND NOT ENABLE_ROCM) add_test_r(ablUnstableEdge_ra 4) add_test_r(ablStableEdge 4) add_test_r_post(ablNeutralStat 8) - add_test_r_cat(ablNeutralEdge 8 2) + #add_test_r_cat(ablNeutralEdge 8 2) add_test_r(ablNeutralEdgeSegregated 8) add_test_r(ablNeutralEdgeNoSlip 4) add_test_r(ablHill3dSymPenalty 4)