]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: fix aggregation of test results with Meson
authorPatrick Steinhardt <ps@pks.im>
Mon, 5 May 2025 10:55:45 +0000 (12:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 May 2025 21:19:10 +0000 (14:19 -0700)
Our CI needs to be aware of the location of the test output directory so
that it knows where to find test results. Some of our CI jobs achieve
this by setting the `TEST_OUTPUT_DIRECTORY` environment variable, which
ensures that the output will be written to that directory. Other jobs,
especially on GitHub Workflows, don't set that environment variable and
instead expect test results to be located in the source directory in
"t/".

The latter logic does not work with Meson though, as the test results
are not written into the source directory by default, but instead into
the build directory. As such, any job that uses Meson without setting
the environment variable will be unable to locate and aggregate results.

Fix this by explicitly setting the test output directory when we set up
the Meson build directory. Like this, we can easily default to "t/" in
the source directory when the value hasn't been set explicitly.

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ci/run-build-and-tests.sh

index 1c698467235943639ea91c8328382bacd33a0fb0..1e17e2ed90eb1faefadb33be6afbceb080712810 100755 (executable)
@@ -57,6 +57,7 @@ case "$jobname" in
                --warnlevel 2 --werror \
                --wrap-mode nofallback \
                -Dfuzzers=true \
+               -Dtest_output_directory="${TEST_OUTPUT_DIRECTORY:-$(pwd)/t}" \
                $MESONFLAGS
        group "Build" meson compile -C build --
        if test -n "$run_tests"