Francois Gouget : testbot/WineRun*: Add GetTaskURL() to link to the task website page.
Alexandre Julliard
julliard at winehq.org
Fri Sep 20 15:39:35 CDT 2019
Module: tools
Branch: master
Commit: d899fa2bce76600bae1b93a5d5032a7ee7f9ea95
URL: https://source.winehq.org/git/tools.git/?a=commit;h=d899fa2bce76600bae1b93a5d5032a7ee7f9ea95
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Sep 20 13:56:37 2019 +0200
testbot/WineRun*: Add GetTaskURL() to link to the task website page.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
testbot/bin/WineRunTask.pl | 4 ++--
testbot/bin/WineRunWineTest.pl | 4 ++--
testbot/lib/WineTestBot/Utils.pm | 12 +++++++++++-
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index d987df7..df9fcad 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -467,8 +467,8 @@ elsif ($Step->Type eq "suite")
$Script .= "$FileName ";
if (defined($WebHostName))
{
- my $StepTask = 100 * $StepNo + $TaskNo;
- $Script .= "-u \"http://$WebHostName/JobDetails.pl?Key=$JobId&s$StepTask=1#k$StepTask\" ";
+ my $URL = GetTaskURL($JobId, $StepNo, $TaskNo, 1);
+ $Script .= "-u ". BatchQuote(MakeSecureURL($URL)) ." ";
}
my $Tag = $VM->Type ne "win64" ? "" : $Step->FileType eq "exe64" ? "64" : "32";
$Tag = BuildTag($VM->Name, $Tag);
diff --git a/testbot/bin/WineRunWineTest.pl b/testbot/bin/WineRunWineTest.pl
index 514c57c..79d7519 100755
--- a/testbot/bin/WineRunWineTest.pl
+++ b/testbot/bin/WineRunWineTest.pl
@@ -443,8 +443,8 @@ if ($Step->Type eq "suite")
$Script .= "--winetest ". ShQuote($Task->Missions) ." $BaseTag ";
if (defined $WebHostName)
{
- my $StepTask = 100 * $StepNo + $TaskNo;
- $Script .= "-u \"http://$WebHostName/JobDetails.pl?Key=$JobId&s$StepTask=1#k$StepTask\" ";
+ my $URL = GetTaskURL($JobId, $StepNo, $TaskNo, 1);
+ $Script .= "-u ". ShQuote(MakeSecureURL($URL)) ." ";
}
my $Info = $VM->Description ? $VM->Description : "";
if ($VM->Details)
diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm
index 63e8f53..e8ba516 100644
--- a/testbot/lib/WineTestBot/Utils.pm
+++ b/testbot/lib/WineTestBot/Utils.pm
@@ -27,7 +27,7 @@ WineTestBot::Utils - Utility functions
=cut
use Exporter 'import';
-our @EXPORT = qw(SecureConnection MakeSecureURL GenerateRandomString
+our @EXPORT = qw(SecureConnection MakeSecureURL GetTaskURL GenerateRandomString
OpenNewFile CreateNewFile CreateNewLink CreateNewDir GetMTime
DurationToString BuildEMailRecipient IsValidFileName
BuildTag SanitizeTag LocaleName NotifyAdministrator
@@ -55,6 +55,16 @@ sub MakeSecureURL($)
return $Protocol . ($ENV{"HTTP_HOST"} || $WebHostName) . $URL;
}
+sub GetTaskURL($$$;$$)
+{
+ my ($JobId, $StepNo, $TaskNo, $ShowScreenshot, $ShowLog) = @_;
+ my $StepTask = 100 * $StepNo + $TaskNo;
+ my $URL = "/JobDetails.pl?Key=$JobId";
+ $URL .= "&s$StepTask=1" if ($ShowScreenshot);
+ $URL .= "&f$StepTask=$ShowLog" if ($ShowLog);
+ return "$URL#k$StepTask";
+}
+
sub DurationToString($;$)
{
my ($Secs, $Raw) = @_;
More information about the wine-cvs
mailing list