line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# PODNAME: TestRail::Utils::Results |
2
|
|
|
|
|
|
|
# ABSTRACT: Perform batch operations on test results, and analyze the same. |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package TestRail::Utils::Results; |
5
|
|
|
|
|
|
|
$TestRail::Utils::Results::VERSION = '0.052'; |
6
|
2
|
|
|
2
|
|
458
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
54
|
|
7
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
9
|
use Carp qw{confess cluck}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
97
|
|
10
|
2
|
|
|
2
|
|
11
|
use Scalar::Util qw{blessed}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
105
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
899
|
use TestRail::Utils::Find; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
306
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub bulkMarkResults { |
15
|
2
|
|
|
2
|
1
|
46
|
my ( $opts, $tr ) = @_; |
16
|
2
|
50
|
|
|
|
14
|
confess("TestRail handle must be provided as argument 2") |
17
|
|
|
|
|
|
|
unless blessed($tr) eq 'TestRail::API'; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
14
|
my ( $cases, $run ) = TestRail::Utils::Find::getTests( $opts, $tr ); |
20
|
2
|
50
|
|
|
|
8
|
die "No cases in TestRail to mark!\n" unless $cases; |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
15
|
my ($status_id) = $tr->statusNamesToIds( $opts->{'set_status_to'} ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
@$cases = map { |
25
|
2
|
|
|
|
|
27
|
{ |
26
|
|
|
|
|
|
|
'test_id' => $_->{'id'}, |
27
|
|
|
|
|
|
|
'status_id' => $status_id, |
28
|
|
|
|
|
|
|
'comment' => $opts->{'reason'}, |
29
|
2
|
|
|
|
|
21
|
'version' => $opts->{'version'} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} @$cases; |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
|
|
13
|
return $tr->bulkAddResults( $run->{'id'}, $cases ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |