From 2665a34b3f9d3e1550b7b6386522b75049ea745e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 24 May 2024 18:53:34 +0200 Subject: [PATCH] ci: Update coverage files atomically Since we run tests in parallel we may end up rewriting the coverage info while running files acting on the same source files. The compiler can be smart though, so let's use the proper flag. Despite this, sometimes we may still end up into negative reports, so let's ignore them in CI since it's not worth breaking the build because of these coverage-parsing failures. --- .gitlab-ci.yml | 2 +- .lcovrc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c5e5b19d..4ea475a8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -174,7 +174,7 @@ fedora-x86_64: stage: build needs: [] variables: - CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" + CFLAGS: "-coverage -ftest-coverage -fprofile-arcs -fprofile-update=atomic" before_script: - !reference [".build-linux", "before_script"] - !reference [".with-git", "before_script"] diff --git a/.lcovrc b/.lcovrc index cbed5ba13..1800471b1 100644 --- a/.lcovrc +++ b/.lcovrc @@ -17,3 +17,6 @@ lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_as # When using dtrace some temporary files may be leaked as source files ignore_errors = source + +# Sometimes we may have negative counting despite using atomic profile update +ignore_errors = negative