]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Emails: Provide X-Osstest-Versions-This and That headers
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 30 Jun 2015 13:29:21 +0000 (14:29 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 1 Jul 2015 12:34:49 +0000 (13:34 +0100)
Specifically:
 * Provide headerprint() in sg-report-flight
 * Use it to add X-Osstest-Versions headers based on %specver
 * Cause cr-daily-branch to always enable the feature
 * Document this in README.email

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Document This and That

README.email
cr-daily-branch
sg-report-flight

index 3f95fa89556e43c17f6b91182069694fcafa9ffa..285aa1da74ab9f2cddb93b9f980a03abae69fb6d 100644 (file)
@@ -104,3 +104,19 @@ history.  Here are some examples:
 The flight numbers quoted in these step failure summaries may
 sometimes be suffixed with `-bisect' to show that the indicated flight
 was part of a bisection attempt, rather than a main test flight.
+
+
+Email information headers
+-------------------------
+
+Test report emails sent by osstest have some extra information in the
+email headers, where applicable:
+
+X-Osstest-Versions-This:
+    osstest=cc8b79ce9586d2b0fbddbd4260e876eab1d408d4
+X-Osstest-Versions-That:
+    osstest=280a18b2b2612174e473a1c1a137ddd47c49aab9
+    ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+     tree     revision
+
+`This' is the version being tested, and `That' is the baseline.
index c7d10717d0c1e67e970248eda29ddb8bbc546383..34b6d2bf0535f64c655f591ad0294638db6183e0 100755 (executable)
@@ -246,7 +246,7 @@ $DAILY_BRANCH_POSTMAKE_HOOK
 
 heading=tmp/$flight.heading-info
 : >$heading
-sgr_args+=" --include-begin=$heading"
+sgr_args+=" --info-headers --include-begin=$heading"
 
 if $force_baseline; then
        subject_prefix="[$branch baseline test] "
index bfc87874245a4f97bb20517a5a59948b4fa196b5..76d6ab7643401a09ada1af2a9440b90649b6800a 100755 (executable)
@@ -37,6 +37,7 @@ our %specver;
 our (@blessings, @branches_also);
 our $mro;
 our $htmldir;
+our $want_info_headers;
 our ($branch, $branches_cond_q);
 our @allows;
 our (@includebeginfiles,@includefiles);
@@ -56,6 +57,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
         open MRO, "> $mro.new" or die "$mro.new $!";
     } elsif (m/^--html-dir=(.*)$/) {
         $htmldir= $1;
+    } elsif (m/^--info-headers$/) {
+        $want_info_headers = 1;
     } elsif (m/^--blessings?=(.*)$/) {
         push @blessings, split ',', $1;
     } elsif (m/^--branches-also?=(.*)$/) {
@@ -496,11 +499,18 @@ our $body_text;
 sub bodyprint { $body_text .= $_ foreach @_; }
 sub bodyprintf { my $fmt = shift @_; $body_text .= sprintf $fmt, @_; }
 
+sub headerprint {
+    return unless $want_info_headers;
+    $header_text .= $_ foreach @_;
+}
+
 sub printversions ($) {
     my ($thisthat) = @_;
     my ($sv) = $specver{$thisthat};
+    headerprint "X-Osstest-Versions-\u$thisthat:\n" if %$sv;
     foreach my $k (sort keys %$sv) {
         bodyprintf " %-${tl}s %s\n", $k, $sv->{$k};
+       headerprint "    $k=$sv->{$k}\n";
         print MRO "version $thisthat $k $sv->{$k}\n" or die $!;
     }
 }