Forráskód Böngészése

Fix issue where testrail-tests always returned paths

George S. Baugh 10 éve
szülő
commit
8868a020f4
4 módosított fájl, 13 hozzáadás és 3 törlés
  1. 3 0
      Changes
  2. 1 1
      bin/testrail-tests
  3. 1 1
      dist.ini
  4. 8 1
      t/testrail-tests.t

+ 3 - 0
Changes

@@ -1,5 +1,8 @@
 Revision history for Perl module TestRail::API
 
+0.022 2015-05-08 TEODESIAN
+    - Fix issue where testrail-tests always attempted to turn test names into paths
+
 0.021 2015-04-08 TEODESIAN
     - Fix issue where getChildRuns did not return anything past first run
     - Fix issue where getChildRunByName did not perform configuration filtering correctly

+ 1 - 1
bin/testrail-tests

@@ -242,7 +242,7 @@ if ($opts{'match'}) {
         @tests = grep {my $fname = $_; grep { basename($_) eq $fname} glob($opts{'match'}."/*") } @tests;
     }
 }
-@tests = map { abs_path($_) } @tests;
+@tests = map { abs_path($_) } @tests if $opts{'match'};
 print join("\n",@tests)."\n" if scalar(@tests);
 exit 0;
 

+ 1 - 1
dist.ini

@@ -1,6 +1,6 @@
 name = TestRail-API
 main_module = lib/TestRail/API.pm
-version = 0.021
+version = 0.022
 author = George S. Baugh <teodesian@cpan.org>
 license = Perl_5
 copyright_holder = George S. Baugh

+ 8 - 1
t/testrail-tests.t

@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More 'tests' => 18;
+use Test::More 'tests' => 20;
 
 #check plan mode
 my @args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --config testConfig --mock --no-recurse});
@@ -60,4 +60,11 @@ is($? >> 8, 0, "Exit code OK when filtering by status");
 chomp $out;
 is($out,'',"Gets no tests correctly when filtering by wrong status");
 
+#Verify no-match returns non path
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -r 'TestingSuite' --mock});
+$out = `@args`;
+is($? >> 8, 0, "Exit code OK running no plan mode, no recurse");
+chomp $out;
+like($out,qr/\nskipall\.test$/,"Gets test correctly in no plan mode, no recurse");
+