]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: run unit tests in CI
authorJosh Steadmon <steadmon@google.com>
Thu, 9 Nov 2023 18:50:44 +0000 (10:50 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Nov 2023 23:15:32 +0000 (08:15 +0900)
Run unit tests in both Cirrus and GitHub CI. For sharded CI instances
(currently just Windows on GitHub), run only on the first shard. This is
OK while we have only a single unit test executable, but we may wish to
distribute tests more evenly when we add new unit tests in the future.

We may also want to add more status output in our unit test framework,
so that we can do similar post-processing as in
ci/lib.sh:handle_failed_tests().

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.cirrus.yml
ci/run-build-and-tests.sh
ci/run-test-slice.sh

index 4860bebd32f8d3f34c2382f097ac50c0b972d3a0..b6280692d2f21aaa17548985979279594c94323e 100644 (file)
@@ -19,4 +19,4 @@ freebsd_12_task:
   build_script:
     - su git -c gmake
   test_script:
-    - su git -c 'gmake test'
+    - su git -c 'gmake DEFAULT_UNIT_TEST_TARGET=unit-tests-prove test unit-tests'
index a18b13a41dd462edd3643b3fc9cd59404c2de6c3..6c166b02a8e5a5b3e980183d06003cb0e914a430 100755 (executable)
@@ -49,6 +49,8 @@ if test -n "$run_tests"
 then
        group "Run tests" make test ||
        handle_failed_tests
+       group "Run unit tests" \
+               make DEFAULT_UNIT_TEST_TARGET=unit-tests-prove unit-tests
 fi
 check_unignored_build_artifacts
 
index a3c67956a8df8f803bc81eee1b86a8f5559db57b..ae8094382fe418dbd807dbc2156e16b814aa2adc 100755 (executable)
@@ -15,4 +15,9 @@ group "Run tests" make --quiet -C t T="$(cd t &&
        tr '\n' ' ')" ||
 handle_failed_tests
 
+# We only have one unit test at the moment, so run it in the first slice
+if [ "$1" == "0" ] ; then
+       group "Run unit tests" make --quiet -C t unit-tests-prove
+fi
+
 check_unignored_build_artifacts