testrail-runs.t 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. use strict;
  2. use warnings;
  3. use Test::More 'tests' => 8;
  4. #check status filters
  5. my @args = ($^X,qw{bin/testrail-runs -j 'TestProject' --mock});
  6. my $out = `@args`;
  7. is($? >> 8, 0, "Exit code OK looking for runs with passes");
  8. chomp $out;
  9. like($out,qr/^TestingSuite\nOtherOtherSuite$/,"Gets run correctly looking for passes");
  10. #check status filters
  11. @args = ($^X,qw{bin/testrail-runs -j 'TestProject' --mock --status passed});
  12. $out = `@args`;
  13. is($? >> 8, 0, "Exit code OK looking for runs with passes, which should fail to return results");
  14. chomp $out;
  15. is($out,'',"Gets no runs correctly looking for passes");
  16. @args = ($^X,qw{bin/testrail-runs -j 'CRUSH ALL HUMANS' --mock --status passed});
  17. $out = `@args`;
  18. is($? >> 8, 0, "Exit code OK looking for runs with passes");
  19. chomp $out;
  20. like($out,qr/SEND T-1000 INFILTRATION UNITS BACK IN TIME$/,"Gets run correctly looking for passes");
  21. #TODO check configs for real next time
  22. @args = ($^X,qw{bin/testrail-runs -j 'TestProject' --mock --config testConfig});
  23. $out = `@args`;
  24. is($? >> 8, 0, "Exit code OK looking for runs with passes");
  25. chomp $out;
  26. is($out,'',"Gets no run correctly when filtering by unassigned config");