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