line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Upload your TAP results to TestRail in realtime |
2
|
|
|
|
|
|
|
# PODNAME: App::Prove::Plugin::TestRail |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package App::Prove::Plugin::TestRail; |
5
|
|
|
|
|
|
|
$App::Prove::Plugin::TestRail::VERSION = '0.050'; |
6
|
1
|
|
|
1
|
|
179489
|
use strict; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
33
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
8
|
1
|
|
|
1
|
|
654
|
use utf8; |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
1216
|
use File::HomeDir qw{my_home}; |
|
1
|
|
|
|
|
5670
|
|
|
1
|
|
|
|
|
66
|
|
11
|
1
|
|
|
1
|
|
466
|
use TestRail::Utils; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
456
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub load { |
14
|
8
|
|
|
8
|
1
|
86110
|
my ( $class, $p ) = @_; |
15
|
|
|
|
|
|
|
|
16
|
8
|
|
|
|
|
39
|
my $app = $p->{app_prove}; |
17
|
8
|
|
|
|
|
28
|
my $args = $p->{'args'}; |
18
|
|
|
|
|
|
|
|
19
|
8
|
|
|
|
|
21
|
my $params = {}; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#Only attempt parse if we aren't mocking and the homedir exists |
22
|
8
|
|
50
|
|
|
98
|
my $homedir = my_home() || '.'; |
23
|
|
|
|
|
|
|
$params = TestRail::Utils::parseConfig($homedir) |
24
|
8
|
50
|
33
|
|
|
766
|
if -e $homedir && !$ENV{'TESTRAIL_MOCKED'}; |
25
|
|
|
|
|
|
|
|
26
|
8
|
|
|
|
|
40
|
my @kvp = (); |
27
|
8
|
|
|
|
|
25
|
my ( $key, $value ); |
28
|
8
|
|
|
|
|
33
|
foreach my $arg (@$args) { |
29
|
64
|
|
|
|
|
203
|
@kvp = split( /=/, $arg ); |
30
|
64
|
50
|
|
|
|
155
|
if ( scalar(@kvp) < 2 ) { |
31
|
0
|
|
|
|
|
0
|
print |
32
|
|
|
|
|
|
|
"Unrecognized Argument '$arg' to App::Prove::Plugin::Testrail, ignoring\n"; |
33
|
0
|
|
|
|
|
0
|
next; |
34
|
|
|
|
|
|
|
} |
35
|
64
|
|
|
|
|
162
|
$key = shift @kvp; |
36
|
64
|
|
|
|
|
194
|
$value = join( '', @kvp ); |
37
|
64
|
|
|
|
|
205
|
$params->{$key} = $value; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
8
|
|
|
|
|
94
|
$app->harness('Test::Rail::Harness'); |
41
|
8
|
|
|
|
|
99
|
$app->merge(1); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#XXX I can't figure out for the life of me any other way to pass this data. #YOLO |
44
|
8
|
|
|
|
|
131
|
$ENV{'TESTRAIL_APIURL'} = $params->{apiurl}; |
45
|
8
|
|
|
|
|
53
|
$ENV{'TESTRAIL_USER'} = $params->{user}; |
46
|
8
|
|
|
|
|
45
|
$ENV{'TESTRAIL_PASS'} = $params->{password}; |
47
|
8
|
|
|
|
|
39
|
$ENV{'TESTRAIL_PROJ'} = $params->{project}; |
48
|
8
|
|
|
|
|
49
|
$ENV{'TESTRAIL_RUN'} = $params->{run}; |
49
|
8
|
|
|
|
|
37
|
$ENV{'TESTRAIL_PLAN'} = $params->{plan}; |
50
|
8
|
|
|
|
|
39
|
$ENV{'TESTRAIL_PLAN_ID'} = $params->{plan_id}; |
51
|
8
|
|
|
|
|
39
|
$ENV{'TESTRAIL_CONFIGS'} = $params->{configs}; |
52
|
8
|
|
|
|
|
36
|
$ENV{'TESTRAIL_VERSION'} = $params->{version}; |
53
|
8
|
|
|
|
|
57
|
$ENV{'TESTRAIL_STEPS'} = $params->{step_results}; |
54
|
8
|
|
|
|
|
48
|
$ENV{'TESTRAIL_SPAWN'} = $params->{testsuite_id}; |
55
|
8
|
|
|
|
|
36
|
$ENV{'TESTRAIL_TESTSUITE'} = $params->{testsuite}; |
56
|
8
|
|
|
|
|
40
|
$ENV{'TESTRAIL_SECTIONS'} = $params->{sections}; |
57
|
8
|
|
|
|
|
34
|
$ENV{'TESTRAIL_AUTOCLOSE'} = $params->{autoclose}; |
58
|
8
|
|
|
|
|
30
|
$ENV{'TESTRAIL_ENCODING'} = $params->{encoding}; |
59
|
8
|
|
|
|
|
30
|
$ENV{'TESTRAIL_CGROUP'} = $params->{'configuration_group'}; |
60
|
8
|
|
|
|
|
30
|
$ENV{'TESTRAIL_TBAD'} = $params->{'test_bad_status'}; |
61
|
8
|
|
|
|
|
32
|
$ENV{'TESTRAIL_MAX_TRIES'} = $params->{'max_tries'}; |
62
|
8
|
|
|
|
|
116
|
return $class; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |