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.051'; |
6
|
2
|
|
|
2
|
|
516
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
7
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
58
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Carp qw{confess cluck}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
125
|
|
10
|
2
|
|
|
2
|
|
15
|
use Scalar::Util qw{blessed}; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
115
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
1088
|
use TestRail::Utils::Find; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
346
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub bulkMarkResults { |
15
|
2
|
|
|
2
|
1
|
48
|
my ( $opts, $tr ) = @_; |
16
|
2
|
50
|
|
|
|
15
|
confess("TestRail handle must be provided as argument 2") |
17
|
|
|
|
|
|
|
unless blessed($tr) eq 'TestRail::API'; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
10
|
my ( $cases, $run ) = TestRail::Utils::Find::getTests( $opts, $tr ); |
20
|
2
|
50
|
|
|
|
9
|
die "No cases in TestRail to mark!\n" unless $cases; |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
13
|
my ($status_id) = $tr->statusNamesToIds( $opts->{'set_status_to'} ); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
@$cases = map { |
25
|
2
|
|
|
|
|
33
|
{ |
26
|
|
|
|
|
|
|
'test_id' => $_->{'id'}, |
27
|
|
|
|
|
|
|
'status_id' => $status_id, |
28
|
|
|
|
|
|
|
'comment' => $opts->{'reason'}, |
29
|
2
|
|
|
|
|
20
|
'version' => $opts->{'version'} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} @$cases; |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
|
|
13
|
return $tr->bulkAddResults( $run->{'id'}, $cases ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |