|
@@ -10,7 +10,7 @@ use Scalar::Util qw{reftype};
|
|
|
use TestRail::API;
|
|
use TestRail::API;
|
|
|
use Test::LWP::UserAgent::TestRailMock;
|
|
use Test::LWP::UserAgent::TestRailMock;
|
|
|
use Test::Rail::Parser;
|
|
use Test::Rail::Parser;
|
|
|
-use Test::More 'tests' => 99;
|
|
|
|
|
|
|
+use Test::More 'tests' => 103;
|
|
|
use Test::Fatal qw{exception};
|
|
use Test::Fatal qw{exception};
|
|
|
|
|
|
|
|
#Same song and dance as in TestRail-API.t
|
|
#Same song and dance as in TestRail-API.t
|
|
@@ -369,7 +369,7 @@ isa_ok($tap,"Test::Rail::Parser");
|
|
|
if (!$res) {
|
|
if (!$res) {
|
|
|
$tap->run();
|
|
$tap->run();
|
|
|
is($tap->{'errors'},0,"No errors encountered uploading case results");
|
|
is($tap->{'errors'},0,"No errors encountered uploading case results");
|
|
|
- is($tap->{'global_status'},4, "Test global result is FAIL on todo pass test w/ bad plan");
|
|
|
|
|
|
|
+ is($tap->{'global_status'},4, "Test global result is retest when insta-bombout occurs");
|
|
|
my $srs = $tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'};
|
|
my $srs = $tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'};
|
|
|
is($srs->[-1]->{'content'},"Bad Plan.","Bad plan noted in step results");
|
|
is($srs->[-1]->{'content'},"Bad Plan.","Bad plan noted in step results");
|
|
|
}
|
|
}
|
|
@@ -394,7 +394,7 @@ isa_ok($tap,"Test::Rail::Parser");
|
|
|
if (!$res) {
|
|
if (!$res) {
|
|
|
$tap->run();
|
|
$tap->run();
|
|
|
is($tap->{'errors'},0,"No errors encountered uploading case results");
|
|
is($tap->{'errors'},0,"No errors encountered uploading case results");
|
|
|
- is($tap->{'global_status'},7, "Test global result is FAIL on todo pass test w/ bad plan");
|
|
|
|
|
|
|
+ is($tap->{'global_status'},7, "Test global result is respected when using global status override");
|
|
|
}
|
|
}
|
|
|
undef $opts->{'tap'};
|
|
undef $opts->{'tap'};
|
|
|
|
|
|
|
@@ -491,3 +491,25 @@ like($res,qr/run provided is completed/i,"TR Parser explodes on instantiation du
|
|
|
$opts->{'testsuite_id'} = 9;
|
|
$opts->{'testsuite_id'} = 9;
|
|
|
$res = exception { $tap = Test::Rail::Parser->new($opts) };
|
|
$res = exception { $tap = Test::Rail::Parser->new($opts) };
|
|
|
is($res,undef,"TR Parser runs all the way through on completed run when spawning");
|
|
is($res,undef,"TR Parser runs all the way through on completed run when spawning");
|
|
|
|
|
+
|
|
|
|
|
+$fcontents = "
|
|
|
|
|
+todo_pass.test ..
|
|
|
|
|
+1..2
|
|
|
|
|
+ok 1 - STORAGE TANKS SEARED #TODO todo pass
|
|
|
|
|
+# goo
|
|
|
|
|
+Bail out! #YOLO
|
|
|
|
|
+";
|
|
|
|
|
+undef $opts->{'source'};
|
|
|
|
|
+$opts->{'tap'} = $fcontents;
|
|
|
|
|
+$opts->{'step_results'} = 'step_results';
|
|
|
|
|
+undef $opts->{'case_per_ok'};
|
|
|
|
|
+$res = exception { $tap = Test::Rail::Parser->new($opts) };
|
|
|
|
|
+is($res,undef,"TR Parser runs all the way through on bailout");
|
|
|
|
|
+
|
|
|
|
|
+if (!$res) {
|
|
|
|
|
+ $tap->run();
|
|
|
|
|
+ is($tap->{'errors'},0,"No errors encountered uploading case results");
|
|
|
|
|
+ is($tap->{'global_status'},5, "Test global result is FAIL on todo pass test w/ bailout");
|
|
|
|
|
+ my $srs = $tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'};
|
|
|
|
|
+ is($srs->[-1]->{'content'},"Bail Out!.","Bailout noted in step results");
|
|
|
|
|
+}
|