[Bps-public-commit] smokingit-worker branch, full-tap, created. 841e29ffca30a4126c8edcf71cc8d9ffb46ce5c8
Alex Vandiver
alexmv at bestpractical.com
Fri Jun 28 16:56:26 EDT 2013
The branch, full-tap has been created
at 841e29ffca30a4126c8edcf71cc8d9ffb46ce5c8 (commit)
- Log -----------------------------------------------------------------
commit e931e8f73ba7fefad8a167428e1fe82aa47f8eba
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Jun 21 11:01:58 2013 -0700
Store raw TAP output rather than the aggregator
The aggregator object does not capture the full output of the tests,
merely the ok/nok status of each line. For a complete view of what
occurred in the test, instead capture and pass on the raw TAP output.
diff --git a/lib/Smokingit/Worker.pm b/lib/Smokingit/Worker.pm
index 8e98e8e..34e35cc 100644
--- a/lib/Smokingit/Worker.pm
+++ b/lib/Smokingit/Worker.pm
@@ -176,6 +176,14 @@ sub run_tests {
);
$harness->callback(
after_test => sub {
+ my ($job, $parser) = @_;
+ my $filename = $job->[0];
+ $result->{test}{$filename}{is_ok} = not $parser->has_problems;
+ $result->{test}{$filename}{tests_run} = $parser->tests_run;
+ $result->{test}{$filename}{elapsed}
+ = $parser->end_time - $parser->start_time;
+ $result->{start} ||= $parser->start_time;
+ $result->{end} = $parser->end_time;
$self->publish(
smoke_id => $request->{smoke_id},
status => "testing",
@@ -184,19 +192,34 @@ sub run_tests {
);
}
);
+ $harness->callback(
+ parser_args => sub {
+ my ($args, $job) = @_;
+ my $filename = $job->[0];
+ $result->{test}{$filename}{raw_tap} = "";
+ open($args->{spool}, ">", \$result->{test}{$filename}{raw_tap});
+ }
+ );
my $aggregator = eval {
# Runtests apparently grows PERL5LIB -- local it so it doesn't
# grow without bound
local $ENV{PERL5LIB} = $ENV{PERL5LIB};
$harness->runtests(@tests);
} or return $error->("Testing bailed out!\n\n$@");
-
- # Tests were successful! Strip out the iterator coderefs so
- # we can serialize the aggregator, for ease of stats
- # extraction
- $aggregator->{parser_for}{$_}{_iter} = undef
- for keys %{$aggregator->{parser_for}};
- $result->{aggregator} = $aggregator;
+ $result->{is_ok} = not $aggregator->has_problems;
+ $result->{elapsed} = $result->{end} - $result->{start};
+ $result->{$_} = $aggregator->$_ for
+ qw/failed
+ parse_errors
+ passed
+ planned
+ skipped
+ todo
+ todo_passed
+ total
+ wait
+ exit
+ /;
$self->call(
name => "post_results",
commit 841e29ffca30a4126c8edcf71cc8d9ffb46ce5c8
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Jun 28 16:56:19 2013 -0400
Merge STDERR into the raw tap
This requires the diag-merge branch of https://github.com/alexmv/Test-Harness.git
diff --git a/lib/Smokingit/Worker.pm b/lib/Smokingit/Worker.pm
index 34e35cc..7f4c64c 100644
--- a/lib/Smokingit/Worker.pm
+++ b/lib/Smokingit/Worker.pm
@@ -163,9 +163,10 @@ sub run_tests {
my $done = 0;
my @tests = glob($tests);
my $harness = TAP::Harness->new( {
- jobs => $jobs,
- lib => [".", "lib"],
- switches => "-w",
+ jobs => $jobs,
+ lib => [".", "lib"],
+ switches => "-w",
+ diag_merge => 1,
} );
$self->publish(
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list