Skip to content

Commit

Permalink
ci: run unit tests in CI
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
steadmon authored and gitster committed Nov 9, 2023
1 parent e137fe3 commit d8f416b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 2 additions & 0 deletions ci/run-build-and-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions ci/run-test-slice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d8f416b

Please sign in to comment.