« blib/lib/Tapper/Reports/Web/Util/Report.pm
↑ Summary
blib/lib/Tapper/Reports/Web/Controller/Tapper/Testplan.pm »
| 1 | package Tapper::Reports::Web::Util::Testrun; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 15 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 15 | $Tapper::Reports::Web::Util::Testrun::VERSION = '5.0.17'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 15 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 15 | ▶ | use Tapper::Model 'model'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 15 | extends 'Tapper::Reports::Web::Util'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | sub prepare_testrunlist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepare_testrunlist: not called CC=14 SCAR=53.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | my ( $self, $testruns ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | my @testruns; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | foreach my $testrun ($testruns->all) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | my $testrun_report = model('ReportsDB')->resultset('ReportgroupTestrunStats')->search({testrun_id => $testrun->id}, {rows => 1})->first; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my ($primary_report, $suite_name, $updated_at, $primary_report_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if ($testrun_report) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | $primary_report = $testrun_report->reportgrouptestruns->search({primaryreport => 1}, {rows => 1})->first; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | $primary_report = $testrun_report->reportgrouptestruns->search({}, {rows => 1})->first unless $primary_report; # link to any report if no primary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | eval{ # prevent dereferencing to undefined db links | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | if ($primary_report) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | $suite_name = $primary_report->report->suite->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | $updated_at = $primary_report->report->updated_at || $primary_report->created_at; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$primary_report->report->updated_at || $primary_report->created_at
MC/DC0%0/2
$primary_report->report->updated_at || $primary_report->created_at
$primary_report->report->updated_at
$primary_report->created_at
Truth table0%0/3
A || B
A= $primary_report->report->updated_atB= $primary_report->created_at
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | $primary_report_id = $primary_report->report->id; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my ($hostname, $status); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | if ($testrun->testrun_scheduling) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | if ($testrun->testrun_scheduling->host) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | $hostname = $testrun->testrun_scheduling->host->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | $hostname = $testrun->testrun_scheduling->status eq 'finished' ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 'Host deleted' : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 'No host assigned'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | $status = $testrun->testrun_scheduling->status; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | my @resources = $testrun->claimed_resources; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | my @dependencies = $testrun->depending_testruns; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | my $tr = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$hostname || 'unknownmachine'
$status || 'unknown status'
$updated_at || $testrun->updated_at
$testrun->owner->login || 'unknown user'
MC/DC0%0/1
$hostname || 'unknownmachine'
$hostname
MC/DC0%0/1
$status || 'unknown status'
$status
MC/DC0%0/2
$updated_at || $testrun->updated_at
$updated_at
$testrun->updated_at
MC/DC0%0/1
$testrun->owner->login || 'unknown user'
$testrun->owner->login
Truth table0%0/2
A
A= $hostname
Truth table0%0/2
A
A= $status
Truth table0%0/3
A || B
A= $updated_atB= $testrun->updated_at
Truth table0%0/2
A
A= $testrun->owner->login
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | testrun_id => $testrun->id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | success_ratio => $testrun_report ? $testrun_report->success_ratio : 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | primary_report_id => $primary_report_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | topic_name => $testrun->topic_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | machine_name => $hostname || 'unknownmachine', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | status => $status || 'unknown status', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | started_at => $testrun->starttime_testrun, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | created_at => $testrun->created_at, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | updated_at => $updated_at || $testrun->updated_at, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | owner => $testrun->owner->login || 'unknown user' , | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | resources => \@resources, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | dependencies => \@dependencies, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | push @testruns, $tr; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | return \@testruns; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 15 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||