From 50db0c5e8da293d816d8b5c4620f2fa2d311d37a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 9 Feb 2022 16:55:00 +1100 Subject: [PATCH] CI: fix missing 'OS_ID' env var in ctest jobs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Jobs inheriting from this template were attempting to set `$OS_ID` from the file OS_ID that did not exist before `install-package.sh` was run. The result was output in the build log like: export OS_ID=$( cat OS_ID ) cat: OS_ID: No such file or directory Somewhat surprisingly, tests were still passing. The reason is that `$OS_ID` is only accessed in ci/tests.py and on Ubuntu (the platform used for both ctest jobs) the only `$OS_ID`-based skip is for `mingle`, that is also coincidentally skipped due to these jobs using the CMake build system where `mingle` is not build. That is, the mingle check is meant to be skipped on lines 104-108, but actually ends up skipped on lines 116-122 due to `$OS_ID` being empty. In future, all of this should be refactored to use a less brittle technique for asking “what distro are we running on?” When moving to Python 3.10, `platform.freedesktop_os_release()` would be the obvious candidate. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62601ceaf..9d2a60a8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -235,8 +235,6 @@ portable-source: .test_template_including_ctest: &test_definition_including_ctest stage: test script: - - export GV_VERSION=$( cat GRAPHVIZ_VERSION ) - - export OS_ID=$( cat OS_ID ) - ci/test_coverage.py --init - pushd build # Use GVBINDIR to specify where to generate and load config6 @@ -250,6 +248,8 @@ portable-source: - unset GVBINDIR - popd - ci/install-packages.sh + - export GV_VERSION=$( cat GRAPHVIZ_VERSION ) + - export OS_ID=$( cat OS_ID ) # Many of the tests run by pytest currently trigger ASan # memory leak detections. Disable those for now. - export ASAN_OPTIONS=detect_leaks=0 -- 2.40.0