line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Reports::Web::Controller::Tapper::Testruns::Id; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
3
|
|
|
|
|
|
|
$Tapper::Reports::Web::Controller::Tapper::Testruns::Id::VERSION = '5.0.15'; |
4
|
11
|
|
|
11
|
|
6268
|
use 5.010; |
|
11
|
|
|
|
|
43
|
|
5
|
|
|
|
|
|
|
|
6
|
11
|
|
|
11
|
|
66
|
use strict; |
|
11
|
|
|
|
|
27
|
|
|
11
|
|
|
|
|
244
|
|
7
|
11
|
|
|
11
|
|
57
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
312
|
|
8
|
11
|
|
|
11
|
|
60
|
use Tapper::Model 'model'; |
|
11
|
|
|
|
|
31
|
|
|
11
|
|
|
|
|
527
|
|
9
|
11
|
|
|
11
|
|
70
|
use Tapper::Reports::Web::Util::Report; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
244
|
|
10
|
11
|
|
|
11
|
|
60
|
use YAML::Syck; |
|
11
|
|
|
|
|
36
|
|
|
11
|
|
|
|
|
771
|
|
11
|
|
|
|
|
|
|
|
12
|
11
|
|
|
11
|
|
106
|
use parent 'Tapper::Reports::Web::Controller::Base'; |
|
11
|
|
|
|
|
30
|
|
|
11
|
|
|
|
|
94
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub auto :Private |
16
|
|
|
|
|
|
|
{ |
17
|
2
|
|
|
2
|
|
1136
|
my ( $self, $c ) = @_; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
23
|
$c->forward('/tapper/testruns/id/prepare_navi'); |
20
|
11
|
|
|
11
|
|
1292
|
} |
|
11
|
|
|
|
|
43
|
|
|
11
|
|
|
|
|
84
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub index :Path :Args(1) |
24
|
|
|
|
|
|
|
{ |
25
|
2
|
|
|
2
|
0
|
3483
|
my ( $self, $c, $testrun_id ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
13
|
$c->stash->{reportlist_rgt} = {}; |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
142
|
eval { |
30
|
2
|
|
|
|
|
11
|
$c->stash->{testrun} = $c->model('TestrunDB')->resultset('Testrun')->find($testrun_id); |
31
|
|
|
|
|
|
|
}; |
32
|
2
|
100
|
66
|
|
|
8774
|
if ($@ or not $c->stash->{testrun}) { |
33
|
1
|
|
|
|
|
133
|
$c->response->body(qq(No testrun with id "$testrun_id" found in the database!)); |
34
|
1
|
|
|
|
|
47
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
1
|
50
|
|
|
|
109
|
return unless $c->stash->{testrun}->testrun_scheduling; |
38
|
|
|
|
|
|
|
|
39
|
1
|
50
|
50
|
|
|
4083
|
$c->stash->{time} = $c->stash->{testrun}->starttime_testrun ? "started at ".$c->stash->{testrun}->starttime_testrun : $c->stash->{testrun}->testrun_scheduling->status." // ".($c->stash->{testrun}->starttime_earliest || ''); |
40
|
1
|
50
|
|
|
|
1335
|
$c->stash->{hostname} = $c->stash->{testrun}->testrun_scheduling->host ? $c->stash->{testrun}->testrun_scheduling->host->name : "unknown"; |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
5873
|
$c->stash->{title} = "Testrun $testrun_id: ". $c->stash->{testrun}->topic_name . " @ ".$c->stash->{hostname}; |
43
|
1
|
|
|
|
|
255
|
$c->stash->{overview} = $c->forward('/tapper/testruns/get_testrun_overview', [ $c->stash->{testrun} ]); |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
269
|
my @preconditions_hash = map { $_->precondition_as_hash } $c->stash->{testrun}->ordered_preconditions; |
|
2
|
|
|
|
|
27300
|
|
46
|
1
|
|
|
|
|
67
|
$YAML::Syck::SortKeys = 1; |
47
|
1
|
|
|
|
|
60
|
$c->stash->{precondition_string} = YAML::Syck::Dump(@preconditions_hash); |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
163
|
my $rgt_reports = $c->model('TestrunDB')->resultset('Report')->search |
50
|
|
|
|
|
|
|
( |
51
|
|
|
|
|
|
|
{ |
52
|
|
|
|
|
|
|
"reportgrouptestrun.testrun_id" => $testrun_id |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
{ order_by => 'me.id desc', |
55
|
|
|
|
|
|
|
join => [ 'reportgrouptestrun', 'suite'], |
56
|
|
|
|
|
|
|
'+select' => [ 'reportgrouptestrun.testrun_id', 'reportgrouptestrun.primaryreport', 'suite.name', 'suite.type', 'suite.description' ], |
57
|
|
|
|
|
|
|
'+as' => [ 'rgt_id', 'rgt_primary', 'suite_name', 'suite_type', 'suite_description' ], |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
); |
60
|
1
|
|
|
|
|
1141
|
my $util_report = Tapper::Reports::Web::Util::Report->new(); |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
|
|
520
|
$c->stash->{reportlist_rgt} = $util_report->prepare_simple_reportlist($c, $rgt_reports); |
63
|
1
|
|
|
|
|
90
|
$c->stash->{report} = $c->model('TestrunDB')->resultset('Report')->search |
64
|
|
|
|
|
|
|
( |
65
|
|
|
|
|
|
|
{ |
66
|
|
|
|
|
|
|
"reportgrouptestrun.primaryreport" => 1, |
67
|
|
|
|
|
|
|
}, |
68
|
|
|
|
|
|
|
{ |
69
|
|
|
|
|
|
|
join => [ 'reportgrouptestrun', ] |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
); |
72
|
11
|
|
|
11
|
|
135523
|
} |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
60
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub prepare_navi : Private |
75
|
|
|
|
|
|
|
{ |
76
|
2
|
|
|
2
|
0
|
1138
|
my ( $self, $c, $testrun_id ) = @_; |
77
|
|
|
|
|
|
|
|
78
|
2
|
|
|
|
|
7
|
my $tr; |
79
|
|
|
|
|
|
|
my $job; |
80
|
2
|
|
|
|
|
7
|
my $status = 'undefined'; |
81
|
2
|
|
|
|
|
27
|
$tr = $c->model('TestrunDB')->resultset('Testrun')->find($testrun_id); |
82
|
2
|
100
|
|
|
|
71173
|
$job = $tr->testrun_scheduling if $tr; |
83
|
2
|
100
|
|
|
|
5743
|
$status = $job->status if $job; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
$c->stash->{navi} =[ |
86
|
|
|
|
|
|
|
{ |
87
|
2
|
50
|
|
|
|
1123
|
title => "Testruns by date", |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
88
|
|
|
|
|
|
|
href => "/tapper/testruns/days/2", |
89
|
|
|
|
|
|
|
active => 0, |
90
|
|
|
|
|
|
|
subnavi => [ |
91
|
|
|
|
|
|
|
{ |
92
|
|
|
|
|
|
|
title => "today", |
93
|
|
|
|
|
|
|
href => "/tapper/testruns/days/1", |
94
|
|
|
|
|
|
|
}, |
95
|
|
|
|
|
|
|
{ |
96
|
|
|
|
|
|
|
title => "1 week", |
97
|
|
|
|
|
|
|
href => "/tapper/testruns/days/7", |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
{ |
100
|
|
|
|
|
|
|
title => "2 weeks", |
101
|
|
|
|
|
|
|
href => "/tapper/testruns/days/14", |
102
|
|
|
|
|
|
|
}, |
103
|
|
|
|
|
|
|
{ |
104
|
|
|
|
|
|
|
title => "3 weeks", |
105
|
|
|
|
|
|
|
href => "/tapper/testruns/days/21", |
106
|
|
|
|
|
|
|
}, |
107
|
|
|
|
|
|
|
{ |
108
|
|
|
|
|
|
|
title => "1 month", |
109
|
|
|
|
|
|
|
href => "/tapper/testruns/days/30", |
110
|
|
|
|
|
|
|
}, |
111
|
|
|
|
|
|
|
{ |
112
|
|
|
|
|
|
|
title => "2 months", |
113
|
|
|
|
|
|
|
href => "/tapper/testruns/days/60", |
114
|
|
|
|
|
|
|
}, |
115
|
|
|
|
|
|
|
], |
116
|
|
|
|
|
|
|
}, |
117
|
|
|
|
|
|
|
{ |
118
|
|
|
|
|
|
|
title => "Control", |
119
|
|
|
|
|
|
|
href => "", |
120
|
|
|
|
|
|
|
active => 0, |
121
|
|
|
|
|
|
|
subnavi => [ |
122
|
|
|
|
|
|
|
($status eq 'finished' |
123
|
|
|
|
|
|
|
? { |
124
|
|
|
|
|
|
|
title => "Rerun", |
125
|
|
|
|
|
|
|
href => "/tapper/testruns/$testrun_id/rerun", |
126
|
|
|
|
|
|
|
confirm => 'Do you really want to RERUN this testrun?', |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
: ()), |
129
|
|
|
|
|
|
|
($status =~ /^(running|schedule|prepare)$/ |
130
|
|
|
|
|
|
|
? { |
131
|
|
|
|
|
|
|
title => "Cancel", |
132
|
|
|
|
|
|
|
href => "/tapper/testruns/$testrun_id/cancel", |
133
|
|
|
|
|
|
|
confirm => 'Do you really want to CANCEL this testrun?', |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
: ()), |
136
|
|
|
|
|
|
|
($status eq 'schedule' |
137
|
|
|
|
|
|
|
? { |
138
|
|
|
|
|
|
|
title => "Unschedule", |
139
|
|
|
|
|
|
|
href => "/tapper/testruns/$testrun_id/pause", |
140
|
|
|
|
|
|
|
confirm => 'Do you really want to UNSCHEDULE this testrun?', |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
: ()), |
143
|
|
|
|
|
|
|
($status eq 'prepare' |
144
|
|
|
|
|
|
|
? { |
145
|
|
|
|
|
|
|
title => "Reschedule", |
146
|
|
|
|
|
|
|
href => "/tapper/testruns/$testrun_id/continue", |
147
|
|
|
|
|
|
|
confirm => 'Do you really want to RESCHEDULE this testrun?', |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
: ()), |
150
|
|
|
|
|
|
|
{ |
151
|
|
|
|
|
|
|
title => "Create new testrun", |
152
|
|
|
|
|
|
|
href => "/tapper/testruns/create", |
153
|
|
|
|
|
|
|
}, |
154
|
|
|
|
|
|
|
], |
155
|
|
|
|
|
|
|
}, |
156
|
|
|
|
|
|
|
]; |
157
|
11
|
|
|
11
|
|
13616
|
} |
|
11
|
|
|
|
|
35
|
|
|
11
|
|
|
|
|
141
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
1; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
__END__ |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=pod |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=encoding UTF-8 |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head1 NAME |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Tapper::Reports::Web::Controller::Tapper::Testruns::Id |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head1 AUTHORS |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=over 4 |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item * |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item * |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=back |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
This software is Copyright (c) 2020 by Advanced Micro Devices, Inc.. |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
This is free software, licensed under: |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=cut |