Module: tools Branch: master Commit: b2c3783a8f411441e12bb09a001037eb80df2407 URL: https://source.winehq.org/git/tools.git/?a=commit;h=b2c3783a8f411441e12bb09a...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue Feb 18 17:31:20 2020 +0100
testbot/UpdateTaskLogs: Fix moving reference reports to latest/.
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@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 d29b42a..395c202 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 601ff0f..dc2acca 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; }