[tools 1/2] testbot/UpdateTaskLogs: Fix moving reference reports to latest/.

Francois Gouget fgouget at codeweavers.com
Tue Feb 18 10:31:20 CST 2020


When saving an existing reference report from a task directory to the
latest/ directory, its file name should be preserved to avoid
duplicating it. This means UpdateLatestReport() should not rebuild it
from scratch.
Fortunately this bug has been hidden so far because GetRefReportName()
does not yet depend on the Task's job id.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/UpdateTaskLogs          | 2 +-
 testbot/lib/WineTestBot/LogUtils.pm | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/testbot/bin/UpdateTaskLogs b/testbot/bin/UpdateTaskLogs
index d29b42afb2..395c2029c7 100755
--- a/testbot/bin/UpdateTaskLogs
+++ b/testbot/bin/UpdateTaskLogs
@@ -234,7 +234,7 @@ sub DoUpdateLatestReport($$$)
     # Add the reference report to latest/
     Debug("latest: Adding $RefReportName from ". Path2TaskKey($SrcReportPath) ."\n");
 
-    my $ErrMessages = UpdateLatestReport($Task, $ReportName, $SrcReportPath);
+    my $ErrMessages = UpdateLatestReport($RefReportName, $SrcReportPath);
     foreach my $ErrMessage (@$ErrMessages)
     {
       Error "$ErrMessage\n";
diff --git a/testbot/lib/WineTestBot/LogUtils.pm b/testbot/lib/WineTestBot/LogUtils.pm
index 601ff0fcd8..dc2accaf32 100644
--- a/testbot/lib/WineTestBot/LogUtils.pm
+++ b/testbot/lib/WineTestBot/LogUtils.pm
@@ -1225,12 +1225,11 @@ sub SnapshotLatestReport($$)
   return \@ErrMessages;
 }
 
-sub UpdateLatestReport($$$)
+sub UpdateLatestReport($$)
 {
-  my ($Task, $ReportName, $SrcReportPath) = @_;
+  my ($RefReportName, $SrcReportPath) = @_;
   my @ErrMessages;
 
-  my $RefReportName = $Task->GetRefReportName($ReportName);
   foreach my $Suffix ("", ".errors")
   {
     # Add the new reference file even if it is empty.
@@ -1272,7 +1271,8 @@ sub UpdateLatestReports($$)
   foreach my $ReportName (@$ReportNames)
   {
     next if (!-f "$TaskDir/$ReportName" or -z _);
-    push @ErrMessages, @{UpdateLatestReport($Task, $ReportName, "$TaskDir/$ReportName")};
+    my $RefReportName = $Task->GetRefReportName($ReportName);
+    push @ErrMessages, @{UpdateLatestReport($RefReportName, "$TaskDir/$ReportName")};
   }
   return \@ErrMessages;
 }
-- 
2.20.1




More information about the wine-devel mailing list