Tests/Instrumentation: Split make cases out to separate suite

These tests experience frequent timeouts in CI, which are either actual
timeouts due to low resource runners, or a platform-specific bug
causing an indefinite hang. Either way, it's beneficial to locate these
in their own test suite to reduce noise and ensure the rest of the
tests pass regularly.
This commit is contained in:
Tyler Yankee
2026-07-29 10:59:42 -04:00
parent d1cffecacd
commit cfede7be9d
2 changed files with 38 additions and 10 deletions
+16 -5
View File
@@ -439,11 +439,22 @@ add_RunCMake_test(FileAPI -DPython_EXECUTABLE=${Python_EXECUTABLE}
-DCMAKE_CXX_SIMULATE_ID=${CMAKE_CXX_SIMULATE_ID}
-DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA})
if(CMAKE_GENERATOR MATCHES "Make|Ninja|FASTBuild")
add_RunCMake_test(Instrumentation -DPython_EXECUTABLE=${Python_EXECUTABLE}
-DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
-DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA})
function(add_RunCMake_Instrumentation_test variant)
add_RunCMake_test(Instrumentation${variant}
TEST_DIR Instrumentation
-DPython_EXECUTABLE=${Python_EXECUTABLE}
-DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}
-DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
-DCMake_TEST_INSTRUMENTATION_VARIANT=${variant}
)
set_property(TEST RunCMake.Instrumentation${variant} APPEND PROPERTY
LABELS "Instrumentation"
)
endfunction()
add_RunCMake_Instrumentation_test("")
add_RunCMake_Instrumentation_test(MakeProgram)
endif()
add_RunCMake_test(ConfigDir)
if(CMake_TEST_FindPython2)
@@ -29,6 +29,19 @@ function(instrument test)
"BAD_QUERY"
)
cmake_parse_arguments(ARGS "${OPTIONS}" "CHECK_SCRIPT" "CONFIGURE_ARGS" ${ARGN})
if(NOT CMake_TEST_INSTRUMENTATION_VARIANT)
if(ARGS_BUILD_MAKE_PROGRAM)
return()
endif()
endif()
if(CMake_TEST_INSTRUMENTATION_VARIANT STREQUAL "MakeProgram")
if(NOT ARGS_BUILD_MAKE_PROGRAM)
return()
endif()
endif()
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test})
set(v1 ${RunCMake_TEST_BINARY_DIR}/.cmake/instrumentation/v1)
set(v1 ${v1} PARENT_SCOPE)
@@ -325,17 +338,21 @@ instrument(cmake-command-custom-content
CONFIGURE_ARGS "-DN=2"
CHECK_SCRIPT check-custom-content.cmake
)
set(indexDir ${v1}/data/index)
set(fakeIndex ${indexDir}/index-0.json)
file(MAKE_DIRECTORY ${indexDir})
file(TOUCH ${fakeIndex})
if(NOT CMake_TEST_INSTRUMENTATION_VARIANT)
set(indexDir ${v1}/data/index)
set(fakeIndex ${indexDir}/index-0.json)
file(MAKE_DIRECTORY ${indexDir})
file(TOUCH ${fakeIndex})
endif()
# fakeIndex newer than all content files prevents their deletion
set(EXPECTED_CONTENT_FILES 2)
instrument(cmake-command-custom-content
NO_CONFIGURE MANUAL_HOOK PRESERVE_DATA
CHECK_SCRIPT check-custom-content-removed.cmake
)
file(REMOVE ${fakeIndex})
if(NOT CMake_TEST_INSTRUMENTATION_VARIANT)
file(REMOVE ${fakeIndex})
endif()
# old content files will be removed if no index file exists
set(EXPECTED_CONTENT_FILES 1)
instrument(cmake-command-custom-content