From 3c6162ea5c137fb90d100865162f460af9f53a0a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 2 Feb 2026 13:07:58 -0800 Subject: test: optionally test contrib in CI Recently it was reported that a topic merged to 'next' broke build and test for contrib/subtree part of the system. Instead of having those who run 'next' or 'master' to hit the build and test breakage and report to us, make sure we notice breakages in contrib/ area before they hit my tree at all, during their own presubmit testing. Signed-off-by: Junio C Hamano --- Makefile | 6 ++++++ ci/run-build-and-tests.sh | 3 +++ contrib/Makefile | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 contrib/Makefile diff --git a/Makefile b/Makefile index 8aa489f3b6..d0ab8fdb04 100644 --- a/Makefile +++ b/Makefile @@ -342,6 +342,9 @@ include shared.mak # If it isn't set, fallback to $LC_ALL, $LANG or use the first utf-8 # locale returned by "locale -a". # +# Define TEST_CONTRIB_TOO to make "make test" run tests in contrib/ +# directories. +# # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime. # # Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC. @@ -3369,6 +3372,9 @@ export TEST_NO_MALLOC_CHECK test: all $(MAKE) -C t/ all +ifdef TEST_CONTRIB_TOO + $(MAKE) -C contrib/ test +endif perf: all $(MAKE) -C t/perf/ all diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index 8bda62b921..28cfe730ee 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -5,6 +5,8 @@ . ${0%/*}/lib.sh +export TEST_CONTRIB_TOO=yes + case "$jobname" in fedora-breaking-changes-musl|linux-breaking-changes) export WITH_BREAKING_CHANGES=YesPlease @@ -36,6 +38,7 @@ linux-sha256) linux-reftable|linux-reftable-leaks|osx-reftable) export GIT_TEST_DEFAULT_REF_FORMAT=reftable ;; + esac case "$jobname" in diff --git a/contrib/Makefile b/contrib/Makefile new file mode 100644 index 0000000000..787cd07f52 --- /dev/null +++ b/contrib/Makefile @@ -0,0 +1,10 @@ +all:: + +test:: + $(MAKE) -C diff-highlight $@ + $(MAKE) -C subtree $@ + +clean:: + $(MAKE) -C contacts $@ + $(MAKE) -C diff-highlight $@ + $(MAKE) -C subtree $@ -- cgit v1.3 From c591c3ceffd0a033eb228ebb54c596362ded5615 Mon Sep 17 00:00:00 2001 From: Colin Stagner Date: Fri, 6 Feb 2026 22:27:03 -0600 Subject: ci: ubuntu: use GNU coreutils for dirname The uutils version of `dirname` has output that is inconsistent with GNU coreutils. Prefer the GNU implementation of this command. Signed-off-by: Colin Stagner Signed-off-by: Junio C Hamano --- ci/install-dependencies.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 6ee8216a05..c55441d9df 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -76,6 +76,17 @@ ubuntu-*|i386/ubuntu-*|debian-*) sudo update-alternatives --set sudo /usr/bin/sudo.ws fi + # on uutils v0.2.2 from rust-coreutils, + # dirname "foo/." + # outputs "." instead of "foo" like it should. + # Use GNU coreutils to provide dirname instead. + # + # See . + if test -x /usr/bin/gnudirname + then + ln -sfT /usr/bin/gnudirname /usr/bin/dirname + fi + case "$distro" in ubuntu-*) mkdir --parents "$CUSTOM_PATH" -- cgit v1.3