[Tools] Revert "Add retrieve of test data files"

Francois Gouget fgouget at codeweavers.com
Mon Nov 13 10:06:56 CST 2017


The TestBot never creates a TestFiles.zip file in the Task directory
so this is dead code. Also there is no plan to make use of that
functionality so the code can be removed.

This reverts commit 04a67fce26fb2fed64777239594c9c20ef56e6d7.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/web/GetFile.pl    | 40 +++++++---------------------------------
 testbot/web/JobDetails.pl | 11 -----------
 2 files changed, 7 insertions(+), 44 deletions(-)

diff --git a/testbot/web/GetFile.pl b/testbot/web/GetFile.pl
index 4c6e1e29..54d4c4b8 100644
--- a/testbot/web/GetFile.pl
+++ b/testbot/web/GetFile.pl
@@ -28,7 +28,7 @@ use WineTestBot::Steps;
 
 sub GetFile($$$$)
 {
-  my ($Request, $JobKey, $StepKey, $TaskKey) = @_;
+  my ($Request, $JobKey, $StepKey) = @_;
 
   # Validate and untaint
   if (! ($JobKey =~ m/^(\d+)$/))
@@ -41,18 +41,6 @@ sub GetFile($$$$)
     return !1;
   }
   $StepKey = $1;
-  if (! defined($TaskKey))
-  {
-    $TaskKey = undef;
-  }
-  elsif ($TaskKey =~ m/^(\d+)$/)
-  {
-    $TaskKey = $1;
-  }
-  else
-  {
-    return !1;
-  }
 
   my $Job = CreateJobs()->GetItem($JobKey);
   if (! defined($Job))
@@ -65,9 +53,7 @@ sub GetFile($$$$)
     return !1;
   }
 
-  my $FileName = "$DataDir/jobs/$JobKey/$StepKey/" . 
-                 (defined($TaskKey) ? "$TaskKey/TestFiles.zip" :
-                  $Step->FileName);
+  my $FileName = "$DataDir/jobs/$JobKey/$StepKey/" . $Step->FileName;
   if (! sysopen(FILE, $FileName, O_RDONLY))
   {
     return !1;
@@ -100,21 +86,10 @@ sub GetFile($$$$)
   # HTTP/1.0
   $Request->headers_out->add("Pragma", "no-cache");
   
-  if (defined($TaskKey))
-  {
-    # Zip file
-    $Request->content_type("application/zip");
-    $Request->headers_out->add("Content-Disposition",
-                               'attachment; filename="TestFiles.zip"');
-  }
-  else
-  {
-    # Binary file
-    $Request->content_type("application/octet-stream");
-    $Request->headers_out->add("Content-Disposition",
-                               'attachment; filename="' . $Step->FileName .
-                               '"');
-  }
+  # Binary file
+  $Request->content_type("application/octet-stream");
+  $Request->headers_out->add("Content-Disposition",
+                             'attachment; filename="' . $Step->FileName . '"');
 
   print $ImageBytes;
 
@@ -126,8 +101,7 @@ my $Request = shift;
 my $CGIObj = CGI->new($Request);
 my $JobKey = $CGIObj->param("JobKey");
 my $StepKey = $CGIObj->param("StepKey");
-my $TaskKey = $CGIObj->param("TaskKey");
-if (! GetFile($Request, $JobKey, $StepKey, $TaskKey))
+if (! GetFile($Request, $JobKey, $StepKey))
 {
   $Request->headers_out->set("Location", "/");
   $Request->status(Apache2::Const::REDIRECT);
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index c5803ed4..a4ed9944 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -322,17 +322,6 @@ sub GenerateBody($)
               "'>Show full log</a></div>\n";
       }
     }
-    my $TestFilesName = "$TaskDir/TestFiles.zip";
-    if (-r $TestFilesName)
-    {
-      my $URI = "/GetFile.pl?JobKey=" . uri_escape($self->{JobId}) .
-                  "&StepKey=" . uri_escape($Item->StepNo) .
-                  "&TaskKey=" . uri_escape($Item->TaskNo);
-      print "<div class='TaskMoreInfoLink'><a href='" .
-            $self->CGI->escapeHTML($URI) .
-            "'>Retrieve test files</a></div>\n";
-    }
-
     print "</div>\n";
     if (open LOGFILE, "<$LogName")
     {
-- 
2.14.2




More information about the wine-patches mailing list