Skip to content

Commit d8f416b

Browse files
steadmongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e137fe3 commit d8f416b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ freebsd_12_task:
1919
build_script:
2020
- su git -c gmake
2121
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ if test -n "$run_tests"
4949
then
5050
group "Run tests" make test ||
5151
handle_failed_tests
52+
group "Run unit tests" \
53+
make DEFAULT_UNIT_TEST_TARGET=unit-tests-prove unit-tests
5254
fi
5355
check_unignored_build_artifacts
5456

ci/run-test-slice.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ group "Run tests" make --quiet -C t T="$(cd t &&
1515
tr '\n' ' ')" ||
1616
handle_failed_tests
1717

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+
1823
check_unignored_build_artifacts

0 commit comments

Comments
 (0)