{"thread":{"id":"24669","subject":"[PATCH v2 0/4] Smoke testing for Git","startedAt":"2010-08-08T14:49:23Z","lastAt":"2010-08-08T20:20:20Z","messageCount":6,"participants":["Ævar Arnfjörð Bjarmason","Sverre Rabbelier"],"isPatch":true,"patchVersion":2,"patchTotal":4},"messages":[{"id":"147443","messageId":"1281278967-31376-1-git-send-email-avarab@gmail.com","threadId":"24669","inReplyTo":null,"subject":"[PATCH v2 0/4] Smoke testing for Git","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-08T14:49:23Z","receivedAt":"2010-08-08T14:49:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"v2 of the non-RFC version of the smoke testing for Git series. It goes\non top of Git (due to pu changes in t/README).\n\nChanges since v1:\n\n  * We can't include GIT-BUILD-OPTIONS. Change by Thomas Rast\n\n  * Add SMOKE_{COMMENT,TAGS}= to submit a comment or list of tags with\n    the smoke report. There are examples of this at\n    http://smoke.git.nix.is/app/projects/smoke_reports/1\n\n  * Do --foo=\"$(BAR)\", not --foo=$(BAR) to avoid quoting issues\n\n  * Minor changes not worth noting, like rewording commit messages a\n    bit.\n\nÆvar Arnfjörð Bjarmason (4):\n  tests: Infrastructure for Git smoke testing\n  t/README: Document the Smoke testing\n  t/Makefile: Can't include GIT-BUILD-OPTIONS, it's a .sh\n  t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target\n\n t/Makefile |   41 ++++++++++++++++++++++++++++++++-\n t/README   |   73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n t/harness  |   21 +++++++++++++++++\n 3 files changed, 134 insertions(+), 1 deletions(-)\n create mode 100755 t/harness\n"},{"id":"147444","messageId":"1281278967-31376-2-git-send-email-avarab@gmail.com","threadId":"24669","inReplyTo":"1281278967-31376-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 1/4] tests: Infrastructure for Git smoke testing","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-08T14:49:24Z","receivedAt":"2010-08-08T14:49:24Z","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..d8bf05f 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":"147445","messageId":"1281278967-31376-3-git-send-email-avarab@gmail.com","threadId":"24669","inReplyTo":"1281278967-31376-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 2/4] t/README: Document the Smoke testing","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-08T14:49:25Z","receivedAt":"2010-08-08T14:49:25Z","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..69af05f 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 server 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"},{"id":"147447","messageId":"1281278967-31376-4-git-send-email-avarab@gmail.com","threadId":"24669","inReplyTo":"1281278967-31376-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 3/4] t/Makefile: Can't include GIT-BUILD-OPTIONS, it's a .sh","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-08T14:49:26Z","receivedAt":"2010-08-08T14:49:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change the smoke testing portion of t/Makefile not to include\nGIT-BUILD-OPTIONS. It's a shellscript, not a Makefile snippet, so it\nhad the nasty side-effect of sneaking e.g. SHELL_PATH = '/bin/sh'\n(with quotes) everywhere.\n\nJust add our own PERL_PATH variable as a workaround. The t/Makefile\nalready has e.g. an equivalent SHELL_PATH and TAR option which\nduplicate the definitions in GIT-BUILD-OPTIONS.\n\nReported-by: Thomas Rast <trast@student.ethz.ch>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/Makefile b/t/Makefile\nindex d8bf05f..00f6482 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -8,6 +8,7 @@\n \n #GIT_TEST_OPTS=--verbose --debug\n SHELL_PATH ?= $(SHELL)\n+PERL_PATH ?= /usr/bin/perl\n TAR ?= $(TAR)\n RM ?= rm -f\n \n@@ -50,7 +51,6 @@ valgrind:\n \tGIT_TEST_OPTS=--valgrind $(MAKE)\n \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-- \n1.7.1\n"},{"id":"147446","messageId":"1281278967-31376-5-git-send-email-avarab@gmail.com","threadId":"24669","inReplyTo":"1281278967-31376-1-git-send-email-avarab@gmail.com","subject":"[PATCH v2 4/4] t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-08T14:49:27Z","receivedAt":"2010-08-08T14:49:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"The smoke server supports a free form text field with comments about a\nreport, and a comma delimited list of tags. Change the smoke_report\ntarget to expose this functionality. Now smokers can send more data\nthat explains and categorizes the reports they're submitting.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/Makefile |    6 ++++++\n t/README   |    7 +++++++\n 2 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/t/Makefile b/t/Makefile\nindex 00f6482..b81fb91 100644\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -69,6 +69,12 @@ SMOKE_UPLOAD_FLAGS =\n ifdef SMOKE_USERNAME\n \tSMOKE_UPLOAD_FLAGS += -F username=\"$(SMOKE_USERNAME)\" -F password=\"$(SMOKE_PASSWORD)\"\n endif\n+ifdef SMOKE_COMMENT\n+\tSMOKE_UPLOAD_FLAGS += -F comments=\"$(SMOKE_COMMENT)\"\n+endif\n+ifdef SMOKE_TAGS\n+\tSMOKE_UPLOAD_FLAGS += -F tags=\"$(SMOKE_TAGS)\"\n+endif\n \n smoke_report: smoke\n \tcurl \\\ndiff --git a/t/README b/t/README\nindex 69af05f..9f676d7 100644\n--- a/t/README\n+++ b/t/README\n@@ -620,6 +620,13 @@ and password you'll be able to do:\n \n     SMOKE_USERNAME=<username> SMOKE_PASSWORD=<password> make smoke_report\n \n+You can also add an additional comment to attach to the report, and/or\n+a comma separated list of tags:\n+\n+    SMOKE_USERNAME=<username> SMOKE_PASSWORD=<password> \\\n+        SMOKE_COMMENT=<comment> SMOKE_TAGS=<tags> \\\n+        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-- \n1.7.1\n"},{"id":"147457","messageId":"AANLkTi=+i0a0Sj542=tzKqeGe0CBYA1F=-njc_yObwa8@mail.gmail.com","threadId":"24669","inReplyTo":"1281278967-31376-2-git-send-email-avarab@gmail.com","subject":"Re: [PATCH v2 1/4] tests: Infrastructure for Git smoke testing","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-08-08T20:20:20Z","receivedAt":"2010-08-08T20:20:20Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Aug 8, 2010 at 09:49, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n> +smoke_report: smoke\n> +       curl \\\n> +               -H \"Expect: \" \\\n> +               -F project=Git \\\n> +               -F architecture=\"$(uname_M)\" \\\n> +               -F platform=\"$(uname_S)\" \\\n> +               -F revision=\"$(GIT_VERSION)\" \\\n> +               -F report_file=@test-results/git-smoke.tar.gz \\\n> +               $(SMOKE_UPLOAD_FLAGS) \\\n> +               http://smoke.git.nix.is/app/projects/process_add_report/1 \\\n\nI think at the very least this URL should be given it's own variable\nso that it can be overridden easily.\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}