line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SmokeRunner::Multi::Reporter::Smolder; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
#ABSTRACT: Reports test runs to a Smolder installation |
4
|
|
|
|
|
|
|
$SmokeRunner::Multi::Reporter::Smolder::VERSION = '0.21'; |
5
|
1
|
|
|
1
|
|
21496
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use base 'SmokeRunner::Multi::Reporter'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
690
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
1243
|
use File::Temp qw( tempdir ); |
|
1
|
|
|
|
|
24910
|
|
|
1
|
|
|
|
|
93
|
|
11
|
1
|
|
|
1
|
|
718
|
use File::Which qw( which ); |
|
1
|
|
|
|
|
876
|
|
|
1
|
|
|
|
|
62
|
|
12
|
1
|
|
|
1
|
|
660
|
use SmokeRunner::Multi::SafeRun qw( safe_run ); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
64
|
|
13
|
1
|
|
|
1
|
|
757
|
use YAML::Syck qw( Dump ); |
|
1
|
|
|
|
|
2112
|
|
|
1
|
|
|
|
|
380
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @SmolderKeys = qw( server username password ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new |
19
|
|
|
|
|
|
|
{ |
20
|
4
|
|
|
4
|
1
|
1389
|
my $class = shift; |
21
|
|
|
|
|
|
|
|
22
|
4
|
|
|
|
|
59
|
my $self = $class->SUPER::new(@_); |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
24
|
$DB::single = 1; |
25
|
4
|
|
|
|
|
71
|
my $smolder_config = SmokeRunner::Multi::Config->instance()->smolder(); |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
270
|
for my $k (@SmolderKeys) |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
die "No config item for smolder $k in config" |
30
|
10
|
100
|
|
|
|
90
|
unless $smolder_config->{$k}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
3
|
100
|
|
|
|
32
|
die "Runner must be a TAPArchive runner" |
34
|
|
|
|
|
|
|
unless $self->runner()->isa('SmokeRunner::Multi::Runner::TAPArchive'); |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
|
|
52
|
$self->{smolder} = $smolder_config; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
10
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub report |
42
|
|
|
|
|
|
|
{ |
43
|
1
|
|
|
1
|
1
|
41
|
my $self = shift; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
2
|
my @params; |
46
|
1
|
|
|
|
|
7
|
for my $k (@SmolderKeys) |
47
|
|
|
|
|
|
|
{ |
48
|
3
|
|
|
|
|
10
|
push @params, '--' . $k; |
49
|
3
|
|
|
|
|
29
|
push @params, $self->{smolder}->{$k}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
1
|
|
|
|
|
11
|
push @params, '--project', $self->runner()->set()->name(); |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
35
|
my $file = $self->runner()->tap_archive_file(); |
55
|
1
|
|
|
|
|
14
|
push @params, '--file', $file; |
56
|
|
|
|
|
|
|
|
57
|
1
|
|
|
|
|
5
|
my $stderr_buffer; |
58
|
|
|
|
|
|
|
my $stdout_buffer; |
59
|
1
|
|
|
|
|
7
|
safe_run |
60
|
|
|
|
|
|
|
( command => 'smolder_smoke_signal', |
61
|
|
|
|
|
|
|
args => \@params, |
62
|
|
|
|
|
|
|
stdout_buffer => \$stdout_buffer, |
63
|
|
|
|
|
|
|
stderr_buffer => \$stderr_buffer, |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
1
|
50
|
33
|
|
|
18
|
die "Error running smolder_smoke_signal:\n$stderr_buffer\n" |
67
|
|
|
|
|
|
|
if defined $stderr_buffer && length $stderr_buffer; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |