diff --git a/CMakePresets.json b/CMakePresets.json index 85536bb086d5bb82675f26c563395d4f8bee2ca5..051de3e0e66d90c656463f9a6446fa73cae0e9d1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -242,12 +242,9 @@ "inherits": [ "_release" ], - "execution": { - "timeout": 900 - }, "filter": { "exclude": { - "name": "LARGE" + "label": "large" } } }, @@ -256,12 +253,9 @@ "inherits": [ "_release" ], - "execution": { - "timeout": 5400 - }, "filter": { "include": { - "name": "LARGE" + "label": "large" } } }, diff --git a/ProcessLib/ComponentTransport/Tests.cmake b/ProcessLib/ComponentTransport/Tests.cmake index b9f3c2aa52e3a53f8251cbeb00cb6495cc9961dc..5112621c4b3a6644bbd87ac205326df61f04f040 100644 --- a/ProcessLib/ComponentTransport/Tests.cmake +++ b/ProcessLib/ComponentTransport/Tests.cmake @@ -408,7 +408,7 @@ AddTest( WRAPPER time TESTER vtkdiff REQUIREMENTS NOT OGS_USE_MPI - RUNTIME 26 + RUNTIME 48 DIFF_DATA DiffusionAndStorageAndAdvectionAndDispersion_3Components_ts_100_t_5.700000_expected.vtu DiffusionAndStorageAndAdvectionAndDispersion_3Components_ts_100_t_5.700000.vtu Si Si 1e-7 1e-10 DiffusionAndStorageAndAdvectionAndDispersion_3Components_ts_200_t_35.700000_expected.vtu DiffusionAndStorageAndAdvectionAndDispersion_3Components_ts_200_t_35.700000.vtu Si Si 1e-7 1e-10 @@ -876,7 +876,7 @@ AddTest( WRAPPER time TESTER vtkdiff REQUIREMENTS NOT OGS_USE_MPI - RUNTIME 15 + RUNTIME 40 DIFF_DATA 3D1P-GWFlow_1_reference.vtu out_ogs5_H_ts_10_t_10000000.000000.vtu pressure_ogs5 pressure 2.4e1 1.4e-2 3D1P-GWFlow_1_reference.vtu out_ogs5_H_ts_10_t_10000000.000000.vtu NODAL_VELOCITY1 darcy_velocity 1e-10 1.4e-2 @@ -1080,7 +1080,7 @@ AddTest( Wetland_1d_ts_4_t_28800.000000_expected.vtu Wetland_1d_ts_4_t_28800.000000.vtu Sno Sno 1e-10 1e-16 Wetland_1d_ts_4_t_28800.000000_expected.vtu Wetland_1d_ts_4_t_28800.000000.vtu Sso Sso 1e-10 1e-16 Wetland_1d_ts_4_t_28800.000000_expected.vtu Wetland_1d_ts_4_t_28800.000000.vtu Sulphide Sulphide 1e-10 1e-16 - RUNTIME 24 + RUNTIME 40 ) AddTest( diff --git a/ProcessLib/LiquidFlow/Tests.cmake b/ProcessLib/LiquidFlow/Tests.cmake index e00f3a14fda68217faf20b5ad32b9aa817a718a7..4de0846bc6ccfc09981bf8b15d38427eac652757 100644 --- a/ProcessLib/LiquidFlow/Tests.cmake +++ b/ProcessLib/LiquidFlow/Tests.cmake @@ -233,7 +233,7 @@ AddTest( AddTest( NAME LiquidFlow_Isotropic_GravityDriven3D PATH Parabolic/LiquidFlow/GravityDriven3D - RUNTIME 5 + RUNTIME 130 EXECUTABLE ogs EXECUTABLE_ARGS isotropic_gravity_driven3D.prj WRAPPER mpirun diff --git a/ProcessLib/SmallDeformation/Tests.cmake b/ProcessLib/SmallDeformation/Tests.cmake index c47d796a048f4bb690d7ea6b2d88448c66b8b788..765ce2eddd8dfd68ec7df66d79b5426f4f2f15ff 100644 --- a/ProcessLib/SmallDeformation/Tests.cmake +++ b/ProcessLib/SmallDeformation/Tests.cmake @@ -38,7 +38,7 @@ if (NOT OGS_USE_MPI) OgsTest(PROJECTFILE Mechanics/InitialStates/equilibrium_restart.prj) OgsTest(PROJECTFILE Mechanics/InitialStates/non_equilibrium_initial_state.prj) OgsTest(PROJECTFILE Mechanics/InitialStates/soil_column_nonequilibrium_sigma_elementwise.prj) - OgsTest(PROJECTFILE Mechanics/Excavation/time_linear_excavation.prj RUNTIME 2) + OgsTest(PROJECTFILE Mechanics/Excavation/time_linear_excavation.prj RUNTIME 4) OgsTest(PROJECTFILE Mechanics/MohrCoulombAbboSloan/slope.prj RUNTIME 50) if(TEST ogs-Mechanics/MohrCoulombAbboSloan/slope) set_tests_properties(ogs-Mechanics/MohrCoulombAbboSloan/slope PROPERTIES WILL_FAIL true) diff --git a/scripts/ci/extends/template-build-linux.yml b/scripts/ci/extends/template-build-linux.yml index 40ee21c36b712d0ca89da45754107ac130d36b19..3df1ac2b5ab33e012cc78eb1221bfa58d6a00d32 100644 --- a/scripts/ci/extends/template-build-linux.yml +++ b/scripts/ci/extends/template-build-linux.yml @@ -21,21 +21,26 @@ - | if [[ -z "$TARGETS" ]]; then $BUILD_CMD_PREFIX cmake --build . --target package > >(tee make.output) - if [ "$BUILD_TESTS" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target tests ; fi + if [ "$BUILD_TESTS" = true ]; then $BUILD_CMD_PREFIX cmake --build . --target tests ; fi if [ "$BUILD_CTEST" = true ]; then + ctest_labels="default" + ctest_timeout=15 + if [ "$BUILD_CTEST_LARGE" = true ]; then + ctest_labels="large|$ctest_labels" + ctest_timeout=90 + fi ctest_exit=0 - ctest -T Test --no-compress-output --exclude-regex LARGE --timeout 900 || ctest_exit=$? + if [[ "$OSTYPE" == "darwin"* ]]; then alias date=gdate ; fi + ctest -T Test --no-compress-output -L "$ctest_labels" --repeat until-pass:2 --stop-time `date -d "today + ${ctest_timeout} minutes" +'%H:%M:%S'` || ctest_exit=$? if [ $ctest_exit -ne 0 ]; then echo "ctests failed (showing the last ${NUM_CTEST_ERROR_LINES} lines):" xsltproc ${CI_PROJECT_DIR}/scripts/test/ctest-error-output.xsl Testing/*/Test.xml | tail -n ${NUM_CTEST_ERROR_LINES} exit $ctest_exit fi + cp Testing/**/Test.xml Tests/ctest.xml fi - if [ "$BUILD_CTEST_LARGE" = true ] ; then $BUILD_CMD_PREFIX cmake --build . --target ctest-large ; fi - if [ "$BUILD_CTEST" = true ] ; then cp Testing/**/Test.xml Tests/ctest.xml ; fi - if [ "$BUILD_CTEST_LARGE" = true ] ; then cp Testing/**/Test.xml Tests/ctest-large.xml ; fi else $BUILD_CMD_PREFIX cmake --build . --target ${TARGETS} > >(tee make.output) fi diff --git a/scripts/ci/extends/template-build-win.yml b/scripts/ci/extends/template-build-win.yml index 83092416e970046b4dd2815e4ef25c43f3c9f8ae..abdfbf8c72bde241a987db88726989fe4f99ac9c 100644 --- a/scripts/ci/extends/template-build-win.yml +++ b/scripts/ci/extends/template-build-win.yml @@ -26,7 +26,7 @@ - | if($env:BUILD_CTEST -eq "true") { - ctest -T Test --no-compress-output --exclude-regex LARGE --timeout 900 + ctest -T Test --no-compress-output -LE large --repeat until-pass:2 --stop-time ((get-date) + (New-TimeSpan -Minutes 15)).ToString("HH:mm:ss") $ctest_exit=$? if(!$ctest_exit) { @@ -35,8 +35,8 @@ Get-Content -Path ./ctest-error-ouput.txt -Tail $env:NUM_CTEST_ERROR_LINES exit $ctest_exit } + cp Testing/**/Test.xml Tests/ctest.xml } - - if($env:BUILD_CTEST -eq "true") { cp Testing/**/Test.xml Tests/ctest.xml } - | if($env:CHECK_WARNINGS -eq "true" -and (cat make.output | Select-String -Pattern ': warning') ) { diff --git a/scripts/cmake/test/AddTest.cmake b/scripts/cmake/test/AddTest.cmake index 7410ca33ceb00483841472c981f7cfc9bc984ac0..8399b1a23283a2133de9aa7d49270fa7cd503b9b 100644 --- a/scripts/cmake/test/AddTest.cmake +++ b/scripts/cmake/test/AddTest.cmake @@ -95,7 +95,10 @@ function(AddTest) if(NOT DEFINED AddTest_REQUIREMENTS) set(AddTest_REQUIREMENTS TRUE) endif() - if(NOT DEFINED AddTest_RUNTIME) + set(timeout ${ogs.ctest.large_runtime}) + if(DEFINED AddTest_RUNTIME) + math(EXPR timeout "${AddTest_RUNTIME} * 3") + else() set(AddTest_RUNTIME 1) endif() if(NOT DEFINED AddTest_WORKING_DIRECTORY) @@ -409,11 +412,23 @@ Use six arguments version of AddTest with absolute and relative tolerances" ) endif() - current_dir_as_list(ProcessLib DIR_LABELS) - set_tests_properties( - ${TEST_NAME} PROPERTIES COST ${AddTest_RUNTIME} DISABLED - ${AddTest_DISABLED} LABELS "${DIR_LABELS}" + current_dir_as_list(ProcessLib labels) + if(${AddTest_RUNTIME} LESS_EQUAL ${ogs.ctest.large_runtime}) + list(APPEND labels default) + else() + list(APPEND labels large) + endif() + + set_tests_properties(${TEST_NAME} + PROPERTIES + COST ${AddTest_RUNTIME} + DISABLED ${AddTest_DISABLED} + LABELS "${labels}" ) + # Disabled for the moment, does not work with CI under load + # if(NOT OGS_COVERAGE) + # set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT ${timeout}) + # endif() add_dependencies(ctest ${AddTest_EXECUTABLE}) add_dependencies(ctest-large ${AddTest_EXECUTABLE}) @@ -463,9 +478,11 @@ Use six arguments version of AddTest with absolute and relative tolerances" --debug-output WORKING_DIRECTORY ${AddTest_SOURCE_PATH} ) - set_tests_properties( - ${TESTER_NAME} PROPERTIES DEPENDS ${TEST_NAME} DISABLED - ${AddTest_DISABLED} + set_tests_properties(${TESTER_NAME} + PROPERTIES + DEPENDS ${TEST_NAME} + DISABLED ${AddTest_DISABLED} + LABELS "tester;${labels}" ) endfunction() diff --git a/scripts/cmake/test/MeshTest.cmake b/scripts/cmake/test/MeshTest.cmake index 0fe743d2185960ff9519e8370144386392f7c61b..6ead62b290e1e1f928c768e5de853ef690e5776b 100644 --- a/scripts/cmake/test/MeshTest.cmake +++ b/scripts/cmake/test/MeshTest.cmake @@ -42,7 +42,10 @@ function(MeshTest) if(NOT DEFINED MeshTest_REQUIREMENTS) set(MeshTest_REQUIREMENTS TRUE) endif() - if(NOT DEFINED MeshTest_RUNTIME) + set(timeout ${ogs.ctest.large_runtime}) + if(DEFINED MeshTest_RUNTIME) + math(EXPR timeout "${MeshTest_RUNTIME} * 3") + else() set(MeshTest_RUNTIME 1) endif() if(NOT DEFINED MeshTest_WORKING_DIRECTORY) @@ -189,7 +192,21 @@ function(MeshTest) -DWORKING_DIRECTORY=${MeshTest_WORKING_DIRECTORY} -P ${PROJECT_SOURCE_DIR}/scripts/cmake/test/AddTestWrapper.cmake ) - set_tests_properties(${TEST_NAME} PROPERTIES COST ${MeshTest_RUNTIME}) + current_dir_as_list(ProcessLib labels) + if(${MeshTest_RUNTIME} LESS_EQUAL ${ogs.ctest.large_runtime}) + list(APPEND labels default) + else() + list(APPEND labels large) + endif() + set_tests_properties(${TEST_NAME} + PROPERTIES + COST ${MeshTest_RUNTIME} + LABELS "meshtest;${labels}" + ) + # Disabled for the moment, does not work with CI under load + # if(NOT OGS_COVERAGE) + # set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT ${timeout}) + # endif() if(TARGET ${MeshTest_EXECUTABLE}) add_dependencies(ctest ${MeshTest_EXECUTABLE}) @@ -214,6 +231,10 @@ function(MeshTest) --debug-output WORKING_DIRECTORY ${MeshTest_SOURCE_PATH} ) - set_tests_properties(${TESTER_NAME} PROPERTIES DEPENDS ${TEST_NAME}) + set_tests_properties(${TESTER_NAME} + PROPERTIES + DEPENDS ${TEST_NAME} + LABELS "tester;${labels}" + ) endfunction() diff --git a/scripts/cmake/test/OgsTest.cmake b/scripts/cmake/test/OgsTest.cmake index 44459eb41ba9ccd3079b5a0a6a19341522ea86f6..538be4c3d99221732a3be9a0bbe98c80bdd255d1 100644 --- a/scripts/cmake/test/OgsTest.cmake +++ b/scripts/cmake/test/OgsTest.cmake @@ -22,7 +22,10 @@ function(OgsTest) ) endif() - if(NOT DEFINED OgsTest_RUNTIME) + set(timeout ${ogs.ctest.large_runtime}) + if(DEFINED OgsTest_RUNTIME) + math(EXPR timeout "${OgsTest_RUNTIME} * 3") + else() set(OgsTest_RUNTIME 1) endif() @@ -59,16 +62,22 @@ function(OgsTest) # $<TARGET_FILE:ogs> -r ${OgsTest_SOURCE_DIR} # ${OgsTest_SOURCE_DIR}/${OgsTest_NAME}) - current_dir_as_list(ProcessLib DIR_LABELS) - set_tests_properties( - ${TEST_NAME} - PROPERTIES ENVIRONMENT - VTKDIFF_EXE=$<TARGET_FILE:vtkdiff> - COST - ${OgsTest_RUNTIME} - DISABLED - ${OgsTest_DISABLED} - LABELS - "${DIR_LABELS}" + current_dir_as_list(ProcessLib labels) + if(${OgsTest_RUNTIME} LESS_EQUAL ${ogs.ctest.large_runtime}) + list(APPEND labels default) + else() + list(APPEND labels large) + endif() + + set_tests_properties(${TEST_NAME} + PROPERTIES + ENVIRONMENT VTKDIFF_EXE=$<TARGET_FILE:vtkdiff> + COST ${OgsTest_RUNTIME} + DISABLED ${OgsTest_DISABLED} + LABELS "${labels}" ) + # Disabled for the moment, does not work with CI under load + # if(NOT OGS_COVERAGE) + # set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT ${timeout}) + # endif() endfunction() diff --git a/scripts/cmake/test/Test.cmake b/scripts/cmake/test/Test.cmake index a26a61b0f75b969beec8b5f8723fc65d4e39694f..40c6c1404c112e7a4e6476ab22fe4cd9d9275e55 100644 --- a/scripts/cmake/test/Test.cmake +++ b/scripts/cmake/test/Test.cmake @@ -62,8 +62,8 @@ add_custom_target( ctest COMMAND ${CMAKE_CTEST_COMMAND} -T Test --force-new-ctest-process - --output-on-failure --output-log Tests/ctest.log --exclude-regex LARGE - ${CONFIG_PARAMETER} --timeout 900 # 15 minutes + --output-on-failure --output-log Tests/ctest.log -LE large + ${CONFIG_PARAMETER} DEPENDS ${test_dependencies} ctest-cleanup USES_TERMINAL ) @@ -76,8 +76,8 @@ add_custom_target( ctest-large COMMAND ${CMAKE_CTEST_COMMAND} -T Test --force-new-ctest-process - --output-on-failure --output-log Tests/ctest-large.log --tests-regex - LARGE ${CONFIG_PARAMETER} --timeout 5400 # 90 minutes + --output-on-failure --output-log Tests/ctest-large.log -L large + ${CONFIG_PARAMETER} DEPENDS ${test_dependencies} ctest-large-cleanup USES_TERMINAL )