ci: run unit tests in CI
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>
Josh Steadmon committed
Nov 9, 2023 at 10:50 UTC
d8f416bbb87c2218ee5e43ec44ab8574a93fe423
3 files changed
+8
-1
.cirrus.yml
+1
-1
@@ -19,4 +19,4 @@ freebsd_12_task:
19
build_script:
20
- su git -c gmake
21
test_script:
22
- - su git -c 'gmake test'
22
+ - su git -c 'gmake DEFAULT_UNIT_TEST_TARGET=unit-tests-prove test unit-tests'
ci/run-build-and-tests.sh
+2
@@ -49,6 +49,8 @@ if test -n "$run_tests"
49
then
50
group "Run tests" make test ||
51
handle_failed_tests
52
+ group "Run unit tests" \
53
+ make DEFAULT_UNIT_TEST_TARGET=unit-tests-prove unit-tests
54
fi
55
check_unignored_build_artifacts
56
ci/run-test-slice.sh
+5
@@ -15,4 +15,9 @@ group "Run tests" make --quiet -C t T="$(cd t &&
15
tr '\n' ' ')" ||
16
handle_failed_tests
17
18
+# We only have one unit test at the moment, so run it in the first slice
19
+if [ "$1" == "0" ] ; then
20
+ group "Run unit tests" make --quiet -C t unit-tests-prove
21
+fi
22
+
23
check_unignored_build_artifacts