From 0c3e3e977e9d27555070f4e3526740a130e8cf8e Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 17 Sep 2018 16:06:11 -0700 Subject: [PATCH] Corrected pulling PR number from the executable name. --- tools/auto-tester/src/Test.cpp | 2 +- tools/auto-tester/src/TestRunner.cpp | 26 ++++++++++++-------------- tools/auto-tester/src/ui/AutoTester.ui | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/tools/auto-tester/src/Test.cpp b/tools/auto-tester/src/Test.cpp index aedf0be3d3..9d77d4ed60 100644 --- a/tools/auto-tester/src/Test.cpp +++ b/tools/auto-tester/src/Test.cpp @@ -190,7 +190,7 @@ void Test::startTestsEvaluation(const bool isRunningFromCommandLine, _isRunningInAutomaticTestRun = isRunningInAutomaticTestRun; if (snapshotDirectory.isNull()) { - // Get list of JPEG images in folder, sorted by name + // Get list of PNG images in folder, sorted by name QString previousSelection = _snapshotDirectory; QString parent = previousSelection.left(previousSelection.lastIndexOf('/')); if (!parent.isNull() && parent.right(1) != "/") { diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 624dce17eb..71199782e9 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -270,23 +270,21 @@ void TestRunner::startLocalServerProcesses() { } void TestRunner::runInterfaceWithTestScript() { - QString commandLine; + QString exeFile = QString("\"") + QDir::toNativeSeparators(_installationFolder) + + "\\interface.exe\""; + QString url = QString("hifi://localhost"); if (_runServerless->isChecked()) { // Move to an empty area - commandLine = - QString("\"") + QDir::toNativeSeparators(_installationFolder) + - "\\interface.exe\" --url hifi://localhost/9999,9999,9999/0.0,0.0,0.0,1.0 --testScript https://raw.githubusercontent.com/" + _user + - "/hifi_tests/" + _branch + "/tests/testRecursive.js quitWhenFinished --testResultsLocation " + - _snapshotFolder; - } else { - // There is no content, so no need to move - commandLine = QString("\"") + QDir::toNativeSeparators(_installationFolder) + - "\\interface.exe\" --url hifi://localhost --testScript https://raw.githubusercontent.com/" + _user + - "/hifi_tests/" + _branch + - "/tests/content/entity/zone/testRecursive.js quitWhenFinished --testResultsLocation " + _snapshotFolder; + url = url + "/9999,9999,9999/0.0,0.0,0.0,1.0"; } + QString testScript = + QString("https://raw.githubusercontent.com/") + _user + "/hifi_tests/" + _branch + "/tests/testRecursive.js"; + + QString commandLine = exeFile + " --url " + url + " --testScript " + testScript + + " quitWhenFinished --testResultsLocation " + _snapshotFolder; + interfaceWorker->setCommandLine(commandLine); emit startInterface(); } @@ -508,10 +506,10 @@ QString TestRunner::getPRNumberFromURL(const QString& url) { try { QStringList urlParts = url.split("/"); QStringList filenameParts = urlParts[urlParts.size() - 1].split("-"); - if (filenameParts.size() != 5) { + if (filenameParts.size() <= 3) { throw "URL not in expected format, should look like `https://deployment.highfidelity.com/jobs/pr-build/label%3Dwindows/13023/HighFidelity-Beta-Interface-PR14006-be76c43.exe`"; } - return filenameParts[3]; + return filenameParts[filenameParts.size() - 2]; } catch (QString errorMessage) { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), errorMessage); exit(-1); diff --git a/tools/auto-tester/src/ui/AutoTester.ui b/tools/auto-tester/src/ui/AutoTester.ui index e241acc6f3..5357a7e612 100644 --- a/tools/auto-tester/src/ui/AutoTester.ui +++ b/tools/auto-tester/src/ui/AutoTester.ui @@ -498,7 +498,7 @@ Serveless - true + false @@ -529,7 +529,7 @@ 150 98 461 - 24 + 28