Bläddra i källkod

Skip usercache in parser

Looks like I missed a spot in the earlier changes.
This prevents yet more explosions on new TestRail.
Andy Baugh 5 år sedan
förälder
incheckning
7420ac5b73
1 ändrade filer med 14 tillägg och 1 borttagningar
  1. 14 1
      lib/Test/Rail/Parser.pm

+ 14 - 1
lib/Test/Rail/Parser.pm

@@ -170,7 +170,17 @@ sub new {
 
     #Allow natural confessing from constructor
     #Force-on POST redirects for maximum compatibility
-    my $tr = TestRail::API->new($tropts->{'apiurl'},$tropts->{'user'},$tropts->{'pass'},$tropts->{'encoding'},$tropts->{'debug'},1,$tropts->{max_tries});
+    #Also ensure all opts that need string type have it when undef
+    my $tr = TestRail::API->new(
+        $tropts->{'apiurl'} // '',
+        $tropts->{'user'} // '',
+        $tropts->{'pass'} // '',
+        $tropts->{'encoding'} // '',
+        $tropts->{'debug'},
+        1,
+        $tropts->{max_tries},
+        { 'skip_userdata_cache' => 1 },
+    );
     $tropts->{'testrail'} = $tr;
     $tr->{'browser'} = $tropts->{'browser'} if defined($tropts->{'browser'}); #allow mocks
     $tr->{'debug'} = 0; #Always suppress in production
@@ -189,6 +199,9 @@ sub new {
     }
     $tropts->{'project_id'} = $tropts->{'project'}->{'id'};
 
+    # Ok, let's cache the users since we have the project ID now
+    $tr->getUsers($tropts->{'project_id'});
+
     #Discover possible test statuses
     $tropts->{'statuses'} = $tr->getPossibleTestStatuses();
     my @ok     = grep {$_->{'name'} eq 'passed'} @{$tropts->{'statuses'}};