{"thread":{"id":"24586","subject":"[PATCH/RFC v2 0/2] Smoke testing for Git","startedAt":"2010-07-30T22:43:25Z","lastAt":"2010-07-30T22:43:27Z","messageCount":3,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"146804","messageId":"1280529807-23677-1-git-send-email-avarab@gmail.com","threadId":"24586","inReplyTo":null,"subject":"[PATCH/RFC v2 0/2] Smoke testing for Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-30T22:43:25Z","receivedAt":"2010-07-30T22:43:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This is v2 of the smoke testing RFC. It solves the TODO issues noted\nin v1 of the RFC. There's now a smoke testing infrastructure for Git\nat http://smoke.git.nix.is/, and this patch adds bits to git to\ninteroperate with it.\n\nThere's a lot more info in the first patch, and t/README documentation\nin the second one.\n\nÆvar Arnfjörð Bjarmason (2):\n  tests: Infrastructure for Git smoke testing\n  t/README: Document the Smoke testing\n\n t/Makefile |   35 ++++++++++++++++++++++++++++++-\n t/README   |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n t/harness  |   21 +++++++++++++++++++\n 3 files changed, 121 insertions(+), 1 deletions(-)\n create mode 100755 t/harness\n"},{"id":"146805","messageId":"1280529807-23677-2-git-send-email-avarab@gmail.com","threadId":"24586","inReplyTo":"1280529807-23677-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC v2 1/2] tests: Infrastructure for Git smoke testing","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-30T22:43:26Z","receivedAt":"2010-07-30T22:43:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Add the capability to send smoke reports from the Git test suite.\n\nCurrently we only notice bugs in the test suite when it's run\nmanually. Bugs in Git that only occur on obscure platforms or setups\nthat the core developers aren't using can thus go unnoticed.\n\nThis series aims to change that. With it anyone that's interested in\navoiding bitrot in Git can volunteer to run a smoke tester. A smoke\ntester periodically compiles the latest version of Git, runs the test\nsuite, and submits a report to a central server indicating how the\ntest run went.\n\nA smoke tester might run something like this in cron:\n\n    #!/bin/sh\n    cd ~/g/git\n    git fetch\n    for branch in maint master next pu; do\n        git checkout origin/$i &&\n        make clean all &&\n        cd t &&\n        make smoke_report\n    done\n\nThe smoker might want to compile git with non-default flags, include\nbisecting functionality or run the tests under valgrind. Doing that is\noutside the scope of this patch, this just adds a report submission\nmechanism. But including a canonical smoke runner is something we'll\nwant to include eventually.\n\nWhat this does now is add smoke and smoke_report targets to t/Makefile\n(this example only uses a few tests for demonstration):\n\n    $ make clean smoke\n    rm -f -r 'trash directory'.* test-results\n    rm -f t????/cvsroot/CVSROOT/?*\n    rm -f -r valgrind/bin\n    rm -f .prove\n    perl ./harness --git-version=\"1.7.2.1.173.gc9b40\" \\\n                    --no-verbose \\\n                    --archive=\"test-results/git-smoke.tar.gz\" \\\n                    t0000-basic.sh t0001-init.sh t0002-gitfile.sh t0003-attributes.sh t0004-unwritable.sh t0005-signals.sh t0006-date.sh\n    t0000-basic.sh ....... ok\n    t0001-init.sh ........ ok\n    t0002-gitfile.sh ..... ok\n    t0003-attributes.sh .. ok\n    t0004-unwritable.sh .. ok\n    t0005-signals.sh ..... ok\n    t0006-date.sh ........ ok\n    All tests successful.\n\n    Test Summary Report\n    -------------------\n    t0000-basic.sh     (Wstat: 0 Tests: 46 Failed: 0)\n      TODO passed:   5\n    Files=7, Tests=134,  3 wallclock secs ( 0.06 usr  0.05 sys +  0.23 cusr  1.33 csys =  1.67 CPU)\n    Result: PASS\n\n    TAP Archive created at /home/avar/g/git/t/test-results/git-smoke.tar.gz\n\nThe smoke target uses TAP::Harness::Archive to aggregate the test\nresults into a tarball. The tarball contains two things, the output of\nevery test file that was run, and a metadata file:\n\nTarball contents:\n\n    $ tar xzvf git-smoke.tar.gz\n    t0004-unwritable.sh\n    t0001-init.sh\n    t0002-gitfile.sh\n    t0005-signals.sh\n    t0000-basic.sh\n    t0003-attributes.sh\n    t0006-date.sh\n    meta.yml\n\nA test report:\n\n    $ cat t0005-signals.sh\n    ok 1 - sigchain works\n    # passed all 1 test(s)\n    1..1\n\nA metadata file:\n\n    ---\n    extra_properties:\n    file_attributes:\n      -\n        description: t0000-basic.sh\n        end_time: 1280437324.61398\n        start_time: 1280437324.22186\n      -\n        description: t0001-init.sh\n        end_time: 1280437325.12346\n        start_time: 1280437324.62393\n      -\n        description: t0002-gitfile.sh\n        end_time: 1280437325.29428\n        start_time: 1280437325.13646\n      -\n        description: t0003-attributes.sh\n        end_time: 1280437325.59678\n        start_time: 1280437325.30565\n      -\n        description: t0004-unwritable.sh\n        end_time: 1280437325.77376\n        start_time: 1280437325.61003\n      -\n        description: t0005-signals.sh\n        end_time: 1280437325.85426\n        start_time: 1280437325.78727\n      -\n        description: t0006-date.sh\n        end_time: 1280437326.2362\n        start_time: 1280437325.86768\n    file_order:\n      - t0000-basic.sh\n      - t0001-init.sh\n      - t0002-gitfile.sh\n      - t0003-attributes.sh\n      - t0004-unwritable.sh\n      - t0005-signals.sh\n      - t0006-date.sh\n    start_time: 1280437324\n    stop_time: 1280437326\n\nThe \"extra_properties\" hash is where we'll stick Git-specific info,\nlike whether Git was compiled with gettext or the fallback regex\nengine, and what branch we're compiling. Currently no metadata like\nthis is included.\n\nThe entire tarball is then submitted to a central smokebox at\nsmoke.git.nix.is. This is done with curl(1) via the \"smoke_report\"\ntarget:\n\n    $ make smoke_report\n    curl \\\n                    -H \"Expect: \" \\\n                    -F project=Git \\\n                    -F architecture=x86_64 \\\n                    -F platform=Linux \\\n                    -F revision=\"1.7.2.1.173.gc9b40\" \\\n                    -F report_file=@test-results/git-smoke.tar.gz \\\n                    http://smoke.git.nix.is/app/projects/process_add_report/1 \\\n            | grep -v ^Redirecting\n      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                     Dload  Upload   Total   Spent    Left  Speed\n    100  117k  100    63  100  117k      3   6430  0:00:21  0:00:18  0:00:03     0\n    Reported #8 added.\n\nReports are then made available on the smokebox via a web interface:\n\n    http://smoke.git.nix.is/app/projects/smoke_reports/1\n\nThe smoke reports are also mirrored to a Git repository hosted on\nGitHub:\n\n    http://github.com/gitsmoke/smoke-reports\n\nThe Smolder SQLite database that contains metadata about the reports\nis also made available:\n\n    http://github.com/gitsmoke/smoke-database\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/Makefile |   35 ++++++++++++++++++++++++++++++++++-\n t/harness  |   21 +++++++++++++++++++++\n 2 files changed, 55 insertions(+), 1 deletions(-)\n create mode 100755 t/harness\n\ndiff --git a/t/Makefile b/t/Makefile\nindex 819b936..169097d 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -49,4 +49,37 @@ full-svn-test:\n valgrind:\n \tGIT_TEST_OPTS=--valgrind $(MAKE)\n \n-.PHONY: pre-clean $(T) aggregate-results clean valgrind\n+# Smoke testing targets\n+-include ../GIT-BUILD-OPTIONS\n+-include ../GIT-VERSION-FILE\n+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')\n+uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo unknown')\n+\n+test-results:\n+\tmkdir -p test-results\n+\n+test-results/git-smoke.tar.gz:\n+\t$(PERL_PATH) ./harness \\\n+\t\t--archive=\"test-results/git-smoke.tar.gz\" \\\n+\t\t$(T)\n+\n+smoke: test-results/git-smoke.tar.gz\n+\n+SMOKE_UPLOAD_FLAGS =\n+ifdef SMOKE_USERNAME\n+\tSMOKE_UPLOAD_FLAGS += -F username=$(SMOKE_USERNAME) -F password=$(SMOKE_PASSWORD)\n+endif\n+\n+smoke_report: smoke\n+\tcurl \\\n+\t\t-H \"Expect: \" \\\n+\t\t-F project=Git \\\n+\t\t-F architecture=$(uname_M) \\\n+\t\t-F platform=$(uname_S) \\\n+\t\t-F revision=\"$(GIT_VERSION)\" \\\n+\t\t-F report_file=@test-results/git-smoke.tar.gz \\\n+\t\t$(SMOKE_UPLOAD_FLAGS) \\\n+\t\thttp://smoke.git.nix.is/app/projects/process_add_report/1 \\\n+\t| grep -v ^Redirecting\n+\n+.PHONY: pre-clean $(T) aggregate-results clean valgrind smoke smoke_report\ndiff --git a/t/harness b/t/harness\nnew file mode 100755\nindex 0000000..f5c02f4\n--- /dev/null\n+++ b/t/harness\n@@ -0,0 +1,21 @@\n+#!/usr/bin/perl\n+use strict;\n+use warnings;\n+use Getopt::Long ();\n+use TAP::Harness::Archive;\n+\n+Getopt::Long::Parser->new(\n+\tconfig => [ qw/ pass_through / ],\n+)->getoptions(\n+\t'jobs:1'    => \\(my $jobs = $ENV{TEST_JOBS}),\n+\t'archive=s' => \\my $archive,\n+) or die \"$0: Couldn't getoptions()\";\n+\n+TAP::Harness::Archive->new({\n+\tjobs             => $jobs,\n+\tarchive          => $archive,\n+\t($ENV{GIT_TEST_OPTS}\n+\t ? (test_args    => [ split /\\s+/, $ENV{GIT_TEST_OPTS} ])\n+\t : ()),\n+\textra_properties => {},\n+})->runtests(@ARGV);\n-- \n1.7.1\n"},{"id":"146806","messageId":"1280529807-23677-3-git-send-email-avarab@gmail.com","threadId":"24586","inReplyTo":"1280529807-23677-1-git-send-email-avarab@gmail.com","subject":"[PATCH/RFC v2 2/2] t/README: Document the Smoke testing","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-30T22:43:27Z","receivedAt":"2010-07-30T22:43:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Git now has a smoke testing service at http://smoke.git.nix.is that\nanyone can send reports to. Change the t/README file to mention this.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/README |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 66 insertions(+), 0 deletions(-)\n\ndiff --git a/t/README b/t/README\nindex e957d4f..48418e9 100644\n--- a/t/README\n+++ b/t/README\n@@ -574,3 +574,69 @@ Then, at the top-level:\n That'll generate a detailed cover report in the \"cover_db_html\"\n directory, which you can then copy to a webserver, or inspect locally\n in a browser.\n+\n+Smoke testing\n+-------------\n+\n+The Git test suite has support for smoke testing. Smoke testing is\n+when you submit the results of a test run to a central sever for\n+analysis and aggregation.\n+\n+Running a smoke tester is an easy and valuable way of contributing to\n+Git development, particularly if you have access to an uncommon OS on\n+obscure hardware.\n+\n+After building Git you can generate a smoke report like this in the\n+\"t\" directory:\n+\n+    make clean smoke\n+\n+You can also pass arguments via the environment. This should make it\n+faster:\n+\n+    GIT_TEST_OPTS='--root=/dev/shm' TEST_JOBS=10 make clean smoke\n+\n+The \"smoke\" target will run the Git test suite with Perl's\n+\"TAP::Harness\" module, and package up the results in a .tar.gz archive\n+with \"TAP::Harness::Archive\". The former is included with Perl v5.10.1\n+or later, but you'll need to install the latter from the CPAN. See the\n+\"Test coverage\" section above for how you might do that.\n+\n+Once the \"smoke\" target finishes you'll see a message like this:\n+\n+    TAP Archive created at <path to git>/t/test-results/git-smoke.tar.gz\n+\n+To upload the smoke report you need to have curl(1) installed, then\n+do:\n+\n+    make smoke_report\n+\n+To upload the report anonymously. Hopefully that'll return something\n+like \"Reported #7 added.\".\n+\n+If you're going to be uploading reports frequently please request a\n+user account by E-Mailing gitsmoke@v.nix.is. Once you have a username\n+and password you'll be able to do:\n+\n+    SMOKE_USERNAME=<username> SMOKE_PASSWORD=<password> make smoke_report\n+\n+Once the report is uploaded it'll be made available at\n+http://smoke.git.nix.is, here's an overview of Recent Smoke Reports\n+for Git:\n+\n+    http://smoke.git.nix.is/app/projects/smoke_reports/1\n+\n+The reports will also be mirrored to GitHub every few hours:\n+\n+    http://github.com/gitsmoke/smoke-reports\n+\n+The Smolder SQLite database is also mirrored and made available for\n+download:\n+\n+    http://github.com/gitsmoke/smoke-database\n+\n+Note that the database includes hashed (with crypt()) user passwords\n+and E-Mail addresses. Don't use a valuable password for the smoke\n+service if you have an account, or an E-Mail address you don't want to\n+be publicly known. The user accounts are just meant to be convenient\n+labels, they're not meant to be secure.\n-- \n1.7.1\n"}]}