From 8f166fa51ecd410cd10722f3c4eae41e668037e5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 3 Oct 2025 18:42:43 -0400 Subject: [PATCH] ci: Add jobs to perform coverage with BullseyeCoverage on Linux --- .gitlab-ci.yml | 36 +++++++++++++++++++ .gitlab/artifacts.yml | 2 ++ ...configure_fedora42_bullseye_coverage.cmake | 21 +++++++++++ .gitlab/ci/env_fedora42_bullseye_coverage.sh | 10 ++++++ .../pre_build_fedora42_bullseye_coverage.sh | 2 ++ ...re_configure_fedora42_bullseye_coverage.sh | 2 ++ .../ci/pre_test_fedora42_bullseye_coverage.sh | 2 ++ .gitlab/os-linux.yml | 13 +++++++ .../CTestCommandLine/RunCMakeTest.cmake | 2 +- 9 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 .gitlab/ci/configure_fedora42_bullseye_coverage.cmake create mode 100644 .gitlab/ci/env_fedora42_bullseye_coverage.sh create mode 100644 .gitlab/ci/pre_build_fedora42_bullseye_coverage.sh create mode 100644 .gitlab/ci/pre_configure_fedora42_bullseye_coverage.sh create mode 100644 .gitlab/ci/pre_test_fedora42_bullseye_coverage.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c734658c7a..9f0c72afbe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -186,6 +186,42 @@ a:fedora42-gcc-gcov: variables: CMAKE_CI_JOB_NIGHTLY: "true" +b:fedora42-bullseye-coverage: + extends: + - .fedora42_bullseye_coverage + - .cmake_build_linux + - .cmake_build_artifacts + - .linux_x86_64_tags + - .run_manually + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +t:fedora42-bullseye-coverage: + extends: + - .fedora42_bullseye_coverage + - .cmake_test_linux + - .cmake_coverage_artifacts + - .linux_x86_64_tags_x11 + - .run_dependent + # Run coverage analysis even if the tests fail. + allow_failure: true + needs: + - b:fedora42-bullseye-coverage + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + +a:fedora42-bullseye-coverage: + extends: + - .fedora42_bullseye_coverage + - .cmake_coverage_linux + - .cmake_cdash_artifacts + - .linux_x86_64_tags + - .run_dependent + needs: + - t:fedora42-bullseye-coverage + variables: + CMAKE_CI_JOB_NIGHTLY: "true" + # Linux builds b:centos7-x86_64: diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml index 0046779115..2d28d8bc11 100644 --- a/.gitlab/artifacts.yml +++ b/.gitlab/artifacts.yml @@ -65,6 +65,7 @@ # CTest coverage files. - ${CMAKE_CI_BUILD_DIR}/CMakeFiles/TargetDirectories.txt + - ${CMAKE_CI_BUILD_DIR}/Bullseye/ - ${CMAKE_CI_BUILD_DIR}/**/*.gcno - ${CMAKE_CI_BUILD_DIR}/Source/QtDialog/moc_*.cpp - ${CMAKE_CI_BUILD_DIR}/Source/QtDialog/ui_*.h @@ -190,6 +191,7 @@ # CTest coverage files. - ${CMAKE_CI_BUILD_DIR}/CMakeFiles/TargetDirectories.txt + - ${CMAKE_CI_BUILD_DIR}/Bullseye/ - ${CMAKE_CI_BUILD_DIR}/**/*.gcno - ${CMAKE_CI_BUILD_DIR}/**/*.gcda diff --git a/.gitlab/ci/configure_fedora42_bullseye_coverage.cmake b/.gitlab/ci/configure_fedora42_bullseye_coverage.cmake new file mode 100644 index 0000000000..9c949bcf40 --- /dev/null +++ b/.gitlab/ci/configure_fedora42_bullseye_coverage.cmake @@ -0,0 +1,21 @@ +# Compile with Bullseye compiler wrappers, but do not test with them. +set(CMAKE_C_COMPILER "/opt/bullseye/bin/cc" CACHE PATH "") +set(CMAKE_CXX_COMPILER "/opt/bullseye/bin/c++" CACHE PATH "") + +# Bullseye records a COVFILE id in object files, so they cannot be cached. +set(configure_no_sccache 1) + +# Do not bootstrap for the coverage test suite. +set(CMAKE_SKIP_BOOTSTRAP_TEST TRUE CACHE BOOL "") + +# Shrink stress tests when running with Bullseye. +set(ENV{KWSYS_TEST_PROCESS_1_COUNT} 11) + +set(CMake_TEST_GUI "ON" CACHE BOOL "") +set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly,build_database" CACHE STRING "") +set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "") +set(CMake_TEST_TLS_VERIFY_URL_BAD "https://badtls-expired.kitware.com" CACHE STRING "") +set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "") +set(CMake_TEST_TLS_VERSION_URL_BAD "https://badtls-v1-1.kitware.com:8011" CACHE STRING "") + +include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake") diff --git a/.gitlab/ci/env_fedora42_bullseye_coverage.sh b/.gitlab/ci/env_fedora42_bullseye_coverage.sh new file mode 100644 index 0000000000..57f92abc61 --- /dev/null +++ b/.gitlab/ci/env_fedora42_bullseye_coverage.sh @@ -0,0 +1,10 @@ +source .gitlab/ci/bullseye-env.sh + +# Store Bullseye activation state in the work directory. +export COVAPPDATADIR="$CI_PROJECT_DIR/build/Bullseye" + +# Collect all coverage in a single location. +export COVFILE="$COVAPPDATADIR/CMake.cov" + +# Suppress the Bullseye startup banner on compilation. +export COVCOPT="--no-banner" diff --git a/.gitlab/ci/pre_build_fedora42_bullseye_coverage.sh b/.gitlab/ci/pre_build_fedora42_bullseye_coverage.sh new file mode 100644 index 0000000000..ab78d8f76b --- /dev/null +++ b/.gitlab/ci/pre_build_fedora42_bullseye_coverage.sh @@ -0,0 +1,2 @@ +# Turn on Bullseye coverage for build step. +cov01 --on diff --git a/.gitlab/ci/pre_configure_fedora42_bullseye_coverage.sh b/.gitlab/ci/pre_configure_fedora42_bullseye_coverage.sh new file mode 100644 index 0000000000..ec54ff230b --- /dev/null +++ b/.gitlab/ci/pre_configure_fedora42_bullseye_coverage.sh @@ -0,0 +1,2 @@ +# Turn off Bullseye coverage for configure step. +cov01 --off diff --git a/.gitlab/ci/pre_test_fedora42_bullseye_coverage.sh b/.gitlab/ci/pre_test_fedora42_bullseye_coverage.sh new file mode 100644 index 0000000000..4e892d2a56 --- /dev/null +++ b/.gitlab/ci/pre_test_fedora42_bullseye_coverage.sh @@ -0,0 +1,2 @@ +# Turn on Bullseye coverage for test step. +cov01 --on diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 2ca080d38c..42daea4ec1 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -111,6 +111,19 @@ CMAKE_CI_TEST_TIMEOUT: "1500" CMAKE_CI_NO_INSTALL: 1 +.fedora42_bullseye_coverage: + extends: .fedora42 + environment: + name: bullseye-coverage + variables: + # See issue #20001 + CMAKE_GENERATOR: "Unix Makefiles" + CMAKE_CONFIGURATION: fedora42_bullseye_coverage + CTEST_NO_WARNINGS_ALLOWED: 1 + CMAKE_CI_BUILD_TYPE: Debug + CMAKE_CI_TEST_TIMEOUT: "1500" + CMAKE_CI_NO_INSTALL: 1 + #### Lint builds .fedora42_tidy: diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 9d01de4041..0b8226ef68 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -576,7 +576,7 @@ run_cmake_command(EmptyDirTest-ctest run_cmake_command(EmptyDirCoverage-ctest # Isolate this test from any surrounding coverage tool. - ${CMAKE_COMMAND} -E env --unset=COVFILE + ${CMAKE_COMMAND} -E env COVNOSAVE=1 --unset=COVAPPDATADIR --unset=COVFILE ${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T Coverage )