Test-Rail-Parser.t 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. use FindBin;
  5. use lib "$FindBin::Bin/lib";
  6. use Scalar::Util qw{reftype};
  7. use TestRail::API;
  8. use Test::LWP::UserAgent::TestRailMock;
  9. use Test::Rail::Parser;
  10. use Test::More 'tests' => 111;
  11. use Test::Fatal qw{exception};
  12. use Test::Deep qw{cmp_deeply};
  13. #Same song and dance as in TestRail-API.t
  14. my $apiurl = $ENV{'TESTRAIL_API_URL'};
  15. my $login = $ENV{'TESTRAIL_USER'};
  16. my $pw = $ENV{'TESTRAIL_PASSWORD'};
  17. my $is_mock = (!$apiurl && !$login && !$pw);
  18. ($apiurl,$login,$pw) = ('http://testrail.local','teodesian@cpan.org','fake') if $is_mock;
  19. my ($debug,$browser);
  20. $debug = 1;
  21. if ($is_mock) {
  22. $browser = $Test::LWP::UserAgent::TestRailMock::mockObject;
  23. }
  24. #test exceptions...
  25. #TODO
  26. #case_per_ok mode
  27. my $fcontents = "
  28. fake.test ..
  29. 1..2
  30. ok 1 - STORAGE TANKS SEARED
  31. #goo
  32. not ok 2 - NOT SO SEARED AFTER ARR
  33. ";
  34. my $tap;
  35. my $opts = {
  36. 'tap' => $fcontents,
  37. 'apiurl' => $apiurl,
  38. 'user' => $login,
  39. 'pass' => $pw,
  40. 'debug' => $debug,
  41. 'browser' => $browser,
  42. 'run' => 'TestingSuite',
  43. 'project' => 'TestProject',
  44. 'merge' => 1,
  45. 'case_per_ok' => 1
  46. };
  47. my $res = exception { $tap = Test::Rail::Parser->new($opts) };
  48. is($res,undef,"TR Parser doesn't explode on instantiation");
  49. isa_ok($tap,"Test::Rail::Parser");
  50. if (!$res) {
  51. $tap->run();
  52. is($tap->{'errors'},0,"No errors encountered uploading case results");
  53. }
  54. undef $tap;
  55. delete $opts->{'tap'};
  56. $opts->{'source'} = 't/fake.test';
  57. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  58. is($res,undef,"TR Parser doesn't explode on instantiation");
  59. isa_ok($tap,"Test::Rail::Parser");
  60. if (!$res) {
  61. $tap->run();
  62. is($tap->{'errors'},0,"No errors encountered uploading case results");
  63. }
  64. $fcontents = "ok 1 - STORAGE TANKS SEARED
  65. # whee
  66. not ok 2 - NOT SO SEARED AFTER ARR
  67. # Failed test 'NOT SO SEARED AFTER ARR'
  68. # at t/fake.test line 10.
  69. # Looks like you failed 1 test of 2.
  70. ";
  71. like($tap->{'raw_output'},qr/SEARED\n# whee.*\n.*AFTER ARR\n\n.*Failed/msxi,"Full raw content uploaded in non step results mode");
  72. #Check that time run is being uploaded
  73. my $timeResults = $tap->{'tr_opts'}->{'testrail'}->getTestResults(1);
  74. if ( ( reftype($timeResults) || 'undef') eq 'ARRAY') {
  75. is( $timeResults->[0]->{'elapsed'}, '2s', "Plugin correctly sets elapsed time");
  76. } else {
  77. fail("Could not get test results to check elapsed time!");
  78. }
  79. #Check the time formatting routine.
  80. is(Test::Rail::Parser::_compute_elapsed(0,0),undef,"Elapsed computation correct at second boundary");
  81. is(Test::Rail::Parser::_compute_elapsed(0,61),'1m 1s',"Elapsed computation correct at minute boundary");
  82. is(Test::Rail::Parser::_compute_elapsed(0,3661),'1h 1m 1s',"Elapsed computation correct at hour boundary");
  83. is(Test::Rail::Parser::_compute_elapsed(0,86461),'24h 1m 1s',"Elapsed computation correct at day boundary");
  84. #Time for non case_per_ok mode
  85. undef $tap;
  86. $opts->{'source'} = 't/faker.test';
  87. $opts->{'run'} = 'OtherOtherSuite';
  88. delete $opts->{'case_per_ok'};
  89. $opts->{'step_results'} = 'step_results';
  90. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  91. is($res,undef,"TR Parser doesn't explode on instantiation");
  92. isa_ok($tap,"Test::Rail::Parser");
  93. if (!$res) {
  94. $tap->run();
  95. is($tap->{'errors'},0,"No errors encountered uploading case results");
  96. is($tap->{'global_status'},5, "Test global result is FAIL when one subtest fails even if there are TODO passes");
  97. subtest 'Timestamp/elapsed printed in step results' => sub {
  98. foreach my $result (@{$tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'}}) {
  99. like($result->{'content'}, qr/^\[.*\(.*\)\]/i, "Timestamp printed in step results");
  100. }
  101. };
  102. }
  103. #Default mode
  104. undef $tap;
  105. delete $opts->{'step_results'};
  106. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  107. is($res,undef,"TR Parser doesn't explode on instantiation");
  108. isa_ok($tap,"Test::Rail::Parser");
  109. if (!$res) {
  110. $tap->run();
  111. is($tap->{'errors'},0,"No errors encountered uploading case results");
  112. my @matches = $tap->{'raw_output'} =~ m/^(\[.*\(.*\)\])/msgi;
  113. ok(scalar(@matches),"Timestamps present in raw TAP");
  114. }
  115. #Default mode
  116. undef $tap;
  117. $fcontents = "
  118. fake.test ..
  119. 1..2
  120. ok 1 - STORAGE TANKS SEARED
  121. #Subtest NOT SO SEARED AFTER ARR
  122. ok 1 - STROGGIFY POPULATION CENTERS
  123. not ok 2 - STROGGIFY POPULATION CENTERS
  124. #goo
  125. not ok 2 - NOT SO SEARED AFTER ARR
  126. ";
  127. $opts->{'tap'} = $fcontents;
  128. delete $opts->{'source'};
  129. delete $opts->{'step_results'};
  130. $opts->{'run'} = 'TestingSuite';
  131. $opts->{'case_per_ok'} = 1;
  132. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  133. is($res,undef,"TR Parser doesn't explode on instantiation");
  134. isa_ok($tap,"Test::Rail::Parser");
  135. if (!$res) {
  136. $tap->run();
  137. is($tap->{'errors'},0,"No errors encountered uploading case results");
  138. }
  139. #skip/todo in case_per_ok
  140. undef $tap;
  141. delete $opts->{'tap'};
  142. $opts->{'source'} = 't/skip.test';
  143. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  144. is($res,undef,"TR Parser doesn't explode on instantiation");
  145. isa_ok($tap,"Test::Rail::Parser");
  146. if (!$res) {
  147. $tap->run();
  148. is($tap->{'errors'},0,"No errors encountered uploading case results");
  149. }
  150. #Default mode skip (skip_all)
  151. undef $tap;
  152. $opts->{'source'} = 't/skipall.test';
  153. delete $opts->{'case_per_ok'};
  154. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  155. is($res,undef,"TR Parser doesn't explode on instantiation");
  156. isa_ok($tap,"Test::Rail::Parser");
  157. if (!$res) {
  158. $tap->run();
  159. is($tap->{'errors'},0,"No errors encountered uploading case results");
  160. is($tap->{'global_status'},6, "Test global result is SKIP on skip all");
  161. }
  162. #Ok, let's test the plan, config, and spawn bits.
  163. undef $tap;
  164. $opts->{'run'} = 'hoo hoo I do not exist';
  165. $opts->{'plan'} = 'mah dubz plan';
  166. $opts->{'configs'} = ['testPlatform1'];
  167. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  168. isnt($res,undef,"TR Parser explodes on instantiation when asking for run not in plan");
  169. undef $tap;
  170. $opts->{'run'} = 'TestingSuite';
  171. $opts->{'configs'} = ['testConfig'];
  172. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  173. is($res,undef,"TR Parser doesn't explode on instantiation looking for existing run in plan");
  174. isa_ok($tap,"Test::Rail::Parser");
  175. if (!$res) {
  176. $tap->run();
  177. is($tap->{'errors'},0,"No errors encountered uploading case results");
  178. }
  179. #Now, test spawning.
  180. undef $tap;
  181. $opts->{'run'} = 'TestingSuite2';
  182. $opts->{'configs'} = ['testPlatform1'];
  183. $opts->{'testsuite_id'} = 9;
  184. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  185. is($res,undef,"TR Parser doesn't explode on instantiation when spawning run in plan");
  186. isa_ok($tap,"Test::Rail::Parser");
  187. if (!$res) {
  188. $tap->run();
  189. is($tap->{'errors'},0,"No errors encountered uploading case results");
  190. }
  191. #Test spawning of builds not in plans.
  192. #Now, test spawning.
  193. undef $tap;
  194. delete $opts->{'testsuite_id'};
  195. delete $opts->{'plan'};
  196. delete $opts->{'configs'};
  197. $opts->{'testsuite'} = 'HAMBURGER-IZE HUMANITY';
  198. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  199. is($res,undef,"TR Parser doesn't explode on instantiation when spawning run in plan");
  200. isa_ok($tap,"Test::Rail::Parser");
  201. if (!$res) {
  202. $tap->run();
  203. is($tap->{'errors'},0,"No errors encountered uploading case results");
  204. }
  205. #Test spawning of plans and runs.
  206. undef $tap;
  207. $opts->{'run'} = 'BogoRun';
  208. $opts->{'plan'} = 'BogoPlan';
  209. $opts->{'testsuite_id'} = 9;
  210. delete $opts->{'testsuite'};
  211. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  212. is($res,undef,"TR Parser doesn't explode on instantiation when spawning run in plan");
  213. isa_ok($tap,"Test::Rail::Parser");
  214. if (!$res) {
  215. $tap->run();
  216. is($tap->{'errors'},0,"No errors encountered uploading case results");
  217. }
  218. #Verify that case_per_ok and step_results are mutually exclusive, and die.
  219. undef $tap;
  220. $opts->{'case_per_ok'} = 1;
  221. $opts->{'step_results'} = 'sr_step_results';
  222. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  223. isnt($res,undef,"TR Parser explodes on instantiation when mutually exclusive options are passed");
  224. #Check that per-section spawn works
  225. undef $tap;
  226. $opts->{'source'} = 't/fake.test';
  227. delete $opts->{'plan'};
  228. $opts->{'sections'} = ['fake.test'];
  229. delete $opts->{'step_results'};
  230. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  231. is($res,undef,"TR Parser doesn't explode on instantiation");
  232. isa_ok($tap,"Test::Rail::Parser");
  233. if (!$res) {
  234. $tap->run();
  235. is($tap->{'errors'},0,"No errors encountered uploading case results");
  236. }
  237. #Check that per-section spawn works
  238. undef $tap;
  239. $opts->{'plan'} = 'BogoPlan';
  240. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  241. is($res,undef,"TR Parser doesn't explode on instantiation");
  242. isa_ok($tap,"Test::Rail::Parser");
  243. if (!$res) {
  244. $tap->run();
  245. is($tap->{'errors'},0,"No errors encountered uploading case results");
  246. }
  247. undef $tap;
  248. $opts->{'sections'} = ['potzrebie'];
  249. delete $opts->{'plan'};
  250. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  251. isnt($res,undef,"TR Parser explodes on instantiation with invalid section");
  252. undef $tap;
  253. $opts->{'source'} = 't/notests.test';
  254. delete $opts->{'sections'};
  255. delete $opts->{'case_per_ok'};
  256. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  257. is($res,undef,"TR Parser doesn't explode on instantiation");
  258. isa_ok($tap,"Test::Rail::Parser");
  259. if (!$res) {
  260. $tap->run();
  261. is($tap->{'errors'},0,"No errors encountered uploading case results");
  262. is($tap->{'global_status'},4, "Test global result is RETEST on env fail");
  263. }
  264. undef $tap;
  265. $opts->{'source'} = 't/pass.test';
  266. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  267. is($res,undef,"TR Parser doesn't explode on instantiation");
  268. isa_ok($tap,"Test::Rail::Parser");
  269. if (!$res) {
  270. $tap->run();
  271. is($tap->{'errors'},0,"No errors encountered uploading case results");
  272. is($tap->{'global_status'},1, "Test global result is PASS on ok test");
  273. }
  274. undef $tap;
  275. $opts->{'source'} = 't/todo_pass.test';
  276. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  277. is($res,undef,"TR Parser doesn't explode on instantiation");
  278. isa_ok($tap,"Test::Rail::Parser");
  279. if (!$res) {
  280. $tap->run();
  281. is($tap->{'errors'},0,"No errors encountered uploading case results");
  282. is($tap->{'global_status'},8, "Test global result is TODO PASS on todo pass test");
  283. }
  284. undef $tap;
  285. $opts->{'source'} = 't/todo_pass_and_fail.test';
  286. $opts->{'step_results'} = 'step_results';
  287. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  288. is($res,undef,"TR Parser doesn't explode on instantiation");
  289. isa_ok($tap,"Test::Rail::Parser");
  290. if (!$res) {
  291. $tap->run();
  292. is($tap->{'errors'},1,"Errors encountered uploading case results for case that does not exist in TestRail");
  293. is($tap->{'global_status'},7, "Test global result is TODO FAIL on todo pass & fail test");
  294. my @desired_statuses = qw{1 8 7};
  295. my @got_statuses = map {$_->{'status_id'}} @{$tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'}};
  296. my @desired_expected = ('OK', 'OK', 'OK');
  297. my @got_expected = map {$_->{'expected'}} @{$tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'}};
  298. my @desired_actual = ('OK', 'TODO PASS', 'TODO FAIL');
  299. my @got_actual = map {$_->{'actual'}} @{$tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'}};
  300. cmp_deeply(\@got_expected,\@desired_expected,"Expected status names look OK");
  301. cmp_deeply(\@got_actual,\@desired_actual,"Actual status names look OK");
  302. cmp_deeply(\@got_statuses,\@desired_statuses,"Step result status codes set correctly");
  303. like($tap->{'tr_opts'}->{'test_notes'},qr/ez duz it/i,"TODO reason captured in test notes");
  304. }
  305. undef $opts->{'step_results'};
  306. undef $tap;
  307. #Check bad plan w/ todo pass logic
  308. $fcontents = "
  309. todo_pass.test ..
  310. 1..2
  311. ok 1 - STORAGE TANKS SEARED #TODO todo pass
  312. # goo
  313. ";
  314. undef $opts->{'source'};
  315. $opts->{'tap'} = $fcontents;
  316. $opts->{'step_results'} = 'step_results';
  317. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  318. is($res,undef,"TR Parser doesn't explode on instantiation");
  319. isa_ok($tap,"Test::Rail::Parser");
  320. if (!$res) {
  321. $tap->run();
  322. is($tap->{'errors'},0,"No errors encountered uploading case results");
  323. is($tap->{'global_status'},5, "Test global result is FAIL on todo pass test w/ bad plan");
  324. my $srs = $tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'};
  325. is($srs->[-1]->{'content'},"Bad Plan.","Bad plan noted in step results");
  326. }
  327. undef $opts->{'step_results'};
  328. #Check instant pizza
  329. $fcontents = "
  330. todo_pass.test ..
  331. 1..2
  332. ";
  333. undef $opts->{'source'};
  334. $opts->{'tap'} = $fcontents;
  335. $opts->{'step_results'} = 'step_results';
  336. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  337. is($res,undef,"TR Parser doesn't explode on instantiation");
  338. isa_ok($tap,"Test::Rail::Parser");
  339. if (!$res) {
  340. $tap->run();
  341. is($tap->{'errors'},0,"No errors encountered uploading case results");
  342. is($tap->{'global_status'},4, "Test global result is retest when insta-bombout occurs");
  343. my $srs = $tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'};
  344. is($srs->[-1]->{'content'},"Bad Plan.","Bad plan noted in step results");
  345. }
  346. undef $opts->{'step_results'};
  347. undef $tap;
  348. #Check bad plan w/ todo pass logic
  349. $fcontents = "
  350. todo_pass.test ..
  351. 1..2
  352. ok 1 - STORAGE TANKS SEARED #TODO todo pass
  353. # goo
  354. % mark_status=todo_fail #Appears tanks weren't so sealed after all
  355. ";
  356. undef $opts->{'source'};
  357. $opts->{'tap'} = $fcontents;
  358. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  359. is($res,undef,"TR Parser doesn't explode on instantiation");
  360. isa_ok($tap,"Test::Rail::Parser");
  361. if (!$res) {
  362. $tap->run();
  363. is($tap->{'errors'},0,"No errors encountered uploading case results");
  364. is($tap->{'global_status'},7, "Test global result is respected when using global status override");
  365. }
  366. undef $opts->{'tap'};
  367. #Check autoclose functionality against Run with all tests in run status.
  368. undef $tap;
  369. $opts->{'source'} = 't/skip.test';
  370. $opts->{'run'} = 'FinalRun';
  371. $opts->{'autoclose'} = 1;
  372. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  373. is($res,undef,"TR Parser doesn't explode on instantiation");
  374. isa_ok($tap,"Test::Rail::Parser");
  375. if (!$res) {
  376. $tap->run();
  377. is($tap->{'errors'},0,"No errors encountered uploading case results");
  378. is($tap->{'run_closed'},1, "Run closed by parser when all tests done");
  379. }
  380. #Check autoclose functionality against Run with not all tests in run status.
  381. undef $tap;
  382. $opts->{'source'} = 't/todo_pass.test';
  383. $opts->{'run'} = 'BogoRun';
  384. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  385. is($res,undef,"TR Parser doesn't explode on instantiation");
  386. isa_ok($tap,"Test::Rail::Parser");
  387. if (!$res) {
  388. $tap->run();
  389. is($tap->{'errors'},0,"No errors encountered uploading case results");
  390. is($tap->{'run_closed'},undef, "Run not closed by parser when results are outstanding");
  391. }
  392. #Check that autoclose works against plan wiht all tests in run status
  393. undef $tap;
  394. $opts->{'source'} = 't/fake.test';
  395. $opts->{'run'} = 'FinalRun';
  396. $opts->{'plan'} = 'FinalPlan';
  397. $opts->{'configs'} = ['testConfig'];
  398. $opts->{'case_per_ok'} = 1;
  399. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  400. is($res,undef,"TR Parser doesn't explode on instantiation");
  401. isa_ok($tap,"Test::Rail::Parser");
  402. if (!$res) {
  403. $tap->run();
  404. is($tap->{'errors'},0,"No errors encountered uploading case results");
  405. is($tap->{'plan_closed'},1, "Plan closed by parser when all tests done");
  406. }
  407. #Check that autoclose works against plan with all tests not in run status
  408. undef $tap;
  409. $opts->{'run'} = 'BogoRun';
  410. $opts->{'plan'} = 'BogoPlan';
  411. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  412. is($res,undef,"TR Parser doesn't explode on instantiation");
  413. isa_ok($tap,"Test::Rail::Parser");
  414. if (!$res) {
  415. $tap->run();
  416. is($tap->{'errors'},0,"No errors encountered uploading case results");
  417. is($tap->{'plan_closed'},undef, "Plan not closed by parser when results are outstanding");
  418. }
  419. #Plan but no run 'splodes
  420. undef $tap;
  421. $opts->{'plan'} = 'CompletePlan';
  422. delete $opts->{'run'};
  423. delete $opts->{'configs'};
  424. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  425. like($res,qr/but no run passed/i,"TR Parser explodes on instantiation due to passing plan with no run");
  426. #Check that trying without spawn opts, using completed plan fails
  427. undef $tap;
  428. $opts->{'plan'} = 'ClosedPlan';
  429. $opts->{'run'} = 'BogoRun';
  430. delete $opts->{'testsuite_id'};
  431. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  432. like($res,qr/plan provided is completed/i,"TR Parser explodes on instantiation due to passing closed plan");
  433. #Check that the above two will just spawn a new plan in these cases
  434. $opts->{'testsuite_id'} = 9;
  435. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  436. is($res,undef,"TR Parser runs all the way through on completed run when spawning");
  437. #Check that trying without spawn opts, using completed run fails
  438. undef $tap;
  439. delete $opts->{'testsuite_id'};
  440. delete $opts->{'plan'};
  441. $opts->{'run'} = 'ClosedRun';
  442. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  443. like($res,qr/run provided is completed/i,"TR Parser explodes on instantiation due to passing closed run");
  444. #Check that the above two will just spawn a new run in these cases
  445. $opts->{'testsuite_id'} = 9;
  446. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  447. is($res,undef,"TR Parser runs all the way through on completed run when spawning");
  448. $fcontents = "
  449. todo_pass.test ..
  450. 1..2
  451. ok 1 - STORAGE TANKS SEARED #TODO todo pass
  452. # goo
  453. Bail out! #YOLO
  454. ";
  455. undef $opts->{'source'};
  456. $opts->{'tap'} = $fcontents;
  457. $opts->{'step_results'} = 'step_results';
  458. undef $opts->{'case_per_ok'};
  459. $res = exception { $tap = Test::Rail::Parser->new($opts) };
  460. is($res,undef,"TR Parser runs all the way through on bailout");
  461. if (!$res) {
  462. $tap->run();
  463. is($tap->{'errors'},0,"No errors encountered uploading case results");
  464. is($tap->{'global_status'},5, "Test global result is FAIL on todo pass test w/ bailout");
  465. my $srs = $tap->{'tr_opts'}->{'result_custom_options'}->{'step_results'};
  466. is($srs->[-1]->{'content'},"Bail Out!.","Bailout noted in step results");
  467. }