Просмотр исходного кода

Clear all dzil release test failures

George S. Baugh 10 лет назад
Родитель
Сommit
a3b7b44e2a
7 измененных файлов с 23 добавлено и 18 удалено
  1. 1 0
      Changes
  2. 2 1
      dist.ini
  3. 2 2
      lib/Test/LWP/UserAgent/TestRailMock.pm
  4. 1 1
      lib/TestRail/API.pm
  5. 9 6
      lib/TestRail/Utils.pm
  6. 1 1
      t/TestRail-API.t
  7. 7 7
      t/testrail-tests.t

+ 1 - 0
Changes

@@ -7,6 +7,7 @@ Revision history for Perl module TestRail::API
     - Add bin/testrail-tests and bin/testrail-runs
     - Add statusNamesToIds and userNamesToIds convenience methods to TestRail::API
     - Add getRunSummary to TestRail::API
+    - Minimum perl version now 5.14
 
 0.020 2015-03-25 TEODESIAN
     - Add getRunsPaginated and getPlansPaginated to get around 250 hardlimit in TR results

+ 2 - 1
dist.ini

@@ -107,7 +107,8 @@ stopwords = getConfigurationGroups
 stopwords = getConfigurations
 stopwords = getPlansPaginated
 stopwords = getRunsPaginated
-
+stopwords = getPossibleTestStatuses
+stopwords = userInput
 
 [PkgVersion]
 [AutoPrereqs]

+ 2 - 2
lib/Test/LWP/UserAgent/TestRailMock.pm

@@ -877,7 +877,7 @@ $VAR4 = bless( {
                  'content-type' => 'application/json; charset=utf-8',
                  'server' => 'Apache/2.4.7 (Ubuntu)'
                }, 'HTTP::Headers' );
-$VAR5 = '{"id":23,"name":"GosPlan","description":"Soviet 5-year agriculture plan to liquidate Kulaks","milestone_id":8,"assignedto_id":null,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":9,"created_on":1419364930,"created_by":1,"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/plans\\/view\\/23","entries":[{"id":"271443a5-aacf-467e-8993-b4f7001195cf","suite_id":9,"name":"Executing the great plan","runs":[{"id":1,"suite_id":9,"name":"Executing the great plan","description":null,"milestone_id":8,"assignedto_id":null,"include_all":true,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":9,"plan_id":23,"entry_index":1,"entry_id":"271443a5-aacf-467e-8993-b4f7001195cf","config":"testConfig","config_ids":[1],"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/runs\\/view\\/24"}]}]}';
+$VAR5 = '{"id":23,"name":"GosPlan","description":"Soviet 5-year agriculture plan to liquidate Kulaks","milestone_id":8,"assignedto_id":null,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":10,"created_on":1419364930,"created_by":1,"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/plans\\/view\\/23","entries":[{"id":"271443a5-aacf-467e-8993-b4f7001195cf","suite_id":9,"name":"Executing the great plan","runs":[{"id":1,"suite_id":9,"name":"Executing the great plan","description":null,"milestone_id":8,"assignedto_id":null,"include_all":true,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":9,"plan_id":23,"entry_index":1,"entry_id":"271443a5-aacf-467e-8993-b4f7001195cf","config":"testConfig","config_ids":[1],"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/runs\\/view\\/24"}]}]}';
 $mockObject->map_response(qr/\Q$VAR1\E/,HTTP::Response->new($VAR2, $VAR3, $VAR4, $VAR5));
 
 }
@@ -904,7 +904,7 @@ $VAR4 = bless( {
                  'content-type' => 'application/json; charset=utf-8',
                  'server' => 'Apache/2.4.7 (Ubuntu)'
                }, 'HTTP::Headers' );
-$VAR5 = '{"id":24,"name":"mah dubz plan","description":"bogoplan","milestone_id":8,"assignedto_id":null,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":9,"created_on":1419364930,"created_by":1,"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/plans\\/view\\/24","entries":[{"id":"271443a5-aacf-467e-8993-b4f7001195cf","suite_id":9,"name":"Executing the great plan","runs":[{"id":1,"suite_id":9,"name":"TestingSuite","description":null,"milestone_id":8,"assignedto_id":null,"include_all":true,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":9,"plan_id":23,"entry_index":1,"entry_id":"271443a5-aacf-467e-8993-b4f7001195cf","config":"testConfig","config_ids":[2],"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/runs\\/view\\/24"}]}]}';
+$VAR5 = '{"id":24,"name":"mah dubz plan","description":"bogoplan","milestone_id":8,"assignedto_id":null,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":10,"created_on":1419364930,"created_by":1,"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/plans\\/view\\/24","entries":[{"id":"271443a5-aacf-467e-8993-b4f7001195cf","suite_id":9,"name":"Executing the great plan","runs":[{"id":1,"suite_id":9,"name":"TestingSuite","description":null,"milestone_id":8,"assignedto_id":null,"include_all":true,"is_completed":false,"completed_on":null,"passed_count":0,"blocked_count":0,"untested_count":1,"retest_count":0,"failed_count":0,"custom_status1_count":0,"custom_status2_count":0,"custom_status3_count":0,"custom_status4_count":0,"custom_status5_count":0,"custom_status6_count":0,"custom_status7_count":0,"project_id":9,"plan_id":23,"entry_index":1,"entry_id":"271443a5-aacf-467e-8993-b4f7001195cf","config":"testConfig","config_ids":[2],"url":"http:\\/\\/testrail.local\\/\\/index.php?\\/runs\\/view\\/24"}]}]}';
 $mockObject->map_response(qr/\Q$VAR1\E/,HTTP::Response->new($VAR2, $VAR3, $VAR4, $VAR5));
 
 }

+ 1 - 1
lib/TestRail/API.pm

@@ -23,7 +23,7 @@ I recommend using the excellent L<Attempt> module for this purpose.
 
 =cut
 
-use 5.010;
+use 5.014;
 
 use strict;
 use warnings;

+ 9 - 6
lib/TestRail/Utils.pm

@@ -1,14 +1,17 @@
-# ABSTRACT: Utilities for the testrail commandline functions.
+# ABSTRACT: Utilities for the testrail command line functions.
 # PODNAME: TestRail::Utils
 
-package TestRail::Utils;
-
 =head1 DESCRIPTION
 
-Utilities for the testrail commandline functions.
+Utilities for the testrail command line functions.
 
 =cut
 
+package TestRail::Utils;
+
+use strict;
+use warnings;
+
 =head1 FUNCTIONS
 
 =head2 userInput
@@ -24,9 +27,9 @@ sub userInput {
  return $rt;
 }
 
-=head2 parseConfig($homedir)
+=head2 parseConfig(homedir)
 
-Parse .testrailrc in the provided homedir.
+Parse .testrailrc in the provided home directory.
 
 Returns:
 

+ 1 - 1
t/TestRail-API.t

@@ -125,7 +125,7 @@ is($tr->getChildRunByName($new_plan,"Executing the great plan")->{'id'},$prun->{
 
 SKIP: {
     skip("Cannot create configurations programattically in the API like in mocks",2) if !$is_mock;
-    isnt($tr->getChildRunByName($namePlan,"Executing the great plan",['Chrome']),0,"Getting run by name returns child runs");
+    isnt($tr->getChildRunByName($namePlan,"Executing the great plan",['testConfig']),0,"Getting run by name returns child runs");
     is($tr->getChildRunByName($namePlan,"Executing the great plan"),0,"Getting run by name without sufficient configuration data returns child runs");
 }
 

+ 7 - 7
t/testrail-tests.t

@@ -4,13 +4,13 @@ use warnings;
 use Test::More 'tests' => 18;
 
 #check plan mode
-my @args = ($^X,qw{bin/testrail-tests -j TestProject -p 'mah dubz plan' -r 'TestingSuite' -m t --config Firefox --mock --no-recurse});
+my @args = ($^X,qw{bin/testrail-tests -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 'mah dubz plan' -r 'TestingSuite' --config Firefox -m t --mock});
+@args = ($^X,qw{bin/testrail-tests -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;
@@ -30,31 +30,31 @@ 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 'mah dubz plan' -r 'TestingSuite' -m t --mock --config 'Windows 7' --config 'Internet Explorer'});
+@args = ($^X,qw{bin/testrail-tests -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 'mah dubz plan' -r 'TestingSuite' --mock --config 'Firefox' --assignedto teodesian});
+@args = ($^X,qw{bin/testrail-tests -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 'mah dubz plan' -r 'TestingSuite' --mock --config 'Firefox' --assignedto billy});
+@args = ($^X,qw{bin/testrail-tests -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 'mah dubz plan' -r 'TestingSuite' -m t --mock --config 'Firefox' --status 'passed'});
+@args = ($^X,qw{bin/testrail-tests -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 'mah dubz plan' -r 'TestingSuite' --mock --config 'Firefox' --status 'failed'});
+@args = ($^X,qw{bin/testrail-tests -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;