Pārlūkot izejas kodu

Resolve perma-hang on travis due to improper arg parse in new binaries

George S. Baugh 10 gadi atpakaļ
vecāks
revīzija
41f533609f
5 mainītis faili ar 19 papildinājumiem un 19 dzēšanām
  1. 3 3
      bin/testrail-runs
  2. 3 3
      bin/testrail-tests
  3. BIN
      dist/TestRail-API-0.021.tar.gz
  4. 4 4
      t/testrail-runs.t
  5. 9 9
      t/testrail-tests.t

+ 3 - 3
bin/testrail-runs

@@ -101,9 +101,9 @@ TESTING OPTIONS:
 my %opts;
 
 GetOptions(
-    'apiurl'          => \$opts{'apiurl'},
-    'password'        => \$opts{'pass'},
-    'user'            => \$opts{'user'},
+    'apiurl=s'          => \$opts{'apiurl'},
+    'password=s'        => \$opts{'pass'},
+    'user=s'            => \$opts{'user'},
     'j|project=s'     => \$opts{'project'},
     'c|config=s@'     => \$opts{'configs'},
     's|status=s@'     => \$opts{'statuses'},

+ 3 - 3
bin/testrail-tests

@@ -115,9 +115,9 @@ TESTING OPTIONS:
 my %opts;
 
 GetOptions(
-    'apiurl'          => \$opts{'apiurl'},
-    'password'        => \$opts{'pass'},
-    'user'            => \$opts{'user'},
+    'apiurl=s'          => \$opts{'apiurl'},
+    'password=s'        => \$opts{'pass'},
+    'user=s'            => \$opts{'user'},
     'j|project=s'     => \$opts{'project'},
     'p|plan=s'        => \$opts{'plan'},
     'r|run=s'         => \$opts{'run'},

BIN
dist/TestRail-API-0.021.tar.gz


+ 4 - 4
t/testrail-runs.t

@@ -4,27 +4,27 @@ use warnings;
 use Test::More 'tests' => 8;
 
 #check status filters
-my @args = ($^X,qw{bin/testrail-runs -j 'TestProject' --mock});
+my @args = ($^X,qw{bin/testrail-runs --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j 'TestProject' --mock});
 my $out = `@args`;
 is($? >> 8, 0, "Exit code OK looking for runs with passes");
 chomp $out;
 like($out,qr/^TestingSuite\nOtherOtherSuite$/,"Gets run correctly looking for passes");
 
 #check status filters
-@args = ($^X,qw{bin/testrail-runs -j 'TestProject' --mock --status passed});
+@args = ($^X,qw{bin/testrail-runs --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j 'TestProject' --mock --status passed});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK looking for runs with passes, which should fail to return results");
 chomp $out;
 is($out,'',"Gets no runs correctly looking for passes");
 
-@args = ($^X,qw{bin/testrail-runs -j 'CRUSH ALL HUMANS' --mock --status passed});
+@args = ($^X,qw{bin/testrail-runs --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j 'CRUSH ALL HUMANS' --mock --status passed});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK looking for runs with passes");
 chomp $out;
 like($out,qr/SEND T-1000 INFILTRATION UNITS BACK IN TIME$/,"Gets run correctly looking for passes");
 
 #TODO check configs for real next time
-@args = ($^X,qw{bin/testrail-runs -j 'TestProject' --mock --config testConfig});
+@args = ($^X,qw{bin/testrail-runs --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j 'TestProject' --mock --config testConfig});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK looking for runs with passes");
 chomp $out;

+ 9 - 9
t/testrail-tests.t

@@ -4,57 +4,57 @@ use warnings;
 use Test::More 'tests' => 18;
 
 #check plan mode
-my @args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --config testConfig --mock --no-recurse});
+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});
 my $out = `@args`;
 is($? >> 8, 0, "Exit code OK running plan mode, no recurse");
 chomp $out;
 like($out,qr/skipall\.test$/,"Gets test correctly in plan mode, no recurse");
 
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --config testConfig -m t --mock});
+@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' --config testConfig -m t --mock});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK running plan mode, recurse");
 chomp $out;
 like($out,qr/skipall\.test$/,"Gets test correctly in plan mode, recurse");
 
 #check non plan mode
-@args = ($^X,qw{bin/testrail-tests -j TestProject -r 'TestingSuite' -m t --mock --no-recurse});
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -r 'TestingSuite' -m t --mock --no-recurse});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK running no plan mode, no recurse");
 chomp $out;
 like($out,qr/skipall\.test$/,"Gets test correctly in no plan mode, no recurse");
 
-@args = ($^X,qw{bin/testrail-tests -j TestProject -r 'TestingSuite' -m t --mock});
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -r 'TestingSuite' -m t --mock});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK running no plan mode, recurse");
 chomp $out;
 like($out,qr/skipall\.test$/,"Gets test correctly in no plan mode, recurse");
 
 #Negative case, filtering by config
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --mock --config testPlatform1});
+@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 --mock --config testPlatform1});
 $out = `@args`;
 isnt($? >> 8, 0, "Exit code not OK when passing invalid configs for plan");
 chomp $out;
 like($out,qr/no such run/i,"Gets test correctly in plan mode, recurse");
 
 #check assignedto filters
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --assignedto teodesian});
+@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' --mock --config 'testConfig' --assignedto teodesian});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK when filtering by assignment");
 like($out,qr/skipall\.test$/,"Gets test correctly when filtering by assignment");
 
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --assignedto billy});
+@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' --mock --config 'testConfig' --assignedto billy});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK when filtering by assignement");
 chomp $out;
 is($out,'',"Gets no tests correctly when filtering by wrong assignment");
 
 #check status filters
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --mock --config 'testConfig' --status 'passed'});
+@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 --mock --config 'testConfig' --status 'passed'});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK when filtering by status");
 like($out,qr/skipall\.test$/,"Gets test correctly when filtering by status");
 
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --status 'failed'});
+@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' --mock --config 'testConfig' --status 'failed'});
 $out = `@args`;
 is($? >> 8, 0, "Exit code OK when filtering by status");
 chomp $out;