Browse Source

ci: Add jobs to perform coverage with BullseyeCoverage on Linux

Brad King 3 months ago
parent
commit
8f166fa51e

+ 36 - 0
.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:

+ 2 - 0
.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
 

+ 21 - 0
.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")

+ 10 - 0
.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"

+ 2 - 0
.gitlab/ci/pre_build_fedora42_bullseye_coverage.sh

@@ -0,0 +1,2 @@
+# Turn on Bullseye coverage for build step.
+cov01 --on

+ 2 - 0
.gitlab/ci/pre_configure_fedora42_bullseye_coverage.sh

@@ -0,0 +1,2 @@
+# Turn off Bullseye coverage for configure step.
+cov01 --off

+ 2 - 0
.gitlab/ci/pre_test_fedora42_bullseye_coverage.sh

@@ -0,0 +1,2 @@
+# Turn on Bullseye coverage for test step.
+cov01 --on

+ 13 - 0
.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:

+ 1 - 1
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
   )