path: root/t/Makefile
diff options
authorÆvar Arnfjörð Bjarmason <>2010-08-08 14:49:24 (GMT)
committerJunio C Hamano <>2010-08-18 19:42:14 (GMT)
commitb6b84d1b7458676d2564ac7f8dad8a10bf900239 (patch)
tree8c47e2c4f71ccd2bb7aed506c052e9cfb4d8a4fc /t/Makefile
parentce60653e59f89b409b80a1a381275914fddce07f (diff)
tests: Infrastructure for Git smoke testing
Add the capability to send smoke reports from the Git test suite. Currently we only notice bugs in the test suite when it's run manually. Bugs in Git that only occur on obscure platforms or setups that the core developers aren't using can thus go unnoticed. This series aims to change that. With it, anyone that's interested in avoiding bitrot in Git can volunteer to run a smoke tester. A smoke tester periodically compiles the latest version of Git, runs the test suite, and submits a report to a central server indicating how the test run went. A smoke tester might run something like this in cron: #!/bin/sh cd ~/g/git git fetch for branch in maint master next pu; do git checkout origin/$i && make clean all && cd t && make smoke_report done The smoker might want to compile git with non-default flags, include bisecting functionality or run the tests under valgrind. Doing that is outside the scope of this patch, this just adds a report submission mechanism. But including a canonical smoke runner is something we'll want to include eventually. What this does now is add smoke and smoke_report targets to t/Makefile (this example only uses a few tests for demonstration): $ make clean smoke rm -f -r 'trash directory'.* test-results rm -f t????/cvsroot/CVSROOT/?* rm -f -r valgrind/bin rm -f .prove perl ./harness --git-version="" \ --no-verbose \ --archive="test-results/git-smoke.tar.gz" \ ....... ok ........ ok ..... ok .. ok .. ok ..... ok ........ ok All tests successful. Test Summary Report ------------------- (Wstat: 0 Tests: 46 Failed: 0) TODO passed: 5 Files=7, Tests=134, 3 wallclock secs ( 0.06 usr 0.05 sys + 0.23 cusr 1.33 csys = 1.67 CPU) Result: PASS TAP Archive created at /home/avar/g/git/t/test-results/git-smoke.tar.gz The smoke target uses TAP::Harness::Archive to aggregate the test results into a tarball. The tarball contains two things, the output of every test file that was run, and a metadata file: Tarball contents: $ tar xzvf git-smoke.tar.gz meta.yml A test report: $ cat ok 1 - sigchain works # passed all 1 test(s) 1..1 A metadata file: --- extra_properties: file_attributes: - description: end_time: 1280437324.61398 start_time: 1280437324.22186 - description: end_time: 1280437325.12346 start_time: 1280437324.62393 - description: end_time: 1280437325.29428 start_time: 1280437325.13646 - description: end_time: 1280437325.59678 start_time: 1280437325.30565 - description: end_time: 1280437325.77376 start_time: 1280437325.61003 - description: end_time: 1280437325.85426 start_time: 1280437325.78727 - description: end_time: 1280437326.2362 start_time: 1280437325.86768 file_order: - - - - - - - start_time: 1280437324 stop_time: 1280437326 The "extra_properties" hash is where we'll stick Git-specific info, like whether Git was compiled with gettext or the fallback regex engine, and what branch we're compiling. Currently no metadata like this is included. The entire tarball is then submitted to a central smokebox at This is done with curl(1) via the "smoke_report" target: $ make smoke_report curl \ -H "Expect: " \ -F project=Git \ -F architecture=x86_64 \ -F platform=Linux \ -F revision="" \ -F report_file=@test-results/git-smoke.tar.gz \ \ | grep -v ^Redirecting % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 117k 100 63 100 117k 3 6430 0:00:21 0:00:18 0:00:03 0 Reported #8 added. Reports are then made available on the smokebox via a web interface: The smoke reports are also mirrored to a Git repository hosted on GitHub: The Smolder SQLite database that contains metadata about the reports is also made available: Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't/Makefile')
1 files changed, 34 insertions, 1 deletions
diff --git a/t/Makefile b/t/Makefile
index 819b936..d8bf05f 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -49,4 +49,37 @@ full-svn-test:
GIT_TEST_OPTS=--valgrind $(MAKE)
-.PHONY: pre-clean $(T) aggregate-results clean valgrind
+# Smoke testing targets
+-include ../GIT-BUILD-OPTIONS
+-include ../GIT-VERSION-FILE
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
+uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
+ mkdir -p test-results
+ $(PERL_PATH) ./harness \
+ --archive="test-results/git-smoke.tar.gz" \
+ $(T)
+smoke: test-results/git-smoke.tar.gz
+smoke_report: smoke
+ curl \
+ -H "Expect: " \
+ -F project=Git \
+ -F architecture="$(uname_M)" \
+ -F platform="$(uname_S)" \
+ -F revision="$(GIT_VERSION)" \
+ -F report_file=@test-results/git-smoke.tar.gz \
+ \
+ | grep -v ^Redirecting
+.PHONY: pre-clean $(T) aggregate-results clean valgrind smoke smoke_report