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

Fix #132: Fix performance issue with TestRail::Utils::Find::FindTests

George S. Baugh 8 лет назад
Родитель
Сommit
9508735ea3
3 измененных файлов с 6 добавлено и 2 удалено
  1. 3 0
      Changes
  2. 1 1
      dist.ini
  3. 2 1
      lib/TestRail/Utils/Find.pm

+ 3 - 0
Changes

@@ -1,5 +1,8 @@
 Revision history for Perl module TestRail::API
 
+0.040 2017-04-27 TEODESIAN
+    - Fix performance issue in TestRail::Utils::Find::FindTests
+
 0.039 2017-03-07 TEODESIAN
     - Fix issue where follow_post_redirect could not be passed to constructor
     - Add getRunResults, getRunResultsPaginated Methods in TestRail::API

+ 1 - 1
dist.ini

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

+ 2 - 1
lib/TestRail/Utils/Find.pm

@@ -223,7 +223,8 @@ sub findTests {
         }
         foreach my $case (@cases) {
             foreach my $path (@realtests) {
-                next unless $case->{'title'} eq basename($path);
+                #XXX Not quite as accurate as simply comparing the title to the basename of the path, but much faster
+                next unless index($path,$case->{'title'}) > 0;
                 $case->{'path'} = $path;
                 push(@tmpArr, $case);
                 last;