From: Ian Jackson Date: Tue, 30 Jun 2015 13:29:21 +0000 (+0100) Subject: Emails: Provide X-Osstest-Versions-This and That headers X-Git-Tag: wip.libvirt-v3-base~60 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=48a7bf9095ec66d98d90b98770a2dd11d238f7d2;p=people%2Fliuw%2Fosstest.git Emails: Provide X-Osstest-Versions-This and That headers 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 Acked-by: Ian Campbell --- v2: Document This and That --- diff --git a/README.email b/README.email index 3f95fa8..285aa1d 100644 --- a/README.email +++ b/README.email @@ -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. diff --git a/cr-daily-branch b/cr-daily-branch index c7d1071..34b6d2b 100755 --- a/cr-daily-branch +++ b/cr-daily-branch @@ -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] " diff --git a/sg-report-flight b/sg-report-flight index bfc8787..76d6ab7 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -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 $!; } }