From 936c3beea0d8816c6cc7ae41df8935e55cc61fc6 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Oct 2018 15:56:29 -0700 Subject: [PATCH 01/82] Exit if Python executable not found --- tools/auto-tester/src/PythonInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/auto-tester/src/PythonInterface.cpp b/tools/auto-tester/src/PythonInterface.cpp index 4922b8a8df..c5878939cc 100644 --- a/tools/auto-tester/src/PythonInterface.cpp +++ b/tools/auto-tester/src/PythonInterface.cpp @@ -18,7 +18,9 @@ PythonInterface::PythonInterface() { QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH"); if (!QFile::exists(_pythonPath + "/" + _pythonExe)) { QMessageBox::critical(0, _pythonExe, QString("Python executable not found in ") + _pythonPath); + exit(-1); } + _pythonCommand = _pythonPath + "/" + _pythonExe; } else { QMessageBox::critical(0, "PYTHON_PATH not defined", From 34a03bfc99ee02ec3652a3f913d99a3561af4da5 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Oct 2018 15:57:06 -0700 Subject: [PATCH 02/82] Python executable for MAC is `python` --- tools/auto-tester/src/PythonInterface.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/auto-tester/src/PythonInterface.h b/tools/auto-tester/src/PythonInterface.h index f32a39a644..a218b68039 100644 --- a/tools/auto-tester/src/PythonInterface.h +++ b/tools/auto-tester/src/PythonInterface.h @@ -19,7 +19,13 @@ public: QString getPythonCommand(); private: +#ifdef Q_OS_WIN const QString _pythonExe{ "python.exe" }; +#endif +#ifdef Q_OS_MACOS + const QString _pythonExe{ "python" }; +#endif + QString _pythonCommand; }; From 14216bdeca89856d4d8e7588744e8d4a115b267f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Oct 2018 16:22:12 -0700 Subject: [PATCH 03/82] Starting v7.0 Increased a button size for Mac. --- tools/auto-tester/src/ui/AutoTester.cpp | 2 +- tools/auto-tester/src/ui/AutoTester.ui | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/auto-tester/src/ui/AutoTester.cpp b/tools/auto-tester/src/ui/AutoTester.cpp index 32457c2224..d49f3aaa1c 100644 --- a/tools/auto-tester/src/ui/AutoTester.cpp +++ b/tools/auto-tester/src/ui/AutoTester.cpp @@ -36,7 +36,7 @@ AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) { _ui.statusLabel->setText(""); _ui.plainTextEdit->setReadOnly(true); - setWindowTitle("Auto Tester - v6.7"); + setWindowTitle("Auto Tester - v7.0"); // Coming soon to an auto-tester near you... //// _helpWindow.textBrowser->setText() diff --git a/tools/auto-tester/src/ui/AutoTester.ui b/tools/auto-tester/src/ui/AutoTester.ui index b277fbdb2a..cf2ffd35cd 100644 --- a/tools/auto-tester/src/ui/AutoTester.ui +++ b/tools/auto-tester/src/ui/AutoTester.ui @@ -43,7 +43,7 @@ - 0 + 3 @@ -572,7 +572,7 @@ 330 170 - 101 + 181 40 From 028d1cf237881c582df787bd859e38af653d75d0 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 13:36:15 -0700 Subject: [PATCH 04/82] Minor cleanup. --- tools/auto-tester/src/Downloader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/auto-tester/src/Downloader.h b/tools/auto-tester/src/Downloader.h index 6d1029698f..742a88b890 100644 --- a/tools/auto-tester/src/Downloader.h +++ b/tools/auto-tester/src/Downloader.h @@ -37,7 +37,7 @@ public: signals: void downloaded(); - private slots: +private slots: void fileDownloaded(QNetworkReply* pReply); private: From 47ce1573eb5494d5107d1967d899d1779c9b4009 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 15:17:07 -0700 Subject: [PATCH 05/82] Corrected use of _snapshotFolder. --- tools/auto-tester/src/TestRunner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 674cf6f8e8..94e65d0c8b 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -327,7 +327,6 @@ void TestRunner::startLocalServerProcesses() { void TestRunner::runInterfaceWithTestScript() { QString exeFile = QString("\"") + QDir::toNativeSeparators(_installationFolder) + "\\interface.exe\""; - QString snapshotFolder = QString("\"") + QDir::toNativeSeparators(_snapshotFolder) + "\""; QString url = QString("hifi://localhost"); if (_runServerless->isChecked()) { @@ -340,8 +339,11 @@ void TestRunner::runInterfaceWithTestScript() { QString testScript = QString("https://raw.githubusercontent.com/") + _user + "/hifi_tests/" + _branch + "/tests/testRecursive.js"; - QString commandLine = exeFile + " --url " + url + " --no-updater --no-login" + " --testScript " + testScript + - " quitWhenFinished --testResultsLocation " + snapshotFolder; + QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + + " quitWhenFinished --testResultsLocation " + _snapshotFolder; + + // Helpful for debugging + appendLog(commandLine); interfaceWorker->setCommandLine(commandLine); emit startInterface(); From d2e31b3f6715092a48558f1ad3da54ce05670d4d Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 15:18:29 -0700 Subject: [PATCH 06/82] Use `fromPercentEncoding` to download URL (attempting to get download to run on Mac). --- tools/auto-tester/src/Downloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/auto-tester/src/Downloader.cpp b/tools/auto-tester/src/Downloader.cpp index cb9863f34d..3c07d8c3a3 100644 --- a/tools/auto-tester/src/Downloader.cpp +++ b/tools/auto-tester/src/Downloader.cpp @@ -17,7 +17,7 @@ Downloader::Downloader(QUrl fileURL, QObject *parent) : QObject(parent) { this, SLOT (fileDownloaded(QNetworkReply*)) ); - QNetworkRequest request(fileURL); + QNetworkRequest request(QUrl::fromPercentEncoding(fileURL.toString().toLatin1())); _networkAccessManager.get(request); } From 7bf6e9cda918a1c2f93fb74455e9f8b3e8c49694 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 16:19:25 -0700 Subject: [PATCH 07/82] Simplified, and seems to work --- tools/auto-tester/src/Downloader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/auto-tester/src/Downloader.cpp b/tools/auto-tester/src/Downloader.cpp index 3c07d8c3a3..de768398b0 100644 --- a/tools/auto-tester/src/Downloader.cpp +++ b/tools/auto-tester/src/Downloader.cpp @@ -17,8 +17,7 @@ Downloader::Downloader(QUrl fileURL, QObject *parent) : QObject(parent) { this, SLOT (fileDownloaded(QNetworkReply*)) ); - QNetworkRequest request(QUrl::fromPercentEncoding(fileURL.toString().toLatin1())); - _networkAccessManager.get(request); + _networkAccessManager.get(QNetworkRequest(fileURL)); } void Downloader::fileDownloaded(QNetworkReply* reply) { @@ -37,4 +36,4 @@ void Downloader::fileDownloaded(QNetworkReply* reply) { QByteArray Downloader::downloadedData() const { return _downloadedData; -} \ No newline at end of file +} From c3b1f8c332d48a75fa042046d760f237b5ff41f9 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 17:22:45 -0700 Subject: [PATCH 08/82] Should be able to download Mac installer --- tools/auto-tester/src/TestRunner.cpp | 69 +++++++++++++++------------- tools/auto-tester/src/TestRunner.h | 6 +++ 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 94e65d0c8b..89d9867784 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -538,6 +538,7 @@ void TestRunner::parseBuildInformation() { #elif defined(Q_OS_MAC) platformOfInterest = "mac"; #endif + QDomElement element = domDocument.documentElement(); // Verify first element is "projects" @@ -554,42 +555,48 @@ void TestRunner::parseBuildInformation() { throw("File is not from 'interface' build"); } - // Now loop over the platforms + // Now loop over the platforms, looking for ours + bool platformFound{ false }; + element = element.firstChild().toElement(); while (!element.isNull()) { - element = element.firstChild().toElement(); - if (element.tagName() != "platform" || element.attribute("name") != platformOfInterest) { - continue; + if (element.attribute("name") == platformOfInterest) { + platformFound = true; + break; } - - // Next element should be the build - element = element.firstChild().toElement(); - if (element.tagName() != "build") { - throw("File seems to be in wrong format"); - } - - // Next element should be the version - element = element.firstChild().toElement(); - if (element.tagName() != "version") { - throw("File seems to be in wrong format"); - } - - // Add the build number to the end of the filename - _buildInformation.build = element.text(); - - // First sibling should be stable_version element = element.nextSibling().toElement(); - if (element.tagName() != "stable_version") { - throw("File seems to be in wrong format"); - } - - // Next sibling should be url - element = element.nextSibling().toElement(); - if (element.tagName() != "url") { - throw("File seems to be in wrong format"); - } - _buildInformation.url = element.text(); } + if (!platformFound) { + throw("File seems to be in wrong format - platform " + platformOfInterest + " not found"); + } + + element = element.firstChild().toElement(); + if (element.tagName() != "build") { + throw("File seems to be in wrong format"); + } + + // Next element should be the version + element = element.firstChild().toElement(); + if (element.tagName() != "version") { + throw("File seems to be in wrong format"); + } + + // Add the build number to the end of the filename + _buildInformation.build = element.text(); + + // First sibling should be stable_version + element = element.nextSibling().toElement(); + if (element.tagName() != "stable_version") { + throw("File seems to be in wrong format"); + } + + // Next sibling should be url + element = element.nextSibling().toElement(); + if (element.tagName() != "url") { + throw("File seems to be in wrong format"); + } + _buildInformation.url = element.text(); + } catch (QString errorMessage) { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), errorMessage); exit(-1); diff --git a/tools/auto-tester/src/TestRunner.h b/tools/auto-tester/src/TestRunner.h index e6cb7cd764..5b2d55959f 100644 --- a/tools/auto-tester/src/TestRunner.h +++ b/tools/auto-tester/src/TestRunner.h @@ -88,7 +88,13 @@ signals: private: bool _automatedTestIsRunning{ false }; +#ifndef Q_OS_WIN const QString INSTALLER_FILENAME_LATEST{ "HighFidelity-Beta-latest-dev.exe" }; +#elif defined(Q_OS_MAC) + const QString INSTALLER_FILENAME_LATEST{ "HighFidelity-Beta-latest-dev.dmg" }; +#else + const QString INSTALLER_FILENAME_LATEST{ "just to pass compilation" }; +#endif QString _installerURL; QString _installerFilename; From e9310415012a33f2869d341af59fa2ed06b0b289 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 17:39:06 -0700 Subject: [PATCH 09/82] Corrected #ifdef --- tools/auto-tester/src/TestRunner.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.h b/tools/auto-tester/src/TestRunner.h index 5b2d55959f..340ede9bf7 100644 --- a/tools/auto-tester/src/TestRunner.h +++ b/tools/auto-tester/src/TestRunner.h @@ -88,7 +88,7 @@ signals: private: bool _automatedTestIsRunning{ false }; -#ifndef Q_OS_WIN +#ifdef Q_OS_WIN const QString INSTALLER_FILENAME_LATEST{ "HighFidelity-Beta-latest-dev.exe" }; #elif defined(Q_OS_MAC) const QString INSTALLER_FILENAME_LATEST{ "HighFidelity-Beta-latest-dev.dmg" }; @@ -154,4 +154,5 @@ signals: private: QString _commandLine; }; -#endif // hifi_testRunner_h \ No newline at end of file +#endif // hifi_testRunner_h + From 28338a83071d36f40ab7f0473eb262b449d1201c Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Oct 2018 17:40:39 -0700 Subject: [PATCH 10/82] Minor cleanup. --- tools/auto-tester/src/TestRunner.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/auto-tester/src/TestRunner.h b/tools/auto-tester/src/TestRunner.h index 340ede9bf7..8267a042b7 100644 --- a/tools/auto-tester/src/TestRunner.h +++ b/tools/auto-tester/src/TestRunner.h @@ -155,4 +155,3 @@ private: QString _commandLine; }; #endif // hifi_testRunner_h - From 98441b2328f91c64f19fa283f256d62f00231ef2 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Oct 2018 15:49:46 -0700 Subject: [PATCH 11/82] WIP - installing High Fidelity from command line. --- tools/auto-tester/src/TestRunner.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 89d9867784..2d5b013f31 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -176,10 +176,26 @@ void TestRunner::runInstaller() { QString installerFullPath = _workingFolder + "/" + _installerFilename; +#ifdef Q_OS_WIN QString commandLine = "\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder); installerWorker->setCommandLine(commandLine); +#elif defined Q_OS_MAC + QFile script; + script.setFileName(_workingFolder + "/install_app.sh"); + if (!script.open(QIODevice::Append | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'install_app.sh'"); + exit(-1); + } + + script.write("#/bin/sh\n\n"); + script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`"); + script.write((QString("#cp -rf \"$VOLUME/") + _installerFilename + "High Fidelity/interface.app\"").toStdString().c_str()); + + QString commandLine = "yes | ../install_app.sh HighFidelity-Beta-latest-dev.dmg"; +#endif emit startInstaller(); } @@ -614,4 +630,4 @@ int Worker::runCommand() { int result = system(_commandLine.toStdString().c_str()); emit commandComplete(); return result; -} \ No newline at end of file +} From 1213f3f658b4e646863e06716e1c92630ba4a453 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Oct 2018 17:51:41 -0700 Subject: [PATCH 12/82] Can run the installer --- tools/auto-tester/src/TestRunner.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 2d5b013f31..09de31120e 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -179,23 +179,31 @@ void TestRunner::runInstaller() { #ifdef Q_OS_WIN QString commandLine = "\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder); - - installerWorker->setCommandLine(commandLine); #elif defined Q_OS_MAC QFile script; script.setFileName(_workingFolder + "/install_app.sh"); - if (!script.open(QIODevice::Append | QIODevice::Text)) { + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), "Could not open 'install_app.sh'"); exit(-1); } script.write("#/bin/sh\n\n"); - script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`"); - script.write((QString("#cp -rf \"$VOLUME/") + _installerFilename + "High Fidelity/interface.app\"").toStdString().c_str()); + script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); + script.write((QString("mkdir \"") + _workingFolder + "/High Fidelity\"\n").toStdString().c_str()); - QString commandLine = "yes | ../install_app.sh HighFidelity-Beta-latest-dev.dmg"; + QStringList urlParts = _buildInformation.url.split('/'); + QString installerFileName = urlParts[urlParts.length() - 1].split('.')[0]; + script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High Fidelity/\"\n").toStdString().c_str()); + + script.write("hdiutil detach \"$VOLUME\"\n"); + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + + QString commandLine = "yes | " + _workingFolder + "/install_app.sh " + _workingFolder + "/HighFidelity-Beta-latest-dev.dmg"; #endif + + installerWorker->setCommandLine(commandLine); emit startInstaller(); } From 418a578e288238a2ff3765b80fa7f6a30c4187eb Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Oct 2018 13:02:13 -0700 Subject: [PATCH 13/82] Can start Interface --- tools/auto-tester/src/TestRunner.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 09de31120e..9c38fee4c4 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -188,15 +188,21 @@ void TestRunner::runInstaller() { exit(-1); } + QString installFolder = QString("\"") + _workingFolder + "/High Fidelity\""; + if (!QDir().exists(installFolder)) { + QDir().mkdir(installFolder); + } + + // This script installs High Fidelity. It is run as "yes | install_app.sh... so "yes" is killed at the end script.write("#/bin/sh\n\n"); script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); - script.write((QString("mkdir \"") + _workingFolder + "/High Fidelity\"\n").toStdString().c_str()); QStringList urlParts = _buildInformation.url.split('/'); QString installerFileName = urlParts[urlParts.length() - 1].split('.')[0]; script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High Fidelity/\"\n").toStdString().c_str()); script.write("hdiutil detach \"$VOLUME\"\n"); + script.write("killall yes\n"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); @@ -350,8 +356,6 @@ void TestRunner::startLocalServerProcesses() { } void TestRunner::runInterfaceWithTestScript() { - QString exeFile = QString("\"") + QDir::toNativeSeparators(_installationFolder) + "\\interface.exe\""; - QString url = QString("hifi://localhost"); if (_runServerless->isChecked()) { // Move to an empty area @@ -363,9 +367,14 @@ void TestRunner::runInterfaceWithTestScript() { QString testScript = QString("https://raw.githubusercontent.com/") + _user + "/hifi_tests/" + _branch + "/tests/testRecursive.js"; +#ifdef Q_OS_WIN + QString exeFile = QString("\"") + QDir::toNativeSeparators(_installationFolder) + "\\interface.exe\""; QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; - +#elif defined Q_OS_MAC + QString commandLine = "open -a \"" +_installationFolder + "/interface.app\""; +#endif + // Helpful for debugging appendLog(commandLine); From 41b70ffab5681f14d27e756627f851bf79c28b33 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Oct 2018 16:30:56 -0700 Subject: [PATCH 14/82] Installs both interface and Sandbox. Runs interface. --- tools/auto-tester/src/TestRunner.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 9c38fee4c4..d74073c164 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -84,7 +84,12 @@ void TestRunner::setWorkingFolder() { return; } +#ifdef Q_OS_WIN _installationFolder = _workingFolder + "/High Fidelity"; +#elif defined Q_OS_MAC + _installationFolder = _workingFolder + "/High_Fidelity"; +#endif + _logFile.setFileName(_workingFolder + "/log.txt"); autoTester->enableRunTabControls(); @@ -188,7 +193,7 @@ void TestRunner::runInstaller() { exit(-1); } - QString installFolder = QString("\"") + _workingFolder + "/High Fidelity\""; + QString installFolder = QString("\"") + _workingFolder + "/High_Fidelity\""; if (!QDir().exists(installFolder)) { QDir().mkdir(installFolder); } @@ -197,10 +202,9 @@ void TestRunner::runInstaller() { script.write("#/bin/sh\n\n"); script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); - QStringList urlParts = _buildInformation.url.split('/'); - QString installerFileName = urlParts[urlParts.length() - 1].split('.')[0]; - script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High Fidelity/\"\n").toStdString().c_str()); - + script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/Sandbox.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + script.write("hdiutil detach \"$VOLUME\"\n"); script.write("killall yes\n"); script.close(); From 263a831fc4dc5b2f3e3cc52aa5f20848d8d7e331 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Oct 2018 18:41:10 -0700 Subject: [PATCH 15/82] Runs Interface with Sandbox --- tools/auto-tester/src/TestRunner.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index d74073c164..315ac732e0 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -345,16 +345,21 @@ void TestRunner::killProcesses() { } void TestRunner::startLocalServerProcesses() { -#ifdef Q_OS_WIN QString commandLine; - + +#ifdef Q_OS_WIN commandLine = "start \"domain-server.exe\" \"" + QDir::toNativeSeparators(_installationFolder) + "\\domain-server.exe\""; system(commandLine.toStdString().c_str()); commandLine = "start \"assignment-client.exe\" \"" + QDir::toNativeSeparators(_installationFolder) + "\\assignment-client.exe\" -n 6"; system(commandLine.toStdString().c_str()); + +#elif defined Q_OS_MAC + commandLine = "open -a \"" +_installationFolder + "/Sandbox.app\""; + system(commandLine.toStdString().c_str()); #endif + // Give server processes time to stabilize QThread::sleep(20); } From 5e58da8ec10c18494dffb7a39e2a697a1bf59cee Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Oct 2018 22:29:50 -0700 Subject: [PATCH 16/82] Interface runs, but AutoTester doesn't wait for completion. --- tools/auto-tester/src/TestRunner.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 315ac732e0..2bf304943b 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -20,7 +20,7 @@ extern AutoTester* autoTester; #include #include #endif - +#include TestRunner::TestRunner(std::vector dayCheckboxes, std::vector timeEditCheckboxes, std::vector timeEdits, @@ -247,11 +247,10 @@ void TestRunner::verifyInstallationSucceeded() { } void TestRunner::saveExistingHighFidelityAppDataFolder() { +#ifdef Q_OS_WIN QString dataDirectory{ "NOT FOUND" }; -#ifdef Q_OS_WIN dataDirectory = qgetenv("USERPROFILE") + "\\AppData\\Roaming"; -#endif if (_runLatest->isChecked()) { _appDataFolder = dataDirectory + "\\High Fidelity"; @@ -272,6 +271,9 @@ void TestRunner::saveExistingHighFidelityAppDataFolder() { // Copy an "empty" AppData folder (i.e. no entities) copyFolder(QDir::currentPath() + "/AppDataHighFidelity", _appDataFolder.path()); +#elif defined Q_OS_MAC + // TODO: find Mac equivalent of AppData +#endif } void TestRunner::createSnapshotFolder() { @@ -341,6 +343,13 @@ void TestRunner::killProcesses() { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), "unknown error"); exit(-1); } +#elif defined Q_OS_MAC + // TODO: this doesn't allow interface to run + //QString commandLine = "killall interface\n"; + //system(commandLine.toStdString().c_str()); + + //commandLine = "killall Sandbox\n"; + //system(commandLine.toStdString().c_str()); #endif } @@ -370,7 +379,12 @@ void TestRunner::runInterfaceWithTestScript() { // Move to an empty area url = "file:///~serverless/tutorial.json"; } else { +#ifdef Q_OS_WIN url = "hifi://localhost"; +#elif defined Q_OS_MAC + // TODO: Find out Mac equivalent of AppData, then this win't be needed + url = "hifi://localhost/9999,9999,9999"; +#endif } QString testScript = @@ -381,7 +395,8 @@ void TestRunner::runInterfaceWithTestScript() { QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #elif defined Q_OS_MAC - QString commandLine = "open -a \"" +_installationFolder + "/interface.app\""; + QString commandLine = "open -a \"" +_installationFolder + "/interface.app\"" + " --args --url " + url + " --no-updater" + " --testScript " + testScript + + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #endif // Helpful for debugging @@ -448,11 +463,15 @@ void TestRunner::addBuildNumberToResults(QString zippedFolderName) { } void TestRunner::restoreHighFidelityAppDataFolder() { +#ifdef Q_OS_WIN _appDataFolder.removeRecursively(); if (_savedAppDataFolder != QDir()) { _appDataFolder.rename(_savedAppDataFolder.path(), _appDataFolder.path()); } +#elif defined Q_OS_MAC + // TODO: find Mac equivalent of AppData +#endif } // Copies a folder recursively From 675334a105248363800fd3840dd95e1ccff49551 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Oct 2018 22:47:11 -0700 Subject: [PATCH 17/82] Do not need `-a` when using open with full path to app --- tools/auto-tester/src/TestRunner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 2bf304943b..1beebe29b1 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -365,7 +365,7 @@ void TestRunner::startLocalServerProcesses() { system(commandLine.toStdString().c_str()); #elif defined Q_OS_MAC - commandLine = "open -a \"" +_installationFolder + "/Sandbox.app\""; + commandLine = "open \"" +_installationFolder + "/Sandbox.app\""; system(commandLine.toStdString().c_str()); #endif @@ -395,7 +395,7 @@ void TestRunner::runInterfaceWithTestScript() { QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #elif defined Q_OS_MAC - QString commandLine = "open -a \"" +_installationFolder + "/interface.app\"" + " --args --url " + url + " --no-updater" + " --testScript " + testScript + + QString commandLine = "open \"" +_installationFolder + "/interface.app\"" + " --args --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #endif From 40a31b63a980eb4e34a54b87e4d0442e68dd245b Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 31 Oct 2018 14:48:27 -0700 Subject: [PATCH 18/82] Waits for Interface to finish --- tools/auto-tester/src/PythonInterface.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tools/auto-tester/src/PythonInterface.cpp b/tools/auto-tester/src/PythonInterface.cpp index c5878939cc..2866ca0b87 100644 --- a/tools/auto-tester/src/PythonInterface.cpp +++ b/tools/auto-tester/src/PythonInterface.cpp @@ -14,19 +14,6 @@ #include PythonInterface::PythonInterface() { - if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) { - QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH"); - if (!QFile::exists(_pythonPath + "/" + _pythonExe)) { - QMessageBox::critical(0, _pythonExe, QString("Python executable not found in ") + _pythonPath); - exit(-1); - } - - _pythonCommand = _pythonPath + "/" + _pythonExe; - } else { - QMessageBox::critical(0, "PYTHON_PATH not defined", - "Please set PYTHON_PATH to directory containing the Python executable"); - exit(-1); - } } QString PythonInterface::getPythonCommand() { From 1d67531a87b26832167b746a70e6e3fb3c0c9f90 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 31 Oct 2018 22:45:12 -0700 Subject: [PATCH 19/82] Improve UI --- tools/auto-tester/src/ui/AutoTester.ui | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/auto-tester/src/ui/AutoTester.ui b/tools/auto-tester/src/ui/AutoTester.ui index cf2ffd35cd..08f4b46723 100644 --- a/tools/auto-tester/src/ui/AutoTester.ui +++ b/tools/auto-tester/src/ui/AutoTester.ui @@ -43,7 +43,7 @@ - 3 + 0 @@ -198,7 +198,7 @@ 10 160 161 - 28 + 51 @@ -525,7 +525,7 @@ 128 95 - 21 + 31 31 @@ -539,7 +539,7 @@ - 160 + 170 100 451 21 @@ -554,9 +554,9 @@ - 200 + 190 180 - 120 + 131 20 @@ -573,7 +573,7 @@ 330 170 181 - 40 + 51 @@ -684,10 +684,10 @@ - 240 + 270 30 160 - 40 + 51 @@ -699,7 +699,7 @@ 150 42 - 81 + 111 17 @@ -803,7 +803,7 @@ 0 0 720 - 21 + 22 From 716bd8ebd2ffaa7fb183f74526ca042cc5e10171 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 31 Oct 2018 22:45:52 -0700 Subject: [PATCH 20/82] WIP - starting on AWS Interface --- tools/auto-tester/src/TestRunner.cpp | 93 ++++++++++++++++++---------- 1 file changed, 60 insertions(+), 33 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 1beebe29b1..1f31004b2f 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -20,7 +20,10 @@ extern AutoTester* autoTester; #include #include #endif + +// TODO: for debug #include + TestRunner::TestRunner(std::vector dayCheckboxes, std::vector timeEditCheckboxes, std::vector timeEdits, @@ -98,6 +101,51 @@ void TestRunner::setWorkingFolder() { _timer = new QTimer(this); connect(_timer, SIGNAL(timeout()), this, SLOT(checkTime())); _timer->start(30 * 1000); //time specified in ms + +#ifdef Q_OS_MAC + // Create MAC shell scripts + QFile script; + script.setFileName(_workingFolder + "/install_app.sh"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'install_app.sh'"); + exit(-1); + } + + QString installFolder = QString("\"") + _workingFolder + "/High_Fidelity\""; + if (!QDir().exists(installFolder)) { + QDir().mkdir(installFolder); + } + + // This script installs High Fidelity. It is run as "yes | install_app.sh... so "yes" is killed at the end + script.write("#/bin/sh\n\n"); + script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); + + script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/Sandbox.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + + script.write("hdiutil detach \"$VOLUME\"\n"); + script.write("killall yes\n"); + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + + // The Mac shell command returns immediately. This little script waits for a process to complete + script.setFileName(_workingFolder + "/waitForCompletion.sh"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'install_app.sh'"); + exit(-1); + } + + script.write("#/bin/sh\n\n"); + script.write("PROCESS=\"$1\"\n"); + script.write("while (pgrep $PROCESS)\n"); + script.write("do\n"); + script.write("\tsleep 2\n"); + script.write("done\n"); + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + #endif } void TestRunner::run() { @@ -185,31 +233,6 @@ void TestRunner::runInstaller() { QString commandLine = "\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder); #elif defined Q_OS_MAC - QFile script; - script.setFileName(_workingFolder + "/install_app.sh"); - if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { - QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), - "Could not open 'install_app.sh'"); - exit(-1); - } - - QString installFolder = QString("\"") + _workingFolder + "/High_Fidelity\""; - if (!QDir().exists(installFolder)) { - QDir().mkdir(installFolder); - } - - // This script installs High Fidelity. It is run as "yes | install_app.sh... so "yes" is killed at the end - script.write("#/bin/sh\n\n"); - script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); - - script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); - script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/Sandbox.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); - - script.write("hdiutil detach \"$VOLUME\"\n"); - script.write("killall yes\n"); - script.close(); - script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); - QString commandLine = "yes | " + _workingFolder + "/install_app.sh " + _workingFolder + "/HighFidelity-Beta-latest-dev.dmg"; #endif @@ -344,12 +367,11 @@ void TestRunner::killProcesses() { exit(-1); } #elif defined Q_OS_MAC - // TODO: this doesn't allow interface to run - //QString commandLine = "killall interface\n"; - //system(commandLine.toStdString().c_str()); + QString commandLine = QString("killall interface") + "; " + _workingFolder +"/waitForCompletion.sh interface"; + system(commandLine.toStdString().c_str()); - //commandLine = "killall Sandbox\n"; - //system(commandLine.toStdString().c_str()); + commandLine = QString("killall Sandbox") + "; " + _workingFolder +"/waitForCompletion.sh interface"; + system(commandLine.toStdString().c_str()); #endif } @@ -357,7 +379,8 @@ void TestRunner::startLocalServerProcesses() { QString commandLine; #ifdef Q_OS_WIN - commandLine = "start \"domain-server.exe\" \"" + QDir::toNativeSeparators(_installationFolder) + "\\domain-server.exe\""; + commandLine = + "start \"domain-server.exe\" \"" + QDir::toNativeSeparators(_installationFolder) + "\\domain-server.exe\""; system(commandLine.toStdString().c_str()); commandLine = @@ -395,8 +418,12 @@ void TestRunner::runInterfaceWithTestScript() { QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #elif defined Q_OS_MAC - QString commandLine = "open \"" +_installationFolder + "/interface.app\"" + " --args --url " + url + " --no-updater" + " --testScript " + testScript + - " quitWhenFinished --testResultsLocation " + _snapshotFolder; + QString commandLine = "open \"" +_installationFolder + "/interface.app\" --args" + + " --url " + url + + " --no-updater" + + " --testScript " + testScript + " quitWhenFinished" + + " --testResultsLocation " + _snapshotFolder + + "; " + _workingFolder +"/waitForCompletion.sh interface"; #endif // Helpful for debugging From 1c7c0dd0a02680fb80215587aff0154470733fb2 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 31 Oct 2018 23:07:44 -0700 Subject: [PATCH 21/82] Booboo... --- tools/auto-tester/src/PythonInterface.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/auto-tester/src/PythonInterface.cpp b/tools/auto-tester/src/PythonInterface.cpp index 2866ca0b87..c5878939cc 100644 --- a/tools/auto-tester/src/PythonInterface.cpp +++ b/tools/auto-tester/src/PythonInterface.cpp @@ -14,6 +14,19 @@ #include PythonInterface::PythonInterface() { + if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) { + QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH"); + if (!QFile::exists(_pythonPath + "/" + _pythonExe)) { + QMessageBox::critical(0, _pythonExe, QString("Python executable not found in ") + _pythonPath); + exit(-1); + } + + _pythonCommand = _pythonPath + "/" + _pythonExe; + } else { + QMessageBox::critical(0, "PYTHON_PATH not defined", + "Please set PYTHON_PATH to directory containing the Python executable"); + exit(-1); + } } QString PythonInterface::getPythonCommand() { From 6121d7022c302cc87223171e7c6de76629785a30 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 07:49:36 -0700 Subject: [PATCH 22/82] Renamed folder. Removed useless 'mkdir'. --- tools/auto-tester/src/AWSInterface.cpp | 51 +++++++++++++++++--------- tools/auto-tester/src/AWSInterface.h | 4 +- tools/auto-tester/src/Test.cpp | 6 +-- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/tools/auto-tester/src/AWSInterface.cpp b/tools/auto-tester/src/AWSInterface.cpp index 628db5329c..a5a72288de 100644 --- a/tools/auto-tester/src/AWSInterface.cpp +++ b/tools/auto-tester/src/AWSInterface.cpp @@ -22,11 +22,11 @@ AWSInterface::AWSInterface(QObject* parent) : QObject(parent) { } void AWSInterface::createWebPageFromResults(const QString& testResults, - const QString& workingDirectory, + const QString& snapshotDirectory, QCheckBox* updateAWSCheckBox, QLineEdit* urlLineEdit) { _testResults = testResults; - _workingDirectory = workingDirectory; + _snapshotDirectory = snapshotDirectory; _urlLineEdit = urlLineEdit; _urlLineEdit->setEnabled(false); @@ -44,14 +44,13 @@ void AWSInterface::extractTestFailuresFromZippedFolder() { // the folder will be called `TestResults--2018-10-02_16-54-11(9426)[DESKTOP-PMKNLSQ]` // and, this folder will be in the workign directory QStringList parts =_testResults.split('/'); - QString zipFolderName = _workingDirectory + "/" + parts[parts.length() - 1].split('.')[0]; + QString zipFolderName = _snapshotDirectory + "/" + parts[parts.length() - 1].split('.')[0]; if (QDir(zipFolderName).exists()) { QDir dir = zipFolderName; dir.removeRecursively(); } - QDir().mkdir(_workingDirectory); - JlCompress::extractDir(_testResults, _workingDirectory); + JlCompress::extractDir(_testResults, _snapshotDirectory); } void AWSInterface::createHTMLFile() { @@ -61,7 +60,7 @@ void AWSInterface::createHTMLFile() { QString filename = pathComponents[pathComponents.length() - 1]; _resultsFolder = filename.left(filename.length() - 4); - QString resultsPath = _workingDirectory + "/" + _resultsFolder + "/"; + QString resultsPath = _snapshotDirectory + "/" + _resultsFolder + "/"; QDir().mkdir(resultsPath); _htmlFilename = resultsPath + HTML_FILENAME; @@ -157,7 +156,7 @@ void AWSInterface::writeTable(QTextStream& stream) { // Note that failures are processed first, then successes QStringList originalNamesFailures; QStringList originalNamesSuccesses; - QDirIterator it1(_workingDirectory.toStdString().c_str()); + QDirIterator it1(_snapshotDirectory.toStdString().c_str()); while (it1.hasNext()) { QString nextDirectory = it1.next(); @@ -191,10 +190,10 @@ void AWSInterface::writeTable(QTextStream& stream) { newNamesSuccesses.append(originalNamesSuccesses[i].split("--tests.")[1]); } - _htmlFailuresFolder = _workingDirectory + "/" + _resultsFolder + "/" + FAILURES_FOLDER; + _htmlFailuresFolder = _snapshotDirectory + "/" + _resultsFolder + "/" + FAILURES_FOLDER; QDir().mkdir(_htmlFailuresFolder); - _htmlSuccessesFolder = _workingDirectory + "/" + _resultsFolder + "/" + SUCCESSES_FOLDER; + _htmlSuccessesFolder = _snapshotDirectory + "/" + _resultsFolder + "/" + SUCCESSES_FOLDER; QDir().mkdir(_htmlSuccessesFolder); for (int i = 0; i < newNamesFailures.length(); ++i) { @@ -321,7 +320,7 @@ void AWSInterface::createEntry(int index, const QString& testResult, QTextStream } void AWSInterface::updateAWS() { - QString filename = _workingDirectory + "/updateAWS.py"; + QString filename = _snapshotDirectory + "/updateAWS.py"; if (QFile::exists(filename)) { QFile::remove(filename); } @@ -352,14 +351,23 @@ void AWSInterface::updateAWS() { QStringList parts = nextDirectory.split('/'); QString filename = parts[parts.length() - 3] + "/" + parts[parts.length() - 2] + "/" + parts[parts.length() - 1]; - stream << "data = open('" << _workingDirectory << "/" << filename << "/" << "Actual Image.png" << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << filename << "/" + << "Actual Image.png" + << "', 'rb')\n"; + stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << filename << "/" << "Actual Image.png" << "', Body=data)\n\n"; - stream << "data = open('" << _workingDirectory << "/" << filename << "/" << "Expected Image.png" << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << filename << "/" + << "Expected Image.png" + << "', 'rb')\n"; + stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << filename << "/" << "Expected Image.png" << "', Body=data)\n\n"; if (QFile::exists(_htmlFailuresFolder + "/" + parts[parts.length() - 1] + "/Difference Image.png")) { - stream << "data = open('" << _workingDirectory << "/" << filename << "/" << "Difference Image.png" << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << filename << "/" + << "Difference Image.png" + << "', 'rb')\n"; + stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << filename << "/" << "Difference Image.png" << "', Body=data)\n\n"; } } @@ -378,19 +386,28 @@ void AWSInterface::updateAWS() { QStringList parts = nextDirectory.split('/'); QString filename = parts[parts.length() - 3] + "/" + parts[parts.length() - 2] + "/" + parts[parts.length() - 1]; - stream << "data = open('" << _workingDirectory << "/" << filename << "/" << "Actual Image.png" << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << filename << "/" + << "Actual Image.png" + << "', 'rb')\n"; + stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << filename << "/" << "Actual Image.png" << "', Body=data)\n\n"; - stream << "data = open('" << _workingDirectory << "/" << filename << "/" << "Expected Image.png" << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << filename << "/" + << "Expected Image.png" + << "', 'rb')\n"; + stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << filename << "/" << "Expected Image.png" << "', Body=data)\n\n"; if (QFile::exists(_htmlSuccessesFolder + "/" + parts[parts.length() - 1] + "/Difference Image.png")) { - stream << "data = open('" << _workingDirectory << "/" << filename << "/" << "Difference Image.png" << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << filename << "/" + << "Difference Image.png" + << "', 'rb')\n"; + stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << filename << "/" << "Difference Image.png" << "', Body=data)\n\n"; } } - stream << "data = open('" << _workingDirectory << "/" << _resultsFolder << "/" << HTML_FILENAME << "', 'rb')\n"; + stream << "data = open('" << _snapshotDirectory << "/" << _resultsFolder << "/" << HTML_FILENAME << "', 'rb')\n"; stream << "s3.Bucket('hifi-content').put_object(Bucket='" << AWS_BUCKET << "', Key='" << _resultsFolder << "/" << HTML_FILENAME << "', Body=data, ContentType='text/html')\n"; diff --git a/tools/auto-tester/src/AWSInterface.h b/tools/auto-tester/src/AWSInterface.h index c5be5f35bb..43299bd888 100644 --- a/tools/auto-tester/src/AWSInterface.h +++ b/tools/auto-tester/src/AWSInterface.h @@ -26,7 +26,7 @@ public: explicit AWSInterface(QObject* parent = 0); void createWebPageFromResults(const QString& testResults, - const QString& workingDirectory, + const QString& testDirectory, QCheckBox* updateAWSCheckBox, QLineEdit* urlLineEdit); @@ -49,7 +49,7 @@ public: private: QString _testResults; - QString _workingDirectory; + QString _snapshotDirectory; QString _resultsFolder; QString _htmlFailuresFolder; QString _htmlSuccessesFolder; diff --git a/tools/auto-tester/src/Test.cpp b/tools/auto-tester/src/Test.cpp index 582f6209af..2c262bec1e 100644 --- a/tools/auto-tester/src/Test.cpp +++ b/tools/auto-tester/src/Test.cpp @@ -1052,11 +1052,11 @@ void Test::createWebPage(QCheckBox* updateAWSCheckBox, QLineEdit* urlLineEdit) { return; } - QString tempDirectory = QFileDialog::getExistingDirectory(nullptr, "Please select a folder to store temporary files in", + QString snapshotDirectory = QFileDialog::getExistingDirectory(nullptr, "Please select a folder to store temporary files in", nullptr, QFileDialog::ShowDirsOnly); - if (tempDirectory.isNull()) { + if (snapshotDirectory.isNull()) { return; } - _awsInterface.createWebPageFromResults(testResults, tempDirectory, updateAWSCheckBox, urlLineEdit); + _awsInterface.createWebPageFromResults(testResults, snapshotDirectory, updateAWSCheckBox, urlLineEdit); } \ No newline at end of file From 8e3f2d360170a96c01e92c69fe8fb8b3fe420bef Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 08:17:35 -0700 Subject: [PATCH 23/82] Minor clean-up. --- tools/auto-tester/src/AWSInterface.cpp | 2 +- tools/auto-tester/src/AWSInterface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/src/AWSInterface.cpp b/tools/auto-tester/src/AWSInterface.cpp index a5a72288de..b6eef39b1d 100644 --- a/tools/auto-tester/src/AWSInterface.cpp +++ b/tools/auto-tester/src/AWSInterface.cpp @@ -42,7 +42,7 @@ void AWSInterface::createWebPageFromResults(const QString& testResults, void AWSInterface::extractTestFailuresFromZippedFolder() { // For a test results zip file called `D:/tt/TestResults--2018-10-02_16-54-11(9426)[DESKTOP-PMKNLSQ].zip` // the folder will be called `TestResults--2018-10-02_16-54-11(9426)[DESKTOP-PMKNLSQ]` - // and, this folder will be in the workign directory + // and, this folder will be in the working directory QStringList parts =_testResults.split('/'); QString zipFolderName = _snapshotDirectory + "/" + parts[parts.length() - 1].split('.')[0]; if (QDir(zipFolderName).exists()) { diff --git a/tools/auto-tester/src/AWSInterface.h b/tools/auto-tester/src/AWSInterface.h index 43299bd888..f4084f1a14 100644 --- a/tools/auto-tester/src/AWSInterface.h +++ b/tools/auto-tester/src/AWSInterface.h @@ -26,7 +26,7 @@ public: explicit AWSInterface(QObject* parent = 0); void createWebPageFromResults(const QString& testResults, - const QString& testDirectory, + const QString& snapshotDirectory, QCheckBox* updateAWSCheckBox, QLineEdit* urlLineEdit); From 701f3274ce3ffe30efd0acc56f362c54cd593e09 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 08:47:56 -0700 Subject: [PATCH 24/82] Updated IMPORTANT information for running Python3 on Mac. --- tools/auto-tester/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/README.md b/tools/auto-tester/README.md index e029955edc..8851524ffd 100644 --- a/tools/auto-tester/README.md +++ b/tools/auto-tester/README.md @@ -14,7 +14,7 @@ Auto-tester has 5 functions, separated into 4 tabs: ## Installation ### Executable -1. Download the installer by browsing to [here](). +1. On Windows: download the installer by browsing to [here](). 2. Double click on the installer and install to a convenient location ![](./setup_7z.PNG) 3. To run the auto-tester, double click **auto-tester.exe**. @@ -26,7 +26,9 @@ Python 3 can be downloaded from: 2. Linux (source) (**Gzipped source tarball**) 3. Mac (**macOS 64-bit/32-bit installer** or **macOS 64-bit/32-bit installer**) -After installation - create an environment variable called PYTHON_PATH and set it to the folder containing the Python executable. +On Windows: after installation - create an environment variable called PYTHON_PATH and set it to the folder containing the Python executable. + +On Mac: after installation - run `open "/Applications/Python 3.6/Install Certificates.command"`. This is needed because the Mac Python supplied no longer links with the deprecated Apple-supplied system OpenSSL libraries but rather supplies a private copy of OpenSSL 1.0.2 which does not automatically access the system default root certificates. ### AWS interface #### Windows 1. Download the AWS CLI from `https://aws.amazon.com/cli/` From 61ba685022e2d9764c6df00a4a5a41795f014330 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 12:17:53 -0700 Subject: [PATCH 25/82] Set Python command to `usr/local/python3`. --- tools/auto-tester/src/PythonInterface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/auto-tester/src/PythonInterface.cpp b/tools/auto-tester/src/PythonInterface.cpp index c5878939cc..9832ac9f8d 100644 --- a/tools/auto-tester/src/PythonInterface.cpp +++ b/tools/auto-tester/src/PythonInterface.cpp @@ -14,6 +14,7 @@ #include PythonInterface::PythonInterface() { +#ifdef Q_OS_WIN if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) { QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH"); if (!QFile::exists(_pythonPath + "/" + _pythonExe)) { @@ -27,6 +28,14 @@ PythonInterface::PythonInterface() { "Please set PYTHON_PATH to directory containing the Python executable"); exit(-1); } +#elif defined Q_OS_MAC + _pythonCommand = "/usr/local/bin/python3"; + if (!QFile::exists(_pythonCommand)) { + QMessageBox::critical(0, "PYTHON_PATH not defined", + "python3 not found at " + _pythonCommand); + exit(-1); + } +#endif } QString PythonInterface::getPythonCommand() { From c1a01caeb8b97aef24ff1a4d3149ceff36395551 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 12:18:55 -0700 Subject: [PATCH 26/82] Added missing `!` --- tools/auto-tester/src/TestRunner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 1f31004b2f..7d2d57b0bc 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -118,7 +118,7 @@ void TestRunner::setWorkingFolder() { } // This script installs High Fidelity. It is run as "yes | install_app.sh... so "yes" is killed at the end - script.write("#/bin/sh\n\n"); + script.write("#!/bin/sh\n\n"); script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); @@ -137,7 +137,7 @@ void TestRunner::setWorkingFolder() { exit(-1); } - script.write("#/bin/sh\n\n"); + script.write("#!/bin/sh\n\n"); script.write("PROCESS=\"$1\"\n"); script.write("while (pgrep $PROCESS)\n"); script.write("do\n"); From 7d9b6a3f1052f523344527a37f50d2d56575bdf1 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 12:19:25 -0700 Subject: [PATCH 27/82] Can read runs from TestRail. --- tools/auto-tester/src/TestRailInterface.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/auto-tester/src/TestRailInterface.cpp b/tools/auto-tester/src/TestRailInterface.cpp index f943935539..912f72492c 100644 --- a/tools/auto-tester/src/TestRailInterface.cpp +++ b/tools/auto-tester/src/TestRailInterface.cpp @@ -1117,9 +1117,14 @@ void TestRailInterface::getRunsFromTestRail() { [=](int exitCode, QProcess::ExitStatus exitStatus) { updateRunsComboData(exitCode, exitStatus); }); connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater())); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << filename; - process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + filename; + process->start("sh", parameters); + process->waitForFinished(); +#endif } void TestRailInterface::createTestRailRun(const QString& outputDirectory) { @@ -1164,4 +1169,4 @@ void TestRailInterface::extractTestFailuresFromZippedFolder(const QString& testR QDir dir = tempSubDirectory; dir.mkdir(tempSubDirectory); JlCompress::extractDir(testResults, tempSubDirectory); -} \ No newline at end of file +} From 6e8338fade6c7f131a23eed7c7d91a9daae9443f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 12:55:28 -0700 Subject: [PATCH 28/82] Completed Python commands for Mac. --- tools/auto-tester/src/TestRailInterface.cpp | 26 ++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/tools/auto-tester/src/TestRailInterface.cpp b/tools/auto-tester/src/TestRailInterface.cpp index 912f72492c..a0c0d74526 100644 --- a/tools/auto-tester/src/TestRailInterface.cpp +++ b/tools/auto-tester/src/TestRailInterface.cpp @@ -357,8 +357,13 @@ void TestRailInterface::createAddTestCasesPythonScript(const QString& testDirect connect(process, static_cast(&QProcess::finished), this, [=](int exitCode, QProcess::ExitStatus exitStatus) { _busyWindow.hide(); }); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << _outputDirectory + "/addTestCases.py"; process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + _outputDirectory + "/addTestCases.py"; + process->start("sh", parameters); +#endif } } @@ -482,8 +487,13 @@ void TestRailInterface::addRun() { connect(process, static_cast(&QProcess::finished), this, [=](int exitCode, QProcess::ExitStatus exitStatus) { _busyWindow.hide(); }); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << _outputDirectory + "/addRun.py"; process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + _outputDirectory + "/addRun.py"; + process->start("sh", parameters); +#endif } } @@ -586,8 +596,13 @@ void TestRailInterface::updateRunWithResults() { connect(process, static_cast(&QProcess::finished), this, [=](int exitCode, QProcess::ExitStatus exitStatus) { _busyWindow.hide(); }); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << _outputDirectory + "/updateRunWithResults.py"; process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + _outputDirectory + "/updateRunWithResults.py"; + process->start("sh", parameters); +#endif } } @@ -759,8 +774,13 @@ void TestRailInterface::getReleasesFromTestRail() { [=](int exitCode, QProcess::ExitStatus exitStatus) { updateReleasesComboData(exitCode, exitStatus); }); connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater())); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << filename; process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + filename; + process->start("sh", parameters); +#endif } void TestRailInterface::createTestSuitePython(const QString& testDirectory, @@ -1078,8 +1098,13 @@ void TestRailInterface::getTestSectionsFromTestRail() { [=](int exitCode, QProcess::ExitStatus exitStatus) { updateSectionsComboData(exitCode, exitStatus); }); connect(process, SIGNAL(finished(int)), process, SLOT(deleteLater())); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << filename; process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + filename; + process->start("sh", parameters); +#endif } void TestRailInterface::getRunsFromTestRail() { @@ -1123,7 +1148,6 @@ void TestRailInterface::getRunsFromTestRail() { #elif defined Q_OS_MAC QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + filename; process->start("sh", parameters); - process->waitForFinished(); #endif } From 22ae1114b5cfc7f071bd9793e3783831618fa4cf Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 14:20:05 -0700 Subject: [PATCH 29/82] Updated Python command for Mac. --- tools/auto-tester/src/AWSInterface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/auto-tester/src/AWSInterface.cpp b/tools/auto-tester/src/AWSInterface.cpp index b6eef39b1d..e43ef8dc75 100644 --- a/tools/auto-tester/src/AWSInterface.cpp +++ b/tools/auto-tester/src/AWSInterface.cpp @@ -425,6 +425,11 @@ void AWSInterface::updateAWS() { connect(process, static_cast(&QProcess::finished), this, [=](int exitCode, QProcess::ExitStatus exitStatus) { _busyWindow.hide(); }); +#ifdef Q_OS_WIN QStringList parameters = QStringList() << filename ; process->start(_pythonCommand, parameters); +#elif defined Q_OS_MAC + QStringList parameters = QStringList() << "-c" << _pythonCommand + " " + filename; + process->start("sh", parameters); +#endif } From ebc37610d3f450675bc7fc7eaf48ac1aed11d36e Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 15:07:19 -0700 Subject: [PATCH 30/82] Updated for MAC. --- tools/auto-tester/README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/tools/auto-tester/README.md b/tools/auto-tester/README.md index 8851524ffd..0bec83d703 100644 --- a/tools/auto-tester/README.md +++ b/tools/auto-tester/README.md @@ -26,9 +26,13 @@ Python 3 can be downloaded from: 2. Linux (source) (**Gzipped source tarball**) 3. Mac (**macOS 64-bit/32-bit installer** or **macOS 64-bit/32-bit installer**) -On Windows: after installation - create an environment variable called PYTHON_PATH and set it to the folder containing the Python executable. +#### Windows +After installation - create an environment variable called PYTHON_PATH and set it to the folder containing the Python executable. + +#### Mac +After installation - run `open "/Applications/Python 3.6/Install Certificates.command"`. This is needed because the Mac Python supplied no longer links with the deprecated Apple-supplied system OpenSSL libraries but rather supplies a private copy of OpenSSL 1.0.2 which does not automatically access the system default root certificates. +Verify that `/usr/local/bin/python3` exists. -On Mac: after installation - run `open "/Applications/Python 3.6/Install Certificates.command"`. This is needed because the Mac Python supplied no longer links with the deprecated Apple-supplied system OpenSSL libraries but rather supplies a private copy of OpenSSL 1.0.2 which does not automatically access the system default root certificates. ### AWS interface #### Windows 1. Download the AWS CLI from `https://aws.amazon.com/cli/` @@ -38,8 +42,23 @@ On Mac: after installation - run `open "/Applications/Python 3.6/Install Certifi 1. Enter the secret key 1. Leave region name and ouput format as default [None] -1. Install the latest release of Boto3 via pip: ->pip install boto3 +1. Install the latest release of Boto3 via pip: +pip install boto3 +#### Mac +1. Install pip with the script provided by the Python Packaging Authority: +$ curl -O https://bootstrap.pypa.io/get-pip.py +$ python3 get-pip.py --user + +1. Use pip to install the AWS CLI. +$ pip3 install awscli --upgrade --user +This will install aws in your user. For user XXX, aws will be located in /Users/XXX/Library/Python/3.7/bin +1. Open a new command prompt and run `aws configure` +1. Enter the AWS account number +1. Enter the secret key +1. Leave region name and ouput format as default [None] +1. Install the latest release of Boto3 via pip: +pip3 install boto3 + # Create ![](./Create.PNG) From d851720cb01cc63566e1d741aaf52f49f0b8299c Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 16:57:28 -0700 Subject: [PATCH 31/82] Added method to detect OS type. Needed for testing. --- interface/src/scripting/TestScriptingInterface.cpp | 10 ++++++++++ interface/src/scripting/TestScriptingInterface.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index 52f6a3ebc0..36846a1fef 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -198,4 +198,14 @@ void TestScriptingInterface::setOtherAvatarsReplicaCount(int count) { int TestScriptingInterface::getOtherAvatarsReplicaCount() { return qApp->getOtherAvatarsReplicaCount(); +} + +QString TestScriptingInterface::getOperatingSystemType() { +#ifdef Q_OS_WIN + return "WINDOWS"; +#elif #defined Q_MAC_OS + return "MACOS"; +#else + return "UNKNOWN"; +#endif } \ No newline at end of file diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index 4a1d1a3eeb..a40826bd25 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -163,6 +163,12 @@ public slots: */ Q_INVOKABLE int getOtherAvatarsReplicaCount(); + /**jsdoc + * Returns the Operating Sytem type + * @function Test.getOperatingSystemType + */ + QString getOperatingSystemType(); + private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation; From 470a4904948d16fba5a6944a0045aef7c252d722 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 17:31:10 -0700 Subject: [PATCH 32/82] Typo. --- interface/src/scripting/TestScriptingInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index 36846a1fef..a31e43d6c6 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -203,9 +203,9 @@ int TestScriptingInterface::getOtherAvatarsReplicaCount() { QString TestScriptingInterface::getOperatingSystemType() { #ifdef Q_OS_WIN return "WINDOWS"; -#elif #defined Q_MAC_OS +#elif defined Q_MAC_OS return "MACOS"; #else return "UNKNOWN"; #endif -} \ No newline at end of file +} From cd2194ad539467285e4b800c0f9863a6e75adbef Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 17:56:45 -0700 Subject: [PATCH 33/82] Correction for Linux --- tools/auto-tester/src/TestRunner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 7d2d57b0bc..906cb3ab06 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -229,11 +229,11 @@ void TestRunner::runInstaller() { QString installerFullPath = _workingFolder + "/" + _installerFilename; + QString commandLine; #ifdef Q_OS_WIN - QString commandLine = - "\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder); + commandLine = "\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder); #elif defined Q_OS_MAC - QString commandLine = "yes | " + _workingFolder + "/install_app.sh " + _workingFolder + "/HighFidelity-Beta-latest-dev.dmg"; + commandLine = "yes | " + _workingFolder + "/install_app.sh " + _workingFolder + "/HighFidelity-Beta-latest-dev.dmg"; #endif installerWorker->setCommandLine(commandLine); From 58bac436babc728a45b7a75a35c2c8143c4522fe Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 1 Nov 2018 18:14:29 -0700 Subject: [PATCH 34/82] Fixed Linux error --- tools/auto-tester/src/TestRunner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 906cb3ab06..b2ef00647f 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -405,7 +405,7 @@ void TestRunner::runInterfaceWithTestScript() { #ifdef Q_OS_WIN url = "hifi://localhost"; #elif defined Q_OS_MAC - // TODO: Find out Mac equivalent of AppData, then this win't be needed + // TODO: Find out Mac equivalent of AppData, then this won't be needed url = "hifi://localhost/9999,9999,9999"; #endif } @@ -413,12 +413,13 @@ void TestRunner::runInterfaceWithTestScript() { QString testScript = QString("https://raw.githubusercontent.com/") + _user + "/hifi_tests/" + _branch + "/tests/testRecursive.js"; + QString commandLine; #ifdef Q_OS_WIN QString exeFile = QString("\"") + QDir::toNativeSeparators(_installationFolder) + "\\interface.exe\""; - QString commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + + commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #elif defined Q_OS_MAC - QString commandLine = "open \"" +_installationFolder + "/interface.app\" --args" + + commandLine = "open \"" +_installationFolder + "/interface.app\" --args" + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished" + From c7353e6c590c033e57c13ff8d49cbd992d9357f2 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 2 Nov 2018 09:57:58 -0700 Subject: [PATCH 35/82] Added `setWindowSize` - FOR TESTING ON MAC --- interface/src/scripting/TestScriptingInterface.cpp | 4 ++++ interface/src/scripting/TestScriptingInterface.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index a31e43d6c6..968c5b8001 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -209,3 +209,7 @@ QString TestScriptingInterface::getOperatingSystemType() { return "UNKNOWN"; #endif } + +void TestScriptingInterface::setWindowSize(int width, int height) { + qApp->getWindow()->resize(width, height); +} \ No newline at end of file diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index a40826bd25..8dbfded39c 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -166,9 +166,16 @@ public slots: /**jsdoc * Returns the Operating Sytem type * @function Test.getOperatingSystemType + * @returns {string} "WINDOWS", "MACOS" or "UNKNOWN" */ QString getOperatingSystemType(); + /**jsdoc + * Sets the size of the Window on desktop + * @function Test.getOperatingSystemType + */ + void setWindowSize(int width, int height); + private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation; From 70c0addc3f7c306e5fbd36485348291ca173612b Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 2 Nov 2018 10:47:17 -0700 Subject: [PATCH 36/82] Removed `setWindowSize` - crashes on both Windows and Mac. Fixed typo. --- interface/src/scripting/TestScriptingInterface.cpp | 6 +----- interface/src/scripting/TestScriptingInterface.h | 6 ------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index 968c5b8001..a9ba165037 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -203,13 +203,9 @@ int TestScriptingInterface::getOtherAvatarsReplicaCount() { QString TestScriptingInterface::getOperatingSystemType() { #ifdef Q_OS_WIN return "WINDOWS"; -#elif defined Q_MAC_OS +#elif defined Q_OS_MAC return "MACOS"; #else return "UNKNOWN"; #endif } - -void TestScriptingInterface::setWindowSize(int width, int height) { - qApp->getWindow()->resize(width, height); -} \ No newline at end of file diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index 8dbfded39c..26e967c9b5 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -170,12 +170,6 @@ public slots: */ QString getOperatingSystemType(); - /**jsdoc - * Sets the size of the Window on desktop - * @function Test.getOperatingSystemType - */ - void setWindowSize(int width, int height); - private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation; From 51272d8fec68d8831f4c591ddee328fa24405ed7 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 2 Nov 2018 13:09:07 -0700 Subject: [PATCH 37/82] Added setGeometry script command. --- interface/src/Application.cpp | 12 ++++++++++++ interface/src/Application.h | 6 ++++++ interface/src/scripting/TestScriptingInterface.cpp | 4 ++++ interface/src/scripting/TestScriptingInterface.h | 10 ++++++++++ 4 files changed, 32 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7cd91d76a0..30b5e3ed5f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3636,6 +3636,12 @@ void Application::onPresent(quint32 frameCount) { if (_renderEventHandler && !isAboutToQuit() && _pendingRenderEvent.compare_exchange_strong(expected, true)) { postEvent(_renderEventHandler, new QEvent((QEvent::Type)ApplicationEvent::Render)); } + + // This is done here so it won't be during a resize/move event + if (_setGeometryRequested) { + _setGeometryRequested = false; + _window->setGeometry(requestedGeometry); + } } static inline bool isKeyEvent(QEvent::Type type) { @@ -8578,6 +8584,12 @@ void Application::copyToClipboard(const QString& text) { QApplication::clipboard()->setText(text); } +void Application::setGeometry(int x, int y, int width, int height) { + // Note that calling setGeometry inside resizeEvent() or moveEvent() can cause infinite recursion + requestedGeometry = QRect(x, y, width, height); + _setGeometryRequested = true; +} + #if defined(Q_OS_ANDROID) void Application::beforeEnterBackground() { auto nodeList = DependencyManager::get(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 14e30b8006..cd5d62c106 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -315,6 +315,8 @@ public: Q_INVOKABLE void copyToClipboard(const QString& text); + void setGeometry(int x, int y, int width, int height); + int getOtherAvatarsReplicaCount() { return DependencyManager::get()->getReplicaCount(); } void setOtherAvatarsReplicaCount(int count) { DependencyManager::get()->setReplicaCount(count); } @@ -784,5 +786,9 @@ private: bool _showTrackedObjects { false }; bool _prevShowTrackedObjects { false }; + + // Data for the setGeometry script command + bool _setGeometryRequested{ false }; + QRect requestedGeometry; }; #endif // hifi_Application_h diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index a9ba165037..74b03faf83 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -209,3 +209,7 @@ QString TestScriptingInterface::getOperatingSystemType() { return "UNKNOWN"; #endif } + +void TestScriptingInterface::setGeometry(int x, int y, int width, int height) { + qApp->setGeometry(x, y, width, height); +} \ No newline at end of file diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index 26e967c9b5..6c2c542f33 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -170,6 +170,16 @@ public slots: */ QString getOperatingSystemType(); + /**jsdoc + * Sets the position and size of the window on desktop. All units are pixels + * @function Test.setGeometry + * @param {int} x - Distance of window from left edge + * @param {int} y - Distance of window from top edge + * @param {int} width - Width of window + * @param {int} height - Height of window + */ + void setGeometry(int x, int y, int width, int height); + private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation; From 562c9b11964dccfb53712653591ef6a59a869630 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 2 Nov 2018 13:35:38 -0700 Subject: [PATCH 38/82] "works" on Mac --- interface/src/Application.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 30b5e3ed5f..d5d99a34b5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3636,12 +3636,6 @@ void Application::onPresent(quint32 frameCount) { if (_renderEventHandler && !isAboutToQuit() && _pendingRenderEvent.compare_exchange_strong(expected, true)) { postEvent(_renderEventHandler, new QEvent((QEvent::Type)ApplicationEvent::Render)); } - - // This is done here so it won't be during a resize/move event - if (_setGeometryRequested) { - _setGeometryRequested = false; - _window->setGeometry(requestedGeometry); - } } static inline bool isKeyEvent(QEvent::Type type) { @@ -4810,6 +4804,12 @@ void Application::idle() { } } + // This is done here so it won't be during a resize/move event + if (_setGeometryRequested) { + _setGeometryRequested = false; + _window->setGeometry(requestedGeometry); + } + _overlayConductor.update(secondsSinceLastUpdate); _gameLoopCounter.increment(); From c0e7a4348bf1ce30a00a86ccc036fc7a8f75de12 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 5 Nov 2018 22:10:20 -0500 Subject: [PATCH 39/82] Reverted changes to Interface. --- interface/src/Application.cpp | 14 +------------- interface/src/Application.h | 6 ------ .../src/scripting/TestScriptingInterface.cpp | 14 -------------- .../src/scripting/TestScriptingInterface.h | 17 ----------------- 4 files changed, 1 insertion(+), 50 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d5d99a34b5..9f69bab82c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4803,13 +4803,7 @@ void Application::idle() { _idleLoopStdev.reset(); } } - - // This is done here so it won't be during a resize/move event - if (_setGeometryRequested) { - _setGeometryRequested = false; - _window->setGeometry(requestedGeometry); - } - + _overlayConductor.update(secondsSinceLastUpdate); _gameLoopCounter.increment(); @@ -8584,12 +8578,6 @@ void Application::copyToClipboard(const QString& text) { QApplication::clipboard()->setText(text); } -void Application::setGeometry(int x, int y, int width, int height) { - // Note that calling setGeometry inside resizeEvent() or moveEvent() can cause infinite recursion - requestedGeometry = QRect(x, y, width, height); - _setGeometryRequested = true; -} - #if defined(Q_OS_ANDROID) void Application::beforeEnterBackground() { auto nodeList = DependencyManager::get(); diff --git a/interface/src/Application.h b/interface/src/Application.h index cd5d62c106..14e30b8006 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -315,8 +315,6 @@ public: Q_INVOKABLE void copyToClipboard(const QString& text); - void setGeometry(int x, int y, int width, int height); - int getOtherAvatarsReplicaCount() { return DependencyManager::get()->getReplicaCount(); } void setOtherAvatarsReplicaCount(int count) { DependencyManager::get()->setReplicaCount(count); } @@ -786,9 +784,5 @@ private: bool _showTrackedObjects { false }; bool _prevShowTrackedObjects { false }; - - // Data for the setGeometry script command - bool _setGeometryRequested{ false }; - QRect requestedGeometry; }; #endif // hifi_Application_h diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index 74b03faf83..c3aeb2643b 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -199,17 +199,3 @@ void TestScriptingInterface::setOtherAvatarsReplicaCount(int count) { int TestScriptingInterface::getOtherAvatarsReplicaCount() { return qApp->getOtherAvatarsReplicaCount(); } - -QString TestScriptingInterface::getOperatingSystemType() { -#ifdef Q_OS_WIN - return "WINDOWS"; -#elif defined Q_OS_MAC - return "MACOS"; -#else - return "UNKNOWN"; -#endif -} - -void TestScriptingInterface::setGeometry(int x, int y, int width, int height) { - qApp->setGeometry(x, y, width, height); -} \ No newline at end of file diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index 6c2c542f33..4a1d1a3eeb 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -163,23 +163,6 @@ public slots: */ Q_INVOKABLE int getOtherAvatarsReplicaCount(); - /**jsdoc - * Returns the Operating Sytem type - * @function Test.getOperatingSystemType - * @returns {string} "WINDOWS", "MACOS" or "UNKNOWN" - */ - QString getOperatingSystemType(); - - /**jsdoc - * Sets the position and size of the window on desktop. All units are pixels - * @function Test.setGeometry - * @param {int} x - Distance of window from left edge - * @param {int} y - Distance of window from top edge - * @param {int} width - Width of window - * @param {int} height - Height of window - */ - void setGeometry(int x, int y, int width, int height); - private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation; From e9a636d751f15c677a1baf4dfc33fd24190070e4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 5 Nov 2018 22:13:02 -0500 Subject: [PATCH 40/82] Revert... --- interface/src/Application.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 9f69bab82c..69d114e51b 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4803,7 +4803,6 @@ void Application::idle() { _idleLoopStdev.reset(); } } - _overlayConductor.update(secondsSinceLastUpdate); _gameLoopCounter.increment(); From ebdd443646cfc38849e285d8ab6efdd8f7bb71b5 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 6 Nov 2018 10:19:27 -0500 Subject: [PATCH 41/82] New resize method for Mac. --- tools/auto-tester/src/TestRunner.cpp | 62 ++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 4 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index b2ef00647f..3781024a63 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -129,11 +129,11 @@ void TestRunner::setWorkingFolder() { script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); - // The Mac shell command returns immediately. This little script waits for a process to complete - script.setFileName(_workingFolder + "/waitForCompletion.sh"); + // This script waits for a process to start + script.setFileName(_workingFolder + "/waitForStart.sh"); if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), - "Could not open 'install_app.sh'"); + "Could not open 'waitForStart.sh'"); exit(-1); } @@ -145,7 +145,55 @@ void TestRunner::setWorkingFolder() { script.write("done\n"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); - #endif + + // The Mac shell command returns immediately. This little script waits for a process to complete + script.setFileName(_workingFolder + "/waitForCompletion.sh"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'waitForCompletion.sh'"); + exit(-1); + } + + script.write("#!/bin/sh\n\n"); + script.write("PROCESS=\"$1\"\n"); + script.write("while (pgrep $PROCESS)\n"); + script.write("do\n"); + script.write("\tsleep 2\n"); + script.write("done\n"); + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + + // Create an AppleScript to resize Interface. This is needed so that snapshots taken + // with the primary camera will be the correct size. + // This will be run from a normal shell script + script.setFileName(_workingFolder + "/setInterfaceSizeAndPosition.scpt"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'setInterfaceSizeAndPosition.scpt'"); + exit(-1); + } + + script.write("set width to 960\n"); + script.write("set height to 540\n"); + script.write("set x to 100\n"); + script.write("set y to 100\n\n"); + script.write("tell application \"System Events\" to tell application process \"interface\" to tell window 1 to set {size, position} to {{width, height}, {x, y}})\n"); + + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + + script.setFileName(_workingFolder + "/setInterfaceSizeAndPosition.sh"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'setInterfaceSizeAndPosition.sh'"); + exit(-1); + } + + script.write("#!/bin/sh\n\n"); + script.write((_workingFolder + "/osascript " + _workingFolder + "/setInterfaceSizeAndPosition.scpt\n").toStdString().c_str()); + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); +#endif } void TestRunner::run() { @@ -419,11 +467,17 @@ void TestRunner::runInterfaceWithTestScript() { commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished --testResultsLocation " + _snapshotFolder; #elif defined Q_OS_MAC + // On The Mac, we need to resize Interface. The Interface window opens a few seconds after the process has started, + // so we wait another 10 seconds + // The shell closes if we don't wait for completion, hence the final line commandLine = "open \"" +_installationFolder + "/interface.app\" --args" + " --url " + url + " --no-updater" + " --testScript " + testScript + " quitWhenFinished" + " --testResultsLocation " + _snapshotFolder + + "; " + _workingFolder +"/waitForStart.sh interface" + + "; " + "sleep 10" + + "; " + _workingFolder +"/setInterfaceSizeAndPosition.sh" + "; " + _workingFolder +"/waitForCompletion.sh interface"; #endif From 189a799a3a1f8a672983b48b782a933683f00d36 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 7 Nov 2018 08:58:38 -0800 Subject: [PATCH 42/82] Added method to detect OS type. Needed for running automated tests. --- interface/src/scripting/TestScriptingInterface.cpp | 10 ++++++++++ interface/src/scripting/TestScriptingInterface.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/interface/src/scripting/TestScriptingInterface.cpp b/interface/src/scripting/TestScriptingInterface.cpp index c3aeb2643b..a9ba165037 100644 --- a/interface/src/scripting/TestScriptingInterface.cpp +++ b/interface/src/scripting/TestScriptingInterface.cpp @@ -199,3 +199,13 @@ void TestScriptingInterface::setOtherAvatarsReplicaCount(int count) { int TestScriptingInterface::getOtherAvatarsReplicaCount() { return qApp->getOtherAvatarsReplicaCount(); } + +QString TestScriptingInterface::getOperatingSystemType() { +#ifdef Q_OS_WIN + return "WINDOWS"; +#elif defined Q_OS_MAC + return "MACOS"; +#else + return "UNKNOWN"; +#endif +} diff --git a/interface/src/scripting/TestScriptingInterface.h b/interface/src/scripting/TestScriptingInterface.h index 4a1d1a3eeb..26e967c9b5 100644 --- a/interface/src/scripting/TestScriptingInterface.h +++ b/interface/src/scripting/TestScriptingInterface.h @@ -163,6 +163,13 @@ public slots: */ Q_INVOKABLE int getOtherAvatarsReplicaCount(); + /**jsdoc + * Returns the Operating Sytem type + * @function Test.getOperatingSystemType + * @returns {string} "WINDOWS", "MACOS" or "UNKNOWN" + */ + QString getOperatingSystemType(); + private: bool waitForCondition(qint64 maxWaitMs, std::function condition); QString _testResultsLocation; From f0dd07294e0132eb8ffb83f3f10ecd84da226d4b Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 7 Nov 2018 15:10:01 -0800 Subject: [PATCH 43/82] Added the no-login option. --- interface/src/Application.cpp | 40 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5caf58e992..155ef3549b 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2337,23 +2337,29 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo connect(&AndroidHelper::instance(), &AndroidHelper::enterForeground, this, &Application::enterForeground); AndroidHelper::instance().notifyLoadComplete(); #else - static int CHECK_LOGIN_TIMER = 3000; - QTimer* checkLoginTimer = new QTimer(this); - checkLoginTimer->setInterval(CHECK_LOGIN_TIMER); - checkLoginTimer->setSingleShot(true); - connect(checkLoginTimer, &QTimer::timeout, this, []() { - auto accountManager = DependencyManager::get(); - auto dialogsManager = DependencyManager::get(); - if (!accountManager->isLoggedIn()) { - Setting::Handle{"loginDialogPoppedUp", false}.set(true); - dialogsManager->showLoginDialog(); - QJsonObject loginData = {}; - loginData["action"] = "login dialog shown"; - UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData); - } - }); - Setting::Handle{"loginDialogPoppedUp", false}.set(false); - checkLoginTimer->start(); + // Do not show login dialog if requested not to on the command line + const QString HIFI_NO_LOGIN_COMMAND_LINE_KEY = "--no-login-suggestion"; + int index = arguments().indexOf(HIFI_NO_LOGIN_COMMAND_LINE_KEY); + if (index == -1) { + // request not found + static int CHECK_LOGIN_TIMER = 3000; + QTimer* checkLoginTimer = new QTimer(this); + checkLoginTimer->setInterval(CHECK_LOGIN_TIMER); + checkLoginTimer->setSingleShot(true); + connect(checkLoginTimer, &QTimer::timeout, this, []() { + auto accountManager = DependencyManager::get(); + auto dialogsManager = DependencyManager::get(); + if (!accountManager->isLoggedIn()) { + Setting::Handle{"loginDialogPoppedUp", false}.set(true); + dialogsManager->showLoginDialog(); + QJsonObject loginData = {}; + loginData["action"] = "login dialog shown"; + UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData); + } + }); + Setting::Handle{"loginDialogPoppedUp", false}.set(false); + checkLoginTimer->start(); + } #endif } From dd7ce2cfffbdc5693ab7c4e256d92a00a464306e Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 8 Nov 2018 08:37:44 -0800 Subject: [PATCH 44/82] Enable GitHub fields correctly on MAC --- tools/auto-tester/src/ui/AutoTester.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/auto-tester/src/ui/AutoTester.cpp b/tools/auto-tester/src/ui/AutoTester.cpp index d49f3aaa1c..9eac1a35e5 100644 --- a/tools/auto-tester/src/ui/AutoTester.cpp +++ b/tools/auto-tester/src/ui/AutoTester.cpp @@ -97,7 +97,12 @@ void AutoTester::startTestsEvaluation(const bool isRunningFromCommandLine, } void AutoTester::on_tabWidget_currentChanged(int index) { +// Enable the GitHub edit boxes as required +#ifdef Q_OS_WIN if (index == 0 || index == 2 || index == 3) { +#elif defined Q_OS_MAC + if (index == 0 || index == 1 || index == 2) { +#endif _ui.userLineEdit->setDisabled(false); _ui.branchLineEdit->setDisabled(false); } else { @@ -307,4 +312,4 @@ void AutoTester::updateStatusLabel(const QString& status) { void AutoTester::appendLogWindow(const QString& message) { _ui.plainTextEdit->appendPlainText(message); -} \ No newline at end of file +} From 8b2287126af908a12609e21e559bb2334e4c54d1 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 8 Nov 2018 08:38:44 -0800 Subject: [PATCH 45/82] WIP - working on MAC --- tools/auto-tester/src/TestRunner.cpp | 180 +++++++++++++++++---------- tools/auto-tester/src/TestRunner.h | 14 ++- 2 files changed, 123 insertions(+), 71 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index 3781024a63..b947f2544a 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -43,27 +43,29 @@ TestRunner::TestRunner(std::vector dayCheckboxes, _url = url; _runNow = runNow; - installerThread = new QThread(); - installerWorker = new Worker(); - installerWorker->moveToThread(installerThread); - installerThread->start(); - connect(this, SIGNAL(startInstaller()), installerWorker, SLOT(runCommand())); - connect(installerWorker, SIGNAL(commandComplete()), this, SLOT(installationComplete())); + _installerThread = new QThread(); + _installerWorker = new Worker(); + + _installerWorker->moveToThread(_installerThread); + _installerThread->start(); + connect(this, SIGNAL(startInstaller()), _installerWorker, SLOT(runCommand())); + connect(_installerWorker, SIGNAL(commandComplete()), this, SLOT(installationComplete())); - interfaceThread = new QThread(); - interfaceWorker = new Worker(); - interfaceThread->start(); - interfaceWorker->moveToThread(interfaceThread); - connect(this, SIGNAL(startInterface()), interfaceWorker, SLOT(runCommand())); - connect(interfaceWorker, SIGNAL(commandComplete()), this, SLOT(interfaceExecutionComplete())); + _interfaceThread = new QThread(); + _interfaceWorker = new Worker(); + + _interfaceThread->start(); + _interfaceWorker->moveToThread(_interfaceThread); + connect(this, SIGNAL(startInterface()), _interfaceWorker, SLOT(runCommand())); + connect(_interfaceWorker, SIGNAL(commandComplete()), this, SLOT(interfaceExecutionComplete())); } TestRunner::~TestRunner() { - delete installerThread; - delete interfaceThread; + delete _installerThread; + delete _installerWorker; - delete interfaceThread; - delete interfaceWorker; + delete _interfaceThread; + delete _interfaceWorker; if (_timer) { delete _timer; @@ -105,30 +107,7 @@ void TestRunner::setWorkingFolder() { #ifdef Q_OS_MAC // Create MAC shell scripts QFile script; - script.setFileName(_workingFolder + "/install_app.sh"); - if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { - QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), - "Could not open 'install_app.sh'"); - exit(-1); - } - QString installFolder = QString("\"") + _workingFolder + "/High_Fidelity\""; - if (!QDir().exists(installFolder)) { - QDir().mkdir(installFolder); - } - - // This script installs High Fidelity. It is run as "yes | install_app.sh... so "yes" is killed at the end - script.write("#!/bin/sh\n\n"); - script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); - - script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); - script.write((QString("cp -rf \"$VOLUME/") + "/High Fidelity/Sandbox.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); - - script.write("hdiutil detach \"$VOLUME\"\n"); - script.write("killall yes\n"); - script.close(); - script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); - // This script waits for a process to start script.setFileName(_workingFolder + "/waitForStart.sh"); if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -139,27 +118,31 @@ void TestRunner::setWorkingFolder() { script.write("#!/bin/sh\n\n"); script.write("PROCESS=\"$1\"\n"); - script.write("while (pgrep $PROCESS)\n"); + script.write("until (pgrep $PROCESS >nul)\n"); script.write("do\n"); + script.write("\techo waiting for \"$1\" to start\n"); script.write("\tsleep 2\n"); script.write("done\n"); + script.write("echo \"$1\" \"started\"\n"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); - // The Mac shell command returns immediately. This little script waits for a process to complete - script.setFileName(_workingFolder + "/waitForCompletion.sh"); + // The Mac shell command returns immediately. This little script waits for a process to finish + script.setFileName(_workingFolder + "/waitForFinish.sh"); if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), - "Could not open 'waitForCompletion.sh'"); + "Could not open 'waitForFinish.sh'"); exit(-1); } script.write("#!/bin/sh\n\n"); script.write("PROCESS=\"$1\"\n"); - script.write("while (pgrep $PROCESS)\n"); + script.write("while (pgrep $PROCESS >nul)\n"); script.write("do\n"); + script.write("\techo waiting for \"$1\" to finish\n"); script.write("\tsleep 2\n"); script.write("done\n"); + script.write("echo \"$1\" \"finished\"\n"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); @@ -177,7 +160,7 @@ void TestRunner::setWorkingFolder() { script.write("set height to 540\n"); script.write("set x to 100\n"); script.write("set y to 100\n\n"); - script.write("tell application \"System Events\" to tell application process \"interface\" to tell window 1 to set {size, position} to {{width, height}, {x, y}})\n"); + script.write("tell application \"System Events\" to tell application process \"interface\" to tell window 1 to set {size, position} to {{width, height}, {x, y}}\n"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); @@ -190,7 +173,7 @@ void TestRunner::setWorkingFolder() { } script.write("#!/bin/sh\n\n"); - script.write((_workingFolder + "/osascript " + _workingFolder + "/setInterfaceSizeAndPosition.scpt\n").toStdString().c_str()); + script.write(("osascript " + _workingFolder + "/setInterfaceSizeAndPosition.scpt\n").toStdString().c_str()); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); #endif @@ -281,10 +264,39 @@ void TestRunner::runInstaller() { #ifdef Q_OS_WIN commandLine = "\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder); #elif defined Q_OS_MAC - commandLine = "yes | " + _workingFolder + "/install_app.sh " + _workingFolder + "/HighFidelity-Beta-latest-dev.dmg"; -#endif + // Create installation shell script + QFile script; + script.setFileName(_workingFolder + "/install_app.sh"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'install_app.sh'"); + exit(-1); + } + + if (!QDir().exists(_installationFolder)) { + QDir().mkdir(_installationFolder); + } + + // This script installs High Fidelity. It is run as "yes | install_app.sh... so "yes" is killed at the end + script.write("#!/bin/sh\n\n"); + script.write("VOLUME=`hdiutil attach \"$1\" | grep Volumes | awk '{print $3}'`\n"); + + QString folderName {"High Fidelity"}; + if (!_runLatest->isChecked()) { + folderName += QString(" - ") + getPRNumberFromURL(_url->text()); + } - installerWorker->setCommandLine(commandLine); + script.write((QString("cp -rf \"$VOLUME/") + folderName + "/interface.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + script.write((QString("cp -rf \"$VOLUME/") + folderName + "/Sandbox.app\" \"" + _workingFolder + "/High_Fidelity/\"\n").toStdString().c_str()); + + script.write("hdiutil detach \"$VOLUME\"\n"); + script.write("killall yes\n"); + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + commandLine = "yes | " + _workingFolder + "/install_app.sh " + installerFullPath; +#endif + appendLog(commandLine); + _installerWorker->setCommandLine(commandLine); emit startInstaller(); } @@ -415,10 +427,15 @@ void TestRunner::killProcesses() { exit(-1); } #elif defined Q_OS_MAC - QString commandLine = QString("killall interface") + "; " + _workingFolder +"/waitForCompletion.sh interface"; + QString commandLine; + + commandLine = QString("killall interface") + "; " + _workingFolder +"/waitForFinish.sh interface"; system(commandLine.toStdString().c_str()); - - commandLine = QString("killall Sandbox") + "; " + _workingFolder +"/waitForCompletion.sh interface"; + + commandLine = QString("killall Sandbox") + "; " + _workingFolder +"/waitForFinish.sh Sandbox"; + system(commandLine.toStdString().c_str()); + + commandLine = QString("killall Console") + "; " + _workingFolder +"/waitForFinish.sh Console"; system(commandLine.toStdString().c_str()); #endif } @@ -464,28 +481,56 @@ void TestRunner::runInterfaceWithTestScript() { QString commandLine; #ifdef Q_OS_WIN QString exeFile = QString("\"") + QDir::toNativeSeparators(_installationFolder) + "\\interface.exe\""; - commandLine = exeFile + " --url " + url + " --no-updater" + " --testScript " + testScript + - " quitWhenFinished --testResultsLocation " + _snapshotFolder; + commandLine = exeFile + + " --url " + url + + " --no-updater" + + " --no-login-suggestion" + " --testScript " + testScript + " quitWhenFinished" + + " --testResultsLocation " + _snapshotFolder; + + interfaceWorker->setCommandLine(commandLine); + emit startInterface(); #elif defined Q_OS_MAC - // On The Mac, we need to resize Interface. The Interface window opens a few seconds after the process has started, - // so we wait another 10 seconds - // The shell closes if we don't wait for completion, hence the final line - commandLine = "open \"" +_installationFolder + "/interface.app\" --args" + + // On The Mac, we need to resize Interface. The Interface window opens a few seconds after the process + // has started. + // Before starting interface, start a process that will resize interface 10s after it opens + // This is performed by creating a bash script that runs to processes + QFile script; + script.setFileName(_workingFolder + "/runInterfaceTests.sh"); + if (!script.open(QIODevice::WriteOnly | QIODevice::Text)) { + QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), + "Could not open 'runInterfaceTests.sh'"); + exit(-1); + } + + script.write("#!/bin/sh\n\n"); + + commandLine = _workingFolder +"/waitForStart.sh interface && sleep 10 && " + _workingFolder +"/setInterfaceSizeAndPosition.sh &\n"; + script.write(commandLine.toStdString().c_str()); + + commandLine = + "open \"" +_installationFolder + "/interface.app\" --args" + " --url " + url + " --no-updater" + + " --no-login-suggestion" " --testScript " + testScript + " quitWhenFinished" + " --testResultsLocation " + _snapshotFolder + - "; " + _workingFolder +"/waitForStart.sh interface" + - "; " + "sleep 10" + - "; " + _workingFolder +"/setInterfaceSizeAndPosition.sh" + - "; " + _workingFolder +"/waitForCompletion.sh interface"; + " && " + _workingFolder +"/waitForStart.sh interface" + + " && " + _workingFolder +"/waitForFinish.sh interface"; + + script.write(commandLine.toStdString().c_str()); + + script.close(); + script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); + + commandLine = _workingFolder + "/runInterfaceTests.sh"; + _interfaceWorker->setCommandLine(commandLine); + + emit startInterface(); #endif // Helpful for debugging appendLog(commandLine); - - interfaceWorker->setCommandLine(commandLine); - emit startInterface(); } void TestRunner::interfaceExecutionComplete() { @@ -637,6 +682,7 @@ void TestRunner::appendLog(const QString& message) { QString TestRunner::getInstallerNameFromURL(const QString& url) { // An example URL: https://deployment.highfidelity.com/jobs/pr-build/label%3Dwindows/13023/HighFidelity-Beta-Interface-PR14006-be76c43.exe + // On Mac, replace `exe` with `dmg` try { QStringList urlParts = url.split("/"); return urlParts[urlParts.size() - 1]; @@ -654,7 +700,11 @@ QString TestRunner::getPRNumberFromURL(const QString& url) { QStringList urlParts = url.split("/"); QStringList filenameParts = urlParts[urlParts.size() - 1].split("-"); if (filenameParts.size() <= 3) { +#ifdef Q_OS_WIN 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`"; +#elif defined Q_OS_MAC + throw "URL not in expected format, should look like `https://deployment.highfidelity.com/jobs/pr-build/label%3Dwindows/13023/HighFidelity-Beta-Interface-PR14006-be76c43.dmg`"; +#endif } return filenameParts[filenameParts.size() - 2]; } catch (QString errorMessage) { diff --git a/tools/auto-tester/src/TestRunner.h b/tools/auto-tester/src/TestRunner.h index 8267a042b7..11129d2f36 100644 --- a/tools/auto-tester/src/TestRunner.h +++ b/tools/auto-tester/src/TestRunner.h @@ -84,7 +84,8 @@ private slots: signals: void startInstaller(); void startInterface(); - + void startResize(); + private: bool _automatedTestIsRunning{ false }; @@ -130,11 +131,12 @@ private: QDateTime _testStartDateTime; - QThread* installerThread; - QThread* interfaceThread; - Worker* installerWorker; - Worker* interfaceWorker; + QThread* _installerThread; + QThread* _interfaceThread; + Worker* _installerWorker; + Worker* _interfaceWorker; + BuildInformation _buildInformation; }; @@ -150,7 +152,7 @@ signals: void commandComplete(); void startInstaller(); void startInterface(); - + private: QString _commandLine; }; From 05939f8a7c81fef1dc86fdd165d8bb1b4197be25 Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 8 Nov 2018 11:09:19 -0800 Subject: [PATCH 46/82] Fix settings to only show relevant HMD controls. --- interface/resources/html/tabletHelp.html | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index 279213bbcb..68a34245c7 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -66,7 +66,7 @@ From 1bd978e4c3a0695532a00d0573f0ef0f0d488ef4 Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 8 Nov 2018 11:22:43 -0800 Subject: [PATCH 47/82] Clean up code in tabletHelp.html --- interface/resources/html/tabletHelp.html | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index 68a34245c7..a1739b3d67 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -137,29 +137,24 @@ switch (params.handControllerName) { case "oculus": handControllerImageURL = "img/tablet-help-oculus.jpg"; - index = 0; break; case "windowsMR": handControllerImageURL = "img/tablet-help-windowsMR.jpg"; - index = 0; break; case "vive": handControllerImageURL = "img/tablet-help-vive.jpg"; - index = 0; default: - } switch (params.defaultTab) { + case "handControllers": + showHandControllers(); + index = 0; + break; case "gamepad": showGamepad(); index = 1; break; - - case "handControllers": - showHandControllers(); - break; - case "kbm": default: showKbm(); From a6494bf379eaaf20ace3b81c677b4d2a57af70c4 Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 8 Nov 2018 11:25:55 -0800 Subject: [PATCH 48/82] Fix edge case with Oculus. --- interface/resources/html/tabletHelp.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index a1739b3d67..f3e60ff16f 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -135,15 +135,15 @@ } switch (params.handControllerName) { - case "oculus": - handControllerImageURL = "img/tablet-help-oculus.jpg"; - break; case "windowsMR": handControllerImageURL = "img/tablet-help-windowsMR.jpg"; break; case "vive": handControllerImageURL = "img/tablet-help-vive.jpg"; + break; + case "oculus": default: + handControllerImageURL = "img/tablet-help-oculus.jpg"; } switch (params.defaultTab) { From b4be7544b9fedd28b95334ed1f811b2a4c054407 Mon Sep 17 00:00:00 2001 From: Jason Najera <39922250+r3tk0n@users.noreply.github.com> Date: Thu, 8 Nov 2018 13:15:19 -0800 Subject: [PATCH 49/82] Attempt to fix spacing Weird thing is it still looked fine in GitHub's editor... --- interface/resources/html/tabletHelp.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index f3e60ff16f..a48ee9d6d1 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -147,7 +147,7 @@ } switch (params.defaultTab) { - case "handControllers": + case "handControllers": showHandControllers(); index = 0; break; From 59bba5b6e69c9487f4a01b58f97b43d7e3f10129 Mon Sep 17 00:00:00 2001 From: Jason Najera <39922250+r3tk0n@users.noreply.github.com> Date: Thu, 8 Nov 2018 13:16:24 -0800 Subject: [PATCH 50/82] More attempt to fix indentation. Still looked fine in github's editor and N++. --- interface/resources/html/tabletHelp.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index a48ee9d6d1..1399c98f9f 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -149,7 +149,7 @@ switch (params.defaultTab) { case "handControllers": showHandControllers(); - index = 0; + index = 0; break; case "gamepad": showGamepad(); From 84209c0e5319a1b7cfbb23c65b2f30a0834a50fd Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 8 Nov 2018 13:18:25 -0800 Subject: [PATCH 51/82] Finally fix all indentation. --- interface/resources/html/tabletHelp.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index 1399c98f9f..cc931580c3 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -139,11 +139,11 @@ handControllerImageURL = "img/tablet-help-windowsMR.jpg"; break; case "vive": - handControllerImageURL = "img/tablet-help-vive.jpg"; - break; - case "oculus": + handControllerImageURL = "img/tablet-help-vive.jpg"; + break; + case "oculus": default: - handControllerImageURL = "img/tablet-help-oculus.jpg"; + handControllerImageURL = "img/tablet-help-oculus.jpg"; } switch (params.defaultTab) { From 8aea237ad755ebee312e80d06505769019fd5bd6 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 8 Nov 2018 14:26:27 -0800 Subject: [PATCH 52/82] Fixed endless wait --- tools/auto-tester/src/TestRunner.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index b947f2544a..740b3f4087 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -118,7 +118,7 @@ void TestRunner::setWorkingFolder() { script.write("#!/bin/sh\n\n"); script.write("PROCESS=\"$1\"\n"); - script.write("until (pgrep $PROCESS >nul)\n"); + script.write("until (pgrep -x $PROCESS >nul)\n"); script.write("do\n"); script.write("\techo waiting for \"$1\" to start\n"); script.write("\tsleep 2\n"); @@ -137,7 +137,7 @@ void TestRunner::setWorkingFolder() { script.write("#!/bin/sh\n\n"); script.write("PROCESS=\"$1\"\n"); - script.write("while (pgrep $PROCESS >nul)\n"); + script.write("while (pgrep -x $PROCESS >nul)\n"); script.write("do\n"); script.write("\techo waiting for \"$1\" to finish\n"); script.write("\tsleep 2\n"); @@ -515,7 +515,6 @@ void TestRunner::runInterfaceWithTestScript() { " --no-login-suggestion" " --testScript " + testScript + " quitWhenFinished" + " --testResultsLocation " + _snapshotFolder + - " && " + _workingFolder +"/waitForStart.sh interface" + " && " + _workingFolder +"/waitForFinish.sh interface"; script.write(commandLine.toStdString().c_str()); From 9b60103f47c1d38b177817e7600b57feb998a08a Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 8 Nov 2018 15:07:32 -0800 Subject: [PATCH 53/82] Renaming auto-tester ==> nitpick --- tools/CMakeLists.txt | 4 +- .../AppDataHighFidelity/Interface.json | 0 .../Interface/AccountInfo.bin | Bin .../Interface/avatarbookmarks.json | 0 .../assignment-client/entities/models.json.gz | Bin .../domain-server/AccountInfo.bin | Bin .../domain-server/config.json | 0 .../domain-server/entities/models.json.gz | Bin tools/{auto-tester => nitpick}/CMakeLists.txt | 4 +- tools/{auto-tester => nitpick}/Create.PNG | Bin tools/{auto-tester => nitpick}/Evaluate.PNG | Bin tools/{auto-tester => nitpick}/README.md | 29 +++--- tools/{auto-tester => nitpick}/Run.PNG | Bin .../TestRailSelector.PNG | Bin .../Web Interface.PNG | Bin .../{auto-tester => nitpick}/WebInterface.PNG | Bin tools/{auto-tester => nitpick}/Windows.PNG | Bin .../nitpickMismatchExample.PNG} | Bin tools/{auto-tester => nitpick}/setup_7z.PNG | Bin .../src/AWSInterface.cpp | 0 .../src/AWSInterface.h | 0 .../src/Downloader.cpp | 0 .../{auto-tester => nitpick}/src/Downloader.h | 0 .../src/ImageComparer.cpp | 0 .../src/ImageComparer.h | 0 .../src/PythonInterface.cpp | 0 .../src/PythonInterface.h | 0 tools/{auto-tester => nitpick}/src/Test.cpp | 64 ++++++------ tools/{auto-tester => nitpick}/src/Test.h | 2 +- .../src/TestRailInterface.cpp | 0 .../src/TestRailInterface.h | 0 .../src/TestRunner.cpp | 20 ++-- .../{auto-tester => nitpick}/src/TestRunner.h | 0 tools/{auto-tester => nitpick}/src/common.h | 0 tools/{auto-tester => nitpick}/src/main.cpp | 12 +-- .../src/ui/BusyWindow.cpp | 0 .../src/ui/BusyWindow.h | 0 .../src/ui/BusyWindow.ui | 0 .../src/ui/HelpWindow.cpp | 0 .../src/ui/HelpWindow.h | 0 .../src/ui/HelpWindow.ui | 2 +- .../src/ui/MismatchWindow.cpp | 0 .../src/ui/MismatchWindow.h | 0 .../src/ui/MismatchWindow.ui | 0 .../src/ui/Nitpick.cpp} | 92 +++++++++--------- .../AutoTester.h => nitpick/src/ui/Nitpick.h} | 18 ++-- .../src/ui/Nitpick.ui} | 6 +- .../src/ui/TestRailResultsSelectorWindow.cpp | 0 .../src/ui/TestRailResultsSelectorWindow.h | 0 .../src/ui/TestRailResultsSelectorWindow.ui | 0 .../src/ui/TestRailRunSelectorWindow.cpp | 0 .../src/ui/TestRailRunSelectorWindow.h | 0 .../src/ui/TestRailRunSelectorWindow.ui | 0 .../ui/TestRailTestCasesSelectorWindow.cpp | 0 .../src/ui/TestRailTestCasesSelectorWindow.h | 0 .../src/ui/TestRailTestCasesSelectorWindow.ui | 0 56 files changed, 126 insertions(+), 127 deletions(-) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/Interface.json (100%) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/Interface/AccountInfo.bin (100%) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/Interface/avatarbookmarks.json (100%) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/assignment-client/entities/models.json.gz (100%) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/domain-server/AccountInfo.bin (100%) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/domain-server/config.json (100%) rename tools/{auto-tester => nitpick}/AppDataHighFidelity/domain-server/entities/models.json.gz (100%) rename tools/{auto-tester => nitpick}/CMakeLists.txt (95%) rename tools/{auto-tester => nitpick}/Create.PNG (100%) rename tools/{auto-tester => nitpick}/Evaluate.PNG (100%) rename tools/{auto-tester => nitpick}/README.md (93%) rename tools/{auto-tester => nitpick}/Run.PNG (100%) rename tools/{auto-tester => nitpick}/TestRailSelector.PNG (100%) rename tools/{auto-tester => nitpick}/Web Interface.PNG (100%) rename tools/{auto-tester => nitpick}/WebInterface.PNG (100%) rename tools/{auto-tester => nitpick}/Windows.PNG (100%) rename tools/{auto-tester/autoTesterMismatchExample.PNG => nitpick/nitpickMismatchExample.PNG} (100%) rename tools/{auto-tester => nitpick}/setup_7z.PNG (100%) rename tools/{auto-tester => nitpick}/src/AWSInterface.cpp (100%) rename tools/{auto-tester => nitpick}/src/AWSInterface.h (100%) rename tools/{auto-tester => nitpick}/src/Downloader.cpp (100%) rename tools/{auto-tester => nitpick}/src/Downloader.h (100%) rename tools/{auto-tester => nitpick}/src/ImageComparer.cpp (100%) rename tools/{auto-tester => nitpick}/src/ImageComparer.h (100%) rename tools/{auto-tester => nitpick}/src/PythonInterface.cpp (100%) rename tools/{auto-tester => nitpick}/src/PythonInterface.h (100%) rename tools/{auto-tester => nitpick}/src/Test.cpp (94%) rename tools/{auto-tester => nitpick}/src/Test.h (98%) rename tools/{auto-tester => nitpick}/src/TestRailInterface.cpp (100%) rename tools/{auto-tester => nitpick}/src/TestRailInterface.h (100%) rename tools/{auto-tester => nitpick}/src/TestRunner.cpp (98%) rename tools/{auto-tester => nitpick}/src/TestRunner.h (100%) rename tools/{auto-tester => nitpick}/src/common.h (100%) rename tools/{auto-tester => nitpick}/src/main.cpp (89%) rename tools/{auto-tester => nitpick}/src/ui/BusyWindow.cpp (100%) rename tools/{auto-tester => nitpick}/src/ui/BusyWindow.h (100%) rename tools/{auto-tester => nitpick}/src/ui/BusyWindow.ui (100%) rename tools/{auto-tester => nitpick}/src/ui/HelpWindow.cpp (100%) rename tools/{auto-tester => nitpick}/src/ui/HelpWindow.h (100%) rename tools/{auto-tester => nitpick}/src/ui/HelpWindow.ui (96%) rename tools/{auto-tester => nitpick}/src/ui/MismatchWindow.cpp (100%) rename tools/{auto-tester => nitpick}/src/ui/MismatchWindow.h (100%) rename tools/{auto-tester => nitpick}/src/ui/MismatchWindow.ui (100%) rename tools/{auto-tester/src/ui/AutoTester.cpp => nitpick/src/ui/Nitpick.cpp} (72%) rename tools/{auto-tester/src/ui/AutoTester.h => nitpick/src/ui/Nitpick.h} (92%) rename tools/{auto-tester/src/ui/AutoTester.ui => nitpick/src/ui/Nitpick.ui} (99%) rename tools/{auto-tester => nitpick}/src/ui/TestRailResultsSelectorWindow.cpp (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailResultsSelectorWindow.h (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailResultsSelectorWindow.ui (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailRunSelectorWindow.cpp (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailRunSelectorWindow.h (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailRunSelectorWindow.ui (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailTestCasesSelectorWindow.cpp (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailTestCasesSelectorWindow.h (100%) rename tools/{auto-tester => nitpick}/src/ui/TestRailTestCasesSelectorWindow.ui (100%) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 1c36306410..8ab84372cb 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -33,6 +33,6 @@ if (BUILD_TOOLS) add_subdirectory(oven) set_target_properties(oven PROPERTIES FOLDER "Tools") - add_subdirectory(auto-tester) - set_target_properties(auto-tester PROPERTIES FOLDER "Tools") + add_subdirectory(nitpick) + set_target_properties(nitpick PROPERTIES FOLDER "Tools") endif() diff --git a/tools/auto-tester/AppDataHighFidelity/Interface.json b/tools/nitpick/AppDataHighFidelity/Interface.json similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/Interface.json rename to tools/nitpick/AppDataHighFidelity/Interface.json diff --git a/tools/auto-tester/AppDataHighFidelity/Interface/AccountInfo.bin b/tools/nitpick/AppDataHighFidelity/Interface/AccountInfo.bin similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/Interface/AccountInfo.bin rename to tools/nitpick/AppDataHighFidelity/Interface/AccountInfo.bin diff --git a/tools/auto-tester/AppDataHighFidelity/Interface/avatarbookmarks.json b/tools/nitpick/AppDataHighFidelity/Interface/avatarbookmarks.json similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/Interface/avatarbookmarks.json rename to tools/nitpick/AppDataHighFidelity/Interface/avatarbookmarks.json diff --git a/tools/auto-tester/AppDataHighFidelity/assignment-client/entities/models.json.gz b/tools/nitpick/AppDataHighFidelity/assignment-client/entities/models.json.gz similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/assignment-client/entities/models.json.gz rename to tools/nitpick/AppDataHighFidelity/assignment-client/entities/models.json.gz diff --git a/tools/auto-tester/AppDataHighFidelity/domain-server/AccountInfo.bin b/tools/nitpick/AppDataHighFidelity/domain-server/AccountInfo.bin similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/domain-server/AccountInfo.bin rename to tools/nitpick/AppDataHighFidelity/domain-server/AccountInfo.bin diff --git a/tools/auto-tester/AppDataHighFidelity/domain-server/config.json b/tools/nitpick/AppDataHighFidelity/domain-server/config.json similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/domain-server/config.json rename to tools/nitpick/AppDataHighFidelity/domain-server/config.json diff --git a/tools/auto-tester/AppDataHighFidelity/domain-server/entities/models.json.gz b/tools/nitpick/AppDataHighFidelity/domain-server/entities/models.json.gz similarity index 100% rename from tools/auto-tester/AppDataHighFidelity/domain-server/entities/models.json.gz rename to tools/nitpick/AppDataHighFidelity/domain-server/entities/models.json.gz diff --git a/tools/auto-tester/CMakeLists.txt b/tools/nitpick/CMakeLists.txt similarity index 95% rename from tools/auto-tester/CMakeLists.txt rename to tools/nitpick/CMakeLists.txt index c8c0a336d2..543b9c9b47 100644 --- a/tools/auto-tester/CMakeLists.txt +++ b/tools/nitpick/CMakeLists.txt @@ -1,4 +1,4 @@ -set (TARGET_NAME auto-tester) +set (TARGET_NAME nitpick) project(${TARGET_NAME}) # Automatically run UIC and MOC. This replaces the older WRAP macros @@ -22,7 +22,7 @@ set (QT_LIBRARIES Qt5::Core Qt5::Widgets QT::Gui Qt5::Xml) if (WIN32) # Do not show Console - set_property (TARGET auto-tester PROPERTY WIN32_EXECUTABLE true) + set_property (TARGET nitpick PROPERTY WIN32_EXECUTABLE true) endif() target_zlib() diff --git a/tools/auto-tester/Create.PNG b/tools/nitpick/Create.PNG similarity index 100% rename from tools/auto-tester/Create.PNG rename to tools/nitpick/Create.PNG diff --git a/tools/auto-tester/Evaluate.PNG b/tools/nitpick/Evaluate.PNG similarity index 100% rename from tools/auto-tester/Evaluate.PNG rename to tools/nitpick/Evaluate.PNG diff --git a/tools/auto-tester/README.md b/tools/nitpick/README.md similarity index 93% rename from tools/auto-tester/README.md rename to tools/nitpick/README.md index 0bec83d703..d21614f5f5 100644 --- a/tools/auto-tester/README.md +++ b/tools/nitpick/README.md @@ -1,11 +1,11 @@ -# Auto Tester +# nitpick -The auto-tester is a stand alone application that provides a mechanism for regression testing. The general idea is simple: +Nitpick is a stand alone application that provides a mechanism for regression testing. The general idea is simple: * Each test folder has a script that produces a set of snapshots. * The snapshots are compared to a 'canonical' set of images that have been produced beforehand. * The result, if any test failed, is a zipped folder describing the failure. -Auto-tester has 5 functions, separated into 4 tabs: +Nitpick has 5 functions, separated into 4 tabs: 1. Creating tests, MD files and recursive scripts 1. Windows task bar utility (Windows only) 1. Running tests @@ -14,12 +14,12 @@ Auto-tester has 5 functions, separated into 4 tabs: ## Installation ### Executable -1. On Windows: download the installer by browsing to [here](). +1. On Windows: download the installer by browsing to [here](). 2. Double click on the installer and install to a convenient location ![](./setup_7z.PNG) -3. To run the auto-tester, double click **auto-tester.exe**. +3. To run nitpick, double click **nitpick.exe**. ### Python -The TestRail interface requires Python 3 to be installed. Auto-Tester has been tested with Python 3.7.0 but should work with newer versions. +The TestRail interface requires Python 3 to be installed. Nitpick has been tested with Python 3.7.0 but should work with newer versions. Python 3 can be downloaded from: 1. Windows installer @@ -41,7 +41,6 @@ Verify that `/usr/local/bin/python3` exists. 1. Enter the AWS account number 1. Enter the secret key 1. Leave region name and ouput format as default [None] - 1. Install the latest release of Boto3 via pip: pip install boto3 #### Mac @@ -78,7 +77,7 @@ This function creates an MD file in the (user-selected) tests root folder. The This function creates a file named `test.md` from a `test.js` script. The user will be asked for the folder containing the test script: ### Details The process to produce the MD file is a simplistic parse of the test script. -- The string in the `autoTester.perform(...)` function call will be the title of the file +- The string in the `nitpick.perform(...)` function call will be the title of the file - Instructions to run the script are then provided: @@ -110,26 +109,26 @@ The various scripts are called in alphabetical order. An example of a recursive script is as follows: ``` -// This is an automatically generated file, created by auto-tester on Jul 5 2018, 10:19 +// This is an automatically generated file, created by nitpick on Jul 5 2018, 10:19 PATH_TO_THE_REPO_PATH_UTILS_FILE = "https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js"; Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE); -var autoTester = createAutoTester(Script.resolvePath(".")); +var nitpick = createNitpick(Script.resolvePath(".")); -var testsRootPath = autoTester.getTestsRootPath(); +var testsRootPath = nitpick.getTestsRootPath(); if (typeof Test !== 'undefined') { Test.wait(10000); }; -autoTester.enableRecursive(); -autoTester.enableAuto(); +nitpick.enableRecursive(); +nitpick.enableAuto(); Script.include(testsRootPath + "content/overlay/layer/drawInFront/shape/test.js"); Script.include(testsRootPath + "content/overlay/layer/drawInFront/model/test.js"); Script.include(testsRootPath + "content/overlay/layer/drawHUDLayer/test.js"); -autoTester.runRecursive(); +nitpick.runRecursive(); ``` ## Create all Recursive Scripts ### Usage @@ -186,7 +185,7 @@ Evaluation proceeds in a number of steps: 1. The images are then pair-wise compared, using the SSIM algorithm. A fixed threshold is used to define a mismatch. 1. In interactive mode - a window is opened showing the expected image, actual image, difference image and error: -![](./autoTesterMismatchExample.PNG) +![](./nitpickMismatchExample.PNG) 1. If not in interactive mode, or the user has defined the results as an error, an error is written into the error folder. The error itself is a folder with the 3 images and a small text file containing details. diff --git a/tools/auto-tester/Run.PNG b/tools/nitpick/Run.PNG similarity index 100% rename from tools/auto-tester/Run.PNG rename to tools/nitpick/Run.PNG diff --git a/tools/auto-tester/TestRailSelector.PNG b/tools/nitpick/TestRailSelector.PNG similarity index 100% rename from tools/auto-tester/TestRailSelector.PNG rename to tools/nitpick/TestRailSelector.PNG diff --git a/tools/auto-tester/Web Interface.PNG b/tools/nitpick/Web Interface.PNG similarity index 100% rename from tools/auto-tester/Web Interface.PNG rename to tools/nitpick/Web Interface.PNG diff --git a/tools/auto-tester/WebInterface.PNG b/tools/nitpick/WebInterface.PNG similarity index 100% rename from tools/auto-tester/WebInterface.PNG rename to tools/nitpick/WebInterface.PNG diff --git a/tools/auto-tester/Windows.PNG b/tools/nitpick/Windows.PNG similarity index 100% rename from tools/auto-tester/Windows.PNG rename to tools/nitpick/Windows.PNG diff --git a/tools/auto-tester/autoTesterMismatchExample.PNG b/tools/nitpick/nitpickMismatchExample.PNG similarity index 100% rename from tools/auto-tester/autoTesterMismatchExample.PNG rename to tools/nitpick/nitpickMismatchExample.PNG diff --git a/tools/auto-tester/setup_7z.PNG b/tools/nitpick/setup_7z.PNG similarity index 100% rename from tools/auto-tester/setup_7z.PNG rename to tools/nitpick/setup_7z.PNG diff --git a/tools/auto-tester/src/AWSInterface.cpp b/tools/nitpick/src/AWSInterface.cpp similarity index 100% rename from tools/auto-tester/src/AWSInterface.cpp rename to tools/nitpick/src/AWSInterface.cpp diff --git a/tools/auto-tester/src/AWSInterface.h b/tools/nitpick/src/AWSInterface.h similarity index 100% rename from tools/auto-tester/src/AWSInterface.h rename to tools/nitpick/src/AWSInterface.h diff --git a/tools/auto-tester/src/Downloader.cpp b/tools/nitpick/src/Downloader.cpp similarity index 100% rename from tools/auto-tester/src/Downloader.cpp rename to tools/nitpick/src/Downloader.cpp diff --git a/tools/auto-tester/src/Downloader.h b/tools/nitpick/src/Downloader.h similarity index 100% rename from tools/auto-tester/src/Downloader.h rename to tools/nitpick/src/Downloader.h diff --git a/tools/auto-tester/src/ImageComparer.cpp b/tools/nitpick/src/ImageComparer.cpp similarity index 100% rename from tools/auto-tester/src/ImageComparer.cpp rename to tools/nitpick/src/ImageComparer.cpp diff --git a/tools/auto-tester/src/ImageComparer.h b/tools/nitpick/src/ImageComparer.h similarity index 100% rename from tools/auto-tester/src/ImageComparer.h rename to tools/nitpick/src/ImageComparer.h diff --git a/tools/auto-tester/src/PythonInterface.cpp b/tools/nitpick/src/PythonInterface.cpp similarity index 100% rename from tools/auto-tester/src/PythonInterface.cpp rename to tools/nitpick/src/PythonInterface.cpp diff --git a/tools/auto-tester/src/PythonInterface.h b/tools/nitpick/src/PythonInterface.h similarity index 100% rename from tools/auto-tester/src/PythonInterface.h rename to tools/nitpick/src/PythonInterface.h diff --git a/tools/auto-tester/src/Test.cpp b/tools/nitpick/src/Test.cpp similarity index 94% rename from tools/auto-tester/src/Test.cpp rename to tools/nitpick/src/Test.cpp index 2c262bec1e..13a03c32e8 100644 --- a/tools/auto-tester/src/Test.cpp +++ b/tools/nitpick/src/Test.cpp @@ -19,8 +19,8 @@ #include #include -#include "ui/AutoTester.h" -extern AutoTester* autoTester; +#include "ui/Nitpick.h" +extern Nitpick* nitpick; #include @@ -30,9 +30,9 @@ Test::Test(QProgressBar* progressBar, QCheckBox* checkBoxInteractiveMode) { _mismatchWindow.setModal(true); - if (autoTester) { - autoTester->setUserText(GIT_HUB_DEFAULT_USER); - autoTester->setBranchText(GIT_HUB_DEFAULT_BRANCH); + if (nitpick) { + nitpick->setUserText(GIT_HUB_DEFAULT_USER); + nitpick->setBranchText(GIT_HUB_DEFAULT_BRANCH); } } @@ -240,8 +240,8 @@ void Test::startTestsEvaluation(const bool isRunningFromCommandLine, _expectedImagesFilenames.clear(); _expectedImagesFullFilenames.clear(); - QString branch = (branchFromCommandLine.isNull()) ? autoTester->getSelectedBranch() : branchFromCommandLine; - QString user = (userFromCommandLine.isNull()) ? autoTester->getSelectedUser() : userFromCommandLine; + QString branch = (branchFromCommandLine.isNull()) ? nitpick->getSelectedBranch() : branchFromCommandLine; + QString user = (userFromCommandLine.isNull()) ? nitpick->getSelectedUser() : userFromCommandLine; foreach(QString currentFilename, sortedTestResultsFilenames) { QString fullCurrentFilename = _snapshotDirectory + "/" + currentFilename; @@ -268,7 +268,7 @@ void Test::startTestsEvaluation(const bool isRunningFromCommandLine, } } - autoTester->downloadFiles(expectedImagesURLs, _snapshotDirectory, _expectedImagesFilenames, (void *)this); + nitpick->downloadFiles(expectedImagesURLs, _snapshotDirectory, _expectedImagesFilenames, (void *)this); } void Test::finishTestsEvaluation() { int numberOfFailures = compareImageLists(); @@ -288,7 +288,7 @@ void Test::finishTestsEvaluation() { } if (_isRunningInAutomaticTestRun) { - autoTester->automaticTestRunEvaluationComplete(zippedFolderName, numberOfFailures); + nitpick->automaticTestRunEvaluationComplete(zippedFolderName, numberOfFailures); } } @@ -429,22 +429,22 @@ ExtractedText Test::getTestScriptLines(QString testFileName) { QString line = stream.readLine(); // Name of test is the string in the following line: - // autoTester.perform("Apply Material Entities to Avatars", Script.resolvePath("."), function(testType) {... + // nitpick.perform("Apply Material Entities to Avatars", Script.resolvePath("."), function(testType) {... const QString ws("\\h*"); //white-space character - const QString functionPerformName(ws + "autoTester" + ws + "\\." + ws + "perform"); + const QString functionPerformName(ws + "nitpick" + ws + "\\." + ws + "perform"); const QString quotedString("\\\".+\\\""); QString regexTestTitle(ws + functionPerformName + "\\(" + quotedString); QRegularExpression lineContainingTitle = QRegularExpression(regexTestTitle); // Each step is either of the following forms: - // autoTester.addStepSnapshot("Take snapshot"... - // autoTester.addStep("Clean up after test"... - const QString functionAddStepSnapshotName(ws + "autoTester" + ws + "\\." + ws + "addStepSnapshot"); + // nitpick.addStepSnapshot("Take snapshot"... + // nitpick.addStep("Clean up after test"... + const QString functionAddStepSnapshotName(ws + "nitpick" + ws + "\\." + ws + "addStepSnapshot"); const QString regexStepSnapshot(ws + functionAddStepSnapshotName + ws + "\\(" + ws + quotedString + ".*"); const QRegularExpression lineStepSnapshot = QRegularExpression(regexStepSnapshot); - const QString functionAddStepName(ws + "autoTester" + ws + "\\." + ws + "addStep"); + const QString functionAddStepName(ws + "nitpick" + ws + "\\." + ws + "addStep"); const QString regexStep(ws + functionAddStepName + ws + "\\(" + ws + quotedString + ".*"); const QRegularExpression lineStep = QRegularExpression(regexStep); @@ -620,7 +620,7 @@ void Test::createTestAutoScript() { } if (createTestAutoScript(_testDirectory)) { - QMessageBox::information(0, "Success", "'autoTester.js` script has been created"); + QMessageBox::information(0, "Success", "'nitpick.js` script has been created"); } } @@ -653,7 +653,7 @@ void Test::createAllTestAutoScripts() { } } - QMessageBox::information(0, "Success", "'autoTester.js' scripts have been created"); + QMessageBox::information(0, "Success", "'nitpick.js' scripts have been created"); } bool Test::createTestAutoScript(const QString& directory) { @@ -677,8 +677,8 @@ bool Test::createTestAutoScript(const QString& directory) { stream << "if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') PATH_TO_THE_REPO_PATH_UTILS_FILE = 'https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js';\n"; stream << "Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);\n"; - stream << "var autoTester = createAutoTester(Script.resolvePath('.'));\n\n"; - stream << "autoTester.enableAuto();\n\n"; + stream << "var nitpick = createAutoTester(Script.resolvePath('.'));\n\n"; + stream << "nitpick.enableAuto();\n\n"; stream << "Script.include('./test.js?raw=true');\n"; testAutoScriptFile.close(); @@ -751,29 +751,29 @@ void Test::createRecursiveScript(const QString& topLevelDirectory, bool interact textStream << "// This is an automatically generated file, created by auto-tester" << endl; // Include 'autoTest.js' - QString branch = autoTester->getSelectedBranch(); - QString user = autoTester->getSelectedUser(); + QString branch = nitpick->getSelectedBranch(); + QString user = nitpick->getSelectedUser(); textStream << "PATH_TO_THE_REPO_PATH_UTILS_FILE = \"https://raw.githubusercontent.com/" + user + "/hifi_tests/" + branch + "/tests/utils/branchUtils.js\";" << endl; textStream << "Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);" << endl; - textStream << "var autoTester = createAutoTester(Script.resolvePath(\".\"));" << endl << endl; + textStream << "var nitpick = createAutoTester(Script.resolvePath(\".\"));" << endl << endl; - textStream << "var testsRootPath = autoTester.getTestsRootPath();" << endl << endl; + textStream << "var testsRootPath = nitpick.getTestsRootPath();" << endl << endl; // Wait 10 seconds before starting textStream << "if (typeof Test !== 'undefined') {" << endl; textStream << " Test.wait(10000);" << endl; textStream << "};" << endl << endl; - textStream << "autoTester.enableRecursive();" << endl; - textStream << "autoTester.enableAuto();" << endl << endl; + textStream << "nitpick.enableRecursive();" << endl; + textStream << "nitpick.enableAuto();" << endl << endl; // This is used to verify that the recursive test contains at least one test bool testFound{ false }; - // Directories are included in reverse order. The autoTester scripts use a stack mechanism, + // Directories are included in reverse order. The nitpick scripts use a stack mechanism, // so this ensures that the tests run in alphabetical order (a convenience when debugging) QStringList directories; @@ -819,7 +819,7 @@ void Test::createRecursiveScript(const QString& topLevelDirectory, bool interact } textStream << endl; - textStream << "autoTester.runRecursive();" << endl; + textStream << "nitpick.runRecursive();" << endl; allTestsFilename.close(); } @@ -881,7 +881,7 @@ void Test::createTestsOutline() { // The directory name appears after the last slash (we are assured there is at least 1). QString directoryName = directory.right(directory.length() - directory.lastIndexOf("/") - 1); - // autoTester is run on a clone of the repository. We use relative paths, so we can use both local disk and GitHub + // nitpick is run on a clone of the repository. We use relative paths, so we can use both local disk and GitHub // For a test in "D:/GitHub/hifi_tests/tests/content/entity/zone/ambientLightInheritance" the // GitHub URL is "./content/entity/zone/ambientLightInheritance?raw=true" QString partialPath = directory.right(directory.length() - (directory.lastIndexOf("/tests/") + QString("/tests").length() + 1)); @@ -937,11 +937,11 @@ void Test::createTestRailTestCases() { } if (_testRailCreateMode == PYTHON) { - _testRailInterface.createTestSuitePython(_testDirectory, outputDirectory, autoTester->getSelectedUser(), - autoTester->getSelectedBranch()); + _testRailInterface.createTestSuitePython(_testDirectory, outputDirectory, nitpick->getSelectedUser(), + nitpick->getSelectedBranch()); } else { - _testRailInterface.createTestSuiteXML(_testDirectory, outputDirectory, autoTester->getSelectedUser(), - autoTester->getSelectedBranch()); + _testRailInterface.createTestSuiteXML(_testDirectory, outputDirectory, nitpick->getSelectedUser(), + nitpick->getSelectedBranch()); } } diff --git a/tools/auto-tester/src/Test.h b/tools/nitpick/src/Test.h similarity index 98% rename from tools/auto-tester/src/Test.h rename to tools/nitpick/src/Test.h index f653a91782..a79252b92a 100644 --- a/tools/auto-tester/src/Test.h +++ b/tools/nitpick/src/Test.h @@ -146,7 +146,7 @@ private: const QString DATETIME_FORMAT{ "yyyy-MM-dd_hh-mm-ss" }; - // NOTE: these need to match the appropriate var's in autoTester.js + // NOTE: these need to match the appropriate var's in nitpick.js // var advanceKey = "n"; // var pathSeparator = "."; const QString ADVANCE_KEY{ "n" }; diff --git a/tools/auto-tester/src/TestRailInterface.cpp b/tools/nitpick/src/TestRailInterface.cpp similarity index 100% rename from tools/auto-tester/src/TestRailInterface.cpp rename to tools/nitpick/src/TestRailInterface.cpp diff --git a/tools/auto-tester/src/TestRailInterface.h b/tools/nitpick/src/TestRailInterface.h similarity index 100% rename from tools/auto-tester/src/TestRailInterface.h rename to tools/nitpick/src/TestRailInterface.h diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/nitpick/src/TestRunner.cpp similarity index 98% rename from tools/auto-tester/src/TestRunner.cpp rename to tools/nitpick/src/TestRunner.cpp index 3781024a63..1387635b8f 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/nitpick/src/TestRunner.cpp @@ -13,8 +13,8 @@ #include #include -#include "ui/AutoTester.h" -extern AutoTester* autoTester; +#include "ui/Nitpick.h" +extern Nitpick* nitpick; #ifdef Q_OS_WIN #include @@ -95,7 +95,7 @@ void TestRunner::setWorkingFolder() { _logFile.setFileName(_workingFolder + "/log.txt"); - autoTester->enableRunTabControls(); + nitpick->enableRunTabControls(); _workingFolderLabel->setText(QDir::toNativeSeparators(_workingFolder)); _timer = new QTimer(this); @@ -203,8 +203,8 @@ void TestRunner::run() { _automatedTestIsRunning = true; // Initial setup - _branch = autoTester->getSelectedBranch(); - _user = autoTester->getSelectedUser(); + _branch = nitpick->getSelectedBranch(); + _user = nitpick->getSelectedUser(); // This will be restored at the end of the tests saveExistingHighFidelityAppDataFolder(); @@ -221,7 +221,7 @@ void TestRunner::run() { updateStatusLabel("Downloading Build XML"); buildXMLDownloaded = false; - autoTester->downloadFiles(urls, _workingFolder, filenames, (void*)this); + nitpick->downloadFiles(urls, _workingFolder, filenames, (void*)this); // `downloadComplete` will run after download has completed } @@ -250,7 +250,7 @@ void TestRunner::downloadComplete() { updateStatusLabel("Downloading installer"); - autoTester->downloadFiles(urls, _workingFolder, filenames, (void*)this); + nitpick->downloadFiles(urls, _workingFolder, filenames, (void*)this); // `downloadComplete` will run again after download has completed @@ -505,7 +505,7 @@ void TestRunner::interfaceExecutionComplete() { void TestRunner::evaluateResults() { updateStatusLabel("Evaluating results"); - autoTester->startTestsEvaluation(false, true, _snapshotFolder, _branch, _user); + nitpick->startTestsEvaluation(false, true, _snapshotFolder, _branch, _user); } void TestRunner::automaticTestRunEvaluationComplete(QString zippedFolder, int numberOfFailures) { @@ -618,7 +618,7 @@ void TestRunner::checkTime() { } void TestRunner::updateStatusLabel(const QString& message) { - autoTester->updateStatusLabel(message); + nitpick->updateStatusLabel(message); } void TestRunner::appendLog(const QString& message) { @@ -632,7 +632,7 @@ void TestRunner::appendLog(const QString& message) { _logFile.write("\n"); _logFile.close(); - autoTester->appendLogWindow(message); + nitpick->appendLogWindow(message); } QString TestRunner::getInstallerNameFromURL(const QString& url) { diff --git a/tools/auto-tester/src/TestRunner.h b/tools/nitpick/src/TestRunner.h similarity index 100% rename from tools/auto-tester/src/TestRunner.h rename to tools/nitpick/src/TestRunner.h diff --git a/tools/auto-tester/src/common.h b/tools/nitpick/src/common.h similarity index 100% rename from tools/auto-tester/src/common.h rename to tools/nitpick/src/common.h diff --git a/tools/auto-tester/src/main.cpp b/tools/nitpick/src/main.cpp similarity index 89% rename from tools/auto-tester/src/main.cpp rename to tools/nitpick/src/main.cpp index ac4b4593c5..089a72e6ce 100644 --- a/tools/auto-tester/src/main.cpp +++ b/tools/nitpick/src/main.cpp @@ -8,11 +8,11 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include -#include "ui/AutoTester.h" +#include "ui/Nitpick.h" #include -AutoTester* autoTester; +Nitpick* nitpick; int main(int argc, char *argv[]) { // If no parameters then run in interactive mode @@ -62,13 +62,13 @@ int main(int argc, char *argv[]) { QApplication application(argc, argv); - autoTester = new AutoTester(); - autoTester->setup(); + nitpick = new Nitpick(); + nitpick->setup(); if (!testFolder.isNull()) { - autoTester->startTestsEvaluation(true ,false, testFolder, branch, user); + nitpick->startTestsEvaluation(true ,false, testFolder, branch, user); } else { - autoTester->show(); + nitpick->show(); } return application.exec(); diff --git a/tools/auto-tester/src/ui/BusyWindow.cpp b/tools/nitpick/src/ui/BusyWindow.cpp similarity index 100% rename from tools/auto-tester/src/ui/BusyWindow.cpp rename to tools/nitpick/src/ui/BusyWindow.cpp diff --git a/tools/auto-tester/src/ui/BusyWindow.h b/tools/nitpick/src/ui/BusyWindow.h similarity index 100% rename from tools/auto-tester/src/ui/BusyWindow.h rename to tools/nitpick/src/ui/BusyWindow.h diff --git a/tools/auto-tester/src/ui/BusyWindow.ui b/tools/nitpick/src/ui/BusyWindow.ui similarity index 100% rename from tools/auto-tester/src/ui/BusyWindow.ui rename to tools/nitpick/src/ui/BusyWindow.ui diff --git a/tools/auto-tester/src/ui/HelpWindow.cpp b/tools/nitpick/src/ui/HelpWindow.cpp similarity index 100% rename from tools/auto-tester/src/ui/HelpWindow.cpp rename to tools/nitpick/src/ui/HelpWindow.cpp diff --git a/tools/auto-tester/src/ui/HelpWindow.h b/tools/nitpick/src/ui/HelpWindow.h similarity index 100% rename from tools/auto-tester/src/ui/HelpWindow.h rename to tools/nitpick/src/ui/HelpWindow.h diff --git a/tools/auto-tester/src/ui/HelpWindow.ui b/tools/nitpick/src/ui/HelpWindow.ui similarity index 96% rename from tools/auto-tester/src/ui/HelpWindow.ui rename to tools/nitpick/src/ui/HelpWindow.ui index d2aa0da0d4..1ce6e8c321 100644 --- a/tools/auto-tester/src/ui/HelpWindow.ui +++ b/tools/nitpick/src/ui/HelpWindow.ui @@ -14,7 +14,7 @@ - AutoTester Help + Nitpick Help diff --git a/tools/auto-tester/src/ui/MismatchWindow.cpp b/tools/nitpick/src/ui/MismatchWindow.cpp similarity index 100% rename from tools/auto-tester/src/ui/MismatchWindow.cpp rename to tools/nitpick/src/ui/MismatchWindow.cpp diff --git a/tools/auto-tester/src/ui/MismatchWindow.h b/tools/nitpick/src/ui/MismatchWindow.h similarity index 100% rename from tools/auto-tester/src/ui/MismatchWindow.h rename to tools/nitpick/src/ui/MismatchWindow.h diff --git a/tools/auto-tester/src/ui/MismatchWindow.ui b/tools/nitpick/src/ui/MismatchWindow.ui similarity index 100% rename from tools/auto-tester/src/ui/MismatchWindow.ui rename to tools/nitpick/src/ui/MismatchWindow.ui diff --git a/tools/auto-tester/src/ui/AutoTester.cpp b/tools/nitpick/src/ui/Nitpick.cpp similarity index 72% rename from tools/auto-tester/src/ui/AutoTester.cpp rename to tools/nitpick/src/ui/Nitpick.cpp index d49f3aaa1c..185599538e 100644 --- a/tools/auto-tester/src/ui/AutoTester.cpp +++ b/tools/nitpick/src/ui/Nitpick.cpp @@ -1,5 +1,5 @@ // -// AutoTester.cpp +// Nitpick.cpp // zone/ambientLightInheritence // // Created by Nissim Hadar on 2 Nov 2017. @@ -8,14 +8,14 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "AutoTester.h" +#include "Nitpick.h" #ifdef Q_OS_WIN #include #include #endif -AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) { +Nitpick::Nitpick(QWidget* parent) : QMainWindow(parent) { _ui.setupUi(this); _ui.checkBoxInteractiveMode->setChecked(true); @@ -24,9 +24,9 @@ AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) { _signalMapper = new QSignalMapper(); - connect(_ui.actionClose, &QAction::triggered, this, &AutoTester::on_closeButton_clicked); - connect(_ui.actionAbout, &QAction::triggered, this, &AutoTester::about); - connect(_ui.actionContent, &QAction::triggered, this, &AutoTester::content); + connect(_ui.actionClose, &QAction::triggered, this, &Nitpick::on_closeButton_clicked); + connect(_ui.actionAbout, &QAction::triggered, this, &Nitpick::about); + connect(_ui.actionContent, &QAction::triggered, this, &Nitpick::content); // The second tab hides and shows the Windows task bar #ifndef Q_OS_WIN @@ -36,13 +36,13 @@ AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) { _ui.statusLabel->setText(""); _ui.plainTextEdit->setReadOnly(true); - setWindowTitle("Auto Tester - v7.0"); + setWindowTitle("Nitpick - v1.0"); - // Coming soon to an auto-tester near you... + // Coming soon to a nitpick near you... //// _helpWindow.textBrowser->setText() } -AutoTester::~AutoTester() { +Nitpick::~Nitpick() { delete _signalMapper; if (_test) { @@ -54,7 +54,7 @@ AutoTester::~AutoTester() { } } -void AutoTester::setup() { +void Nitpick::setup() { if (_test) { delete _test; } @@ -87,7 +87,7 @@ void AutoTester::setup() { _testRunner = new TestRunner(dayCheckboxes, timeEditCheckboxes, timeEdits, _ui.workingFolderLabel, _ui.checkBoxServerless, _ui.checkBoxRunLatest, _ui.urlLineEdit, _ui.runNowButton); } -void AutoTester::startTestsEvaluation(const bool isRunningFromCommandLine, +void Nitpick::startTestsEvaluation(const bool isRunningFromCommandLine, const bool isRunningInAutomaticTestRun, const QString& snapshotDirectory, const QString& branch, @@ -96,7 +96,7 @@ void AutoTester::startTestsEvaluation(const bool isRunningFromCommandLine, _test->startTestsEvaluation(isRunningFromCommandLine, isRunningInAutomaticTestRun, snapshotDirectory, branch, user); } -void AutoTester::on_tabWidget_currentChanged(int index) { +void Nitpick::on_tabWidget_currentChanged(int index) { if (index == 0 || index == 2 || index == 3) { _ui.userLineEdit->setDisabled(false); _ui.branchLineEdit->setDisabled(false); @@ -106,73 +106,73 @@ void AutoTester::on_tabWidget_currentChanged(int index) { } } -void AutoTester::on_evaluateTestsButton_clicked() { +void Nitpick::on_evaluateTestsButton_clicked() { _test->startTestsEvaluation(false, false); } -void AutoTester::on_createRecursiveScriptButton_clicked() { +void Nitpick::on_createRecursiveScriptButton_clicked() { _test->createRecursiveScript(); } -void AutoTester::on_createAllRecursiveScriptsButton_clicked() { +void Nitpick::on_createAllRecursiveScriptsButton_clicked() { _test->createAllRecursiveScripts(); } -void AutoTester::on_createTestsButton_clicked() { +void Nitpick::on_createTestsButton_clicked() { _test->createTests(); } -void AutoTester::on_createMDFileButton_clicked() { +void Nitpick::on_createMDFileButton_clicked() { _test->createMDFile(); } -void AutoTester::on_createAllMDFilesButton_clicked() { +void Nitpick::on_createAllMDFilesButton_clicked() { _test->createAllMDFiles(); } -void AutoTester::on_createTestAutoScriptButton_clicked() { +void Nitpick::on_createTestAutoScriptButton_clicked() { _test->createTestAutoScript(); } -void AutoTester::on_createAllTestAutoScriptsButton_clicked() { +void Nitpick::on_createAllTestAutoScriptsButton_clicked() { _test->createAllTestAutoScripts(); } -void AutoTester::on_createTestsOutlineButton_clicked() { +void Nitpick::on_createTestsOutlineButton_clicked() { _test->createTestsOutline(); } -void AutoTester::on_createTestRailTestCasesButton_clicked() { +void Nitpick::on_createTestRailTestCasesButton_clicked() { _test->createTestRailTestCases(); } -void AutoTester::on_createTestRailRunButton_clicked() { +void Nitpick::on_createTestRailRunButton_clicked() { _test->createTestRailRun(); } -void AutoTester::on_setWorkingFolderButton_clicked() { +void Nitpick::on_setWorkingFolderButton_clicked() { _testRunner->setWorkingFolder(); } -void AutoTester::enableRunTabControls() { +void Nitpick::enableRunTabControls() { _ui.runNowButton->setEnabled(true); _ui.daysGroupBox->setEnabled(true); _ui.timesGroupBox->setEnabled(true); } -void AutoTester::on_runNowButton_clicked() { +void Nitpick::on_runNowButton_clicked() { _testRunner->run(); } -void AutoTester::on_checkBoxRunLatest_clicked() { +void Nitpick::on_checkBoxRunLatest_clicked() { _ui.urlLineEdit->setEnabled(!_ui.checkBoxRunLatest->isChecked()); } -void AutoTester::automaticTestRunEvaluationComplete(QString zippedFolderName, int numberOfFailures) { +void Nitpick::automaticTestRunEvaluationComplete(QString zippedFolderName, int numberOfFailures) { _testRunner->automaticTestRunEvaluationComplete(zippedFolderName, numberOfFailures); } -void AutoTester::on_updateTestRailRunResultsButton_clicked() { +void Nitpick::on_updateTestRailRunResultsButton_clicked() { _test->updateTestRailRunResult(); } @@ -180,7 +180,7 @@ void AutoTester::on_updateTestRailRunResultsButton_clicked() { // if (uState & ABS_AUTOHIDE) on_showTaskbarButton_clicked(); // else on_hideTaskbarButton_clicked(); // -void AutoTester::on_hideTaskbarButton_clicked() { +void Nitpick::on_hideTaskbarButton_clicked() { #ifdef Q_OS_WIN APPBARDATA abd = { sizeof abd }; UINT uState = (UINT)SHAppBarMessage(ABM_GETSTATE, &abd); @@ -190,7 +190,7 @@ void AutoTester::on_hideTaskbarButton_clicked() { #endif } -void AutoTester::on_showTaskbarButton_clicked() { +void Nitpick::on_showTaskbarButton_clicked() { #ifdef Q_OS_WIN APPBARDATA abd = { sizeof abd }; UINT uState = (UINT)SHAppBarMessage(ABM_GETSTATE, &abd); @@ -200,23 +200,23 @@ void AutoTester::on_showTaskbarButton_clicked() { #endif } -void AutoTester::on_closeButton_clicked() { +void Nitpick::on_closeButton_clicked() { exit(0); } -void AutoTester::on_createPythonScriptRadioButton_clicked() { +void Nitpick::on_createPythonScriptRadioButton_clicked() { _test->setTestRailCreateMode(PYTHON); } -void AutoTester::on_createXMLScriptRadioButton_clicked() { +void Nitpick::on_createXMLScriptRadioButton_clicked() { _test->setTestRailCreateMode(XML); } -void AutoTester::on_createWebPagePushButton_clicked() { +void Nitpick::on_createWebPagePushButton_clicked() { _test->createWebPage(_ui.updateAWSCheckBox, _ui.awsURLLineEdit); } -void AutoTester::downloadFile(const QUrl& url) { +void Nitpick::downloadFile(const QUrl& url) { _downloaders.emplace_back(new Downloader(url, this)); connect(_downloaders[_index], SIGNAL(downloaded()), _signalMapper, SLOT(map())); @@ -225,7 +225,7 @@ void AutoTester::downloadFile(const QUrl& url) { ++_index; } -void AutoTester::downloadFiles(const QStringList& URLs, const QString& directoryName, const QStringList& filenames, void *caller) { +void Nitpick::downloadFiles(const QStringList& URLs, const QString& directoryName, const QStringList& filenames, void *caller) { connect(_signalMapper, SIGNAL(mapped(int)), this, SLOT(saveFile(int))); _directoryName = directoryName; @@ -251,7 +251,7 @@ void AutoTester::downloadFiles(const QStringList& URLs, const QString& directory } } -void AutoTester::saveFile(int index) { +void Nitpick::saveFile(int index) { try { QFile file(_directoryName + "/" + _filenames[index]); file.open(QIODevice::WriteOnly); @@ -277,34 +277,34 @@ void AutoTester::saveFile(int index) { } } -void AutoTester::about() { +void Nitpick::about() { QMessageBox::information(0, "About", QString("Built ") + __DATE__ + ", " + __TIME__); } -void AutoTester::content() { +void Nitpick::content() { _helpWindow.show(); } -void AutoTester::setUserText(const QString& user) { +void Nitpick::setUserText(const QString& user) { _ui.userLineEdit->setText(user); } -QString AutoTester::getSelectedUser() { +QString Nitpick::getSelectedUser() { return _ui.userLineEdit->text(); } -void AutoTester::setBranchText(const QString& branch) { +void Nitpick::setBranchText(const QString& branch) { _ui.branchLineEdit->setText(branch); } -QString AutoTester::getSelectedBranch() { +QString Nitpick::getSelectedBranch() { return _ui.branchLineEdit->text(); } -void AutoTester::updateStatusLabel(const QString& status) { +void Nitpick::updateStatusLabel(const QString& status) { _ui.statusLabel->setText(status); } -void AutoTester::appendLogWindow(const QString& message) { +void Nitpick::appendLogWindow(const QString& message) { _ui.plainTextEdit->appendPlainText(message); } \ No newline at end of file diff --git a/tools/auto-tester/src/ui/AutoTester.h b/tools/nitpick/src/ui/Nitpick.h similarity index 92% rename from tools/auto-tester/src/ui/AutoTester.h rename to tools/nitpick/src/ui/Nitpick.h index 429a8b60e1..21b917654b 100644 --- a/tools/auto-tester/src/ui/AutoTester.h +++ b/tools/nitpick/src/ui/Nitpick.h @@ -1,5 +1,5 @@ // -// AutoTester.h +// Nitpick.h // // Created by Nissim Hadar on 2 Nov 2017. // Copyright 2013 High Fidelity, Inc. @@ -7,13 +7,13 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef hifi_AutoTester_h -#define hifi_AutoTester_h +#ifndef hifi_Nitpick_h +#define hifi_Nitpick_h #include #include #include -#include "ui_AutoTester.h" +#include "ui_Nitpick.h" #include "../Downloader.h" #include "../Test.h" @@ -22,12 +22,12 @@ #include "../TestRunner.h" #include "../AWSInterface.h" -class AutoTester : public QMainWindow { +class Nitpick : public QMainWindow { Q_OBJECT public: - AutoTester(QWidget* parent = Q_NULLPTR); - ~AutoTester(); + Nitpick(QWidget* parent = Q_NULLPTR); + ~Nitpick(); void setup(); @@ -95,7 +95,7 @@ private slots: void content(); private: - Ui::AutoTesterClass _ui; + Ui::NitpickClass _ui; Test* _test{ nullptr }; TestRunner* _testRunner{ nullptr }; @@ -121,4 +121,4 @@ private: void* _caller; }; -#endif // hifi_AutoTester_h \ No newline at end of file +#endif // hifi_Nitpick_h \ No newline at end of file diff --git a/tools/auto-tester/src/ui/AutoTester.ui b/tools/nitpick/src/ui/Nitpick.ui similarity index 99% rename from tools/auto-tester/src/ui/AutoTester.ui rename to tools/nitpick/src/ui/Nitpick.ui index 08f4b46723..5e20e75553 100644 --- a/tools/auto-tester/src/ui/AutoTester.ui +++ b/tools/nitpick/src/ui/Nitpick.ui @@ -1,7 +1,7 @@ - AutoTesterClass - + NitpickClass + 0 @@ -17,7 +17,7 @@ - AutoTester + Nitpick diff --git a/tools/auto-tester/src/ui/TestRailResultsSelectorWindow.cpp b/tools/nitpick/src/ui/TestRailResultsSelectorWindow.cpp similarity index 100% rename from tools/auto-tester/src/ui/TestRailResultsSelectorWindow.cpp rename to tools/nitpick/src/ui/TestRailResultsSelectorWindow.cpp diff --git a/tools/auto-tester/src/ui/TestRailResultsSelectorWindow.h b/tools/nitpick/src/ui/TestRailResultsSelectorWindow.h similarity index 100% rename from tools/auto-tester/src/ui/TestRailResultsSelectorWindow.h rename to tools/nitpick/src/ui/TestRailResultsSelectorWindow.h diff --git a/tools/auto-tester/src/ui/TestRailResultsSelectorWindow.ui b/tools/nitpick/src/ui/TestRailResultsSelectorWindow.ui similarity index 100% rename from tools/auto-tester/src/ui/TestRailResultsSelectorWindow.ui rename to tools/nitpick/src/ui/TestRailResultsSelectorWindow.ui diff --git a/tools/auto-tester/src/ui/TestRailRunSelectorWindow.cpp b/tools/nitpick/src/ui/TestRailRunSelectorWindow.cpp similarity index 100% rename from tools/auto-tester/src/ui/TestRailRunSelectorWindow.cpp rename to tools/nitpick/src/ui/TestRailRunSelectorWindow.cpp diff --git a/tools/auto-tester/src/ui/TestRailRunSelectorWindow.h b/tools/nitpick/src/ui/TestRailRunSelectorWindow.h similarity index 100% rename from tools/auto-tester/src/ui/TestRailRunSelectorWindow.h rename to tools/nitpick/src/ui/TestRailRunSelectorWindow.h diff --git a/tools/auto-tester/src/ui/TestRailRunSelectorWindow.ui b/tools/nitpick/src/ui/TestRailRunSelectorWindow.ui similarity index 100% rename from tools/auto-tester/src/ui/TestRailRunSelectorWindow.ui rename to tools/nitpick/src/ui/TestRailRunSelectorWindow.ui diff --git a/tools/auto-tester/src/ui/TestRailTestCasesSelectorWindow.cpp b/tools/nitpick/src/ui/TestRailTestCasesSelectorWindow.cpp similarity index 100% rename from tools/auto-tester/src/ui/TestRailTestCasesSelectorWindow.cpp rename to tools/nitpick/src/ui/TestRailTestCasesSelectorWindow.cpp diff --git a/tools/auto-tester/src/ui/TestRailTestCasesSelectorWindow.h b/tools/nitpick/src/ui/TestRailTestCasesSelectorWindow.h similarity index 100% rename from tools/auto-tester/src/ui/TestRailTestCasesSelectorWindow.h rename to tools/nitpick/src/ui/TestRailTestCasesSelectorWindow.h diff --git a/tools/auto-tester/src/ui/TestRailTestCasesSelectorWindow.ui b/tools/nitpick/src/ui/TestRailTestCasesSelectorWindow.ui similarity index 100% rename from tools/auto-tester/src/ui/TestRailTestCasesSelectorWindow.ui rename to tools/nitpick/src/ui/TestRailTestCasesSelectorWindow.ui From d2a1b35f969027806483a8651a54af740232eb51 Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 8 Nov 2018 16:50:11 -0800 Subject: [PATCH 54/82] Fix desktop case showing Vive controls. --- interface/resources/html/tabletHelp.html | 20 +++++++++++--------- interface/src/Application.cpp | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index cc931580c3..8d4214d5af 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -94,15 +94,14 @@ switch (index) { case 0: - showHandControllers(); - break; - case 1: showGamepad(); break; - case 2: + case 1: showKbm(); break; - + case 2: + showHandControllers(); + break; default: } } @@ -142,23 +141,26 @@ handControllerImageURL = "img/tablet-help-vive.jpg"; break; case "oculus": + handControllerImageURL = "img/tablet-help-oculus.jpg"; + break; default: - handControllerImageURL = "img/tablet-help-oculus.jpg"; + handControllerImageURL = null; + count = 2; } switch (params.defaultTab) { case "handControllers": showHandControllers(); - index = 0; + index = 2; break; case "gamepad": showGamepad(); - index = 1; + index = 0; break; case "kbm": default: showKbm(); - index = 2; + index = 1; } } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 245e6c0017..ecb738c7c4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3366,7 +3366,7 @@ void Application::showHelp() { static const QString TAB_GAMEPAD = "gamepad"; static const QString TAB_HAND_CONTROLLERS = "handControllers"; - QString handControllerName = HAND_CONTROLLER_NAME_VIVE; + QString handControllerName = ""; QString defaultTab = TAB_KEYBOARD_MOUSE; if (PluginUtils::isViveControllerAvailable()) { From 8d4d0beebd9138f8256fd63903d4290341c6f1ee Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 8 Nov 2018 17:52:07 -0800 Subject: [PATCH 55/82] Cleanup --- interface/src/Application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5844462497..368f4d4d9a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4834,6 +4834,7 @@ void Application::idle() { _idleLoopStdev.reset(); } } + _overlayConductor.update(secondsSinceLastUpdate); _gameLoopCounter.increment(); From a535519fbcd8441076c87c03500a7bf7ff9472cd Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 12 Nov 2018 11:00:24 -0800 Subject: [PATCH 56/82] Typo. --- tools/nitpick/src/TestRunner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nitpick/src/TestRunner.cpp b/tools/nitpick/src/TestRunner.cpp index 0e6acf073e..20f419a356 100644 --- a/tools/nitpick/src/TestRunner.cpp +++ b/tools/nitpick/src/TestRunner.cpp @@ -488,7 +488,7 @@ void TestRunner::runInterfaceWithTestScript() { " --testScript " + testScript + " quitWhenFinished" + " --testResultsLocation " + _snapshotFolder; - interfaceWorker->setCommandLine(commandLine); + _interfaceWorker->setCommandLine(commandLine); emit startInterface(); #elif defined Q_OS_MAC // On The Mac, we need to resize Interface. The Interface window opens a few seconds after the process From 4a158ea789d3380f92cf2c0716e297185c372942 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 12 Nov 2018 11:07:18 -0800 Subject: [PATCH 57/82] Fixed Linux compilation error. --- tools/nitpick/src/ui/Nitpick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nitpick/src/ui/Nitpick.cpp b/tools/nitpick/src/ui/Nitpick.cpp index 9ae21d0233..a4aef8fad5 100644 --- a/tools/nitpick/src/ui/Nitpick.cpp +++ b/tools/nitpick/src/ui/Nitpick.cpp @@ -100,7 +100,7 @@ void Nitpick::on_tabWidget_currentChanged(int index) { // Enable the GitHub edit boxes as required #ifdef Q_OS_WIN if (index == 0 || index == 2 || index == 3) { -#elif defined Q_OS_MAC +#else if (index == 0 || index == 1 || index == 2) { #endif _ui.userLineEdit->setDisabled(false); From 05033b7da1c5343d35aff316444c861e56edecb8 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 12 Nov 2018 12:19:32 -0800 Subject: [PATCH 58/82] Echo status to screen --- tools/nitpick/src/TestRunner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/nitpick/src/TestRunner.cpp b/tools/nitpick/src/TestRunner.cpp index 0e6acf073e..70321e088e 100644 --- a/tools/nitpick/src/TestRunner.cpp +++ b/tools/nitpick/src/TestRunner.cpp @@ -173,7 +173,9 @@ void TestRunner::setWorkingFolder() { } script.write("#!/bin/sh\n\n"); + script.write("echo resizing interface"); script.write(("osascript " + _workingFolder + "/setInterfaceSizeAndPosition.scpt\n").toStdString().c_str()); + script.write("echo resize complete"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); #endif From e378a1b79cbea8c811af2472422c1d581545ba33 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 13 Nov 2018 08:39:52 -0800 Subject: [PATCH 59/82] Added missing CR --- tools/nitpick/src/TestRunner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/nitpick/src/TestRunner.cpp b/tools/nitpick/src/TestRunner.cpp index 868e608982..db6ce6cece 100644 --- a/tools/nitpick/src/TestRunner.cpp +++ b/tools/nitpick/src/TestRunner.cpp @@ -173,9 +173,9 @@ void TestRunner::setWorkingFolder() { } script.write("#!/bin/sh\n\n"); - script.write("echo resizing interface"); + script.write("echo resizing interface\n"); script.write(("osascript " + _workingFolder + "/setInterfaceSizeAndPosition.scpt\n").toStdString().c_str()); - script.write("echo resize complete"); + script.write("echo resize complete\n"); script.close(); script.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner); #endif From c7e0cb1757b1d906a72b9624c799abb86b868f15 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 13 Nov 2018 10:11:22 -0800 Subject: [PATCH 60/82] Moved downloader deletion to after completion of download. --- tools/nitpick/src/ui/Nitpick.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/nitpick/src/ui/Nitpick.cpp b/tools/nitpick/src/ui/Nitpick.cpp index a4aef8fad5..8893173284 100644 --- a/tools/nitpick/src/ui/Nitpick.cpp +++ b/tools/nitpick/src/ui/Nitpick.cpp @@ -246,10 +246,6 @@ void Nitpick::downloadFiles(const QStringList& URLs, const QString& directoryNam _ui.progressBar->setValue(0); _ui.progressBar->setVisible(true); - foreach (auto downloader, _downloaders) { - delete downloader; - } - _downloaders.clear(); for (int i = 0; i < _numberOfFilesToDownload; ++i) { downloadFile(URLs[i]); @@ -277,6 +273,10 @@ void Nitpick::saveFile(int index) { } else if (_caller == _testRunner) { _testRunner->downloadComplete(); } + + foreach (auto downloader, _downloaders) { + delete downloader; + } } else { _ui.progressBar->setValue(_numberOfFilesDownloaded); } From 234a46bd4316f641d1d6c3356808a0acecf68cd0 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 13 Nov 2018 10:12:06 -0800 Subject: [PATCH 61/82] Evaluate results even if Interface crashed midway. --- tools/nitpick/src/TestRunner.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/nitpick/src/TestRunner.cpp b/tools/nitpick/src/TestRunner.cpp index 868e608982..8667852032 100644 --- a/tools/nitpick/src/TestRunner.cpp +++ b/tools/nitpick/src/TestRunner.cpp @@ -539,9 +539,7 @@ void TestRunner::interfaceExecutionComplete() { QFileInfo testCompleted(QDir::toNativeSeparators(_snapshotFolder) +"/tests_completed.txt"); if (!testCompleted.exists()) { - QMessageBox::critical(0, "Tests not completed", "Interface seems to have crashed before completion of the test scripts"); - _runNow->setEnabled(true); - return; + QMessageBox::critical(0, "Tests not completed", "Interface seems to have crashed before completion of the test scripts\nExisting images will be evaluated"); } evaluateResults(); From 10d045b11b0dfe78eda1dcb82260dfe3dcf0503f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 8 Nov 2018 17:16:34 -0800 Subject: [PATCH 62/82] fix infinate loading if entity server is not running --- interface/src/Application.cpp | 1 + interface/src/octree/SafeLanding.cpp | 15 ++++++++++++++- interface/src/octree/SafeLanding.h | 1 + scripts/system/interstitialPage.js | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 75a9f598f7..a9d75e745c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5705,6 +5705,7 @@ void Application::update(float deltaTime) { quint64 now = usecTimestampNow(); if (isServerlessMode() || _octreeProcessor.isLoadSequenceComplete()) { bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); + if (gpuTextureMemSizeStable() || !enableInterstitial) { // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway _lastPhysicsCheckTime = now; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index db381d5350..224ef064b6 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -11,6 +11,7 @@ #include "SafeLanding.h" +#include #include #include "EntityTreeRenderer.h" @@ -19,6 +20,8 @@ #include "Application.h" const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits::max() + 1; +const quint64 MAX_ELAPSED_TIME = 1000; // msec +const quint64 MICRO_TO_MILI_SECONDS = 1000; namespace { template bool lessThanWraparound(int a, int b) { @@ -107,7 +110,9 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) { } bool SafeLanding::isLoadSequenceComplete() { - if (isEntityLoadingComplete() && isSequenceNumbersComplete()) { + quint64 elapsedTime = (usecTimestampNow() - _startTime) / MICRO_TO_MILI_SECONDS; + if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) || + (elapsedTime >= MAX_ELAPSED_TIME && isEntityServerNotRunning() && _sequenceNumbers.empty())) { Locker lock(_lock); _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; @@ -119,6 +124,14 @@ bool SafeLanding::isLoadSequenceComplete() { return !_trackingEntities; } +bool SafeLanding::isEntityServerNotRunning() { + auto nodeList = DependencyManager::get(); + const auto& domainHandler = nodeList->getDomainHandler(); + auto entityServer = nodeList->soloNodeOfType(NodeType::EntityServer); + + return (domainHandler.isConnected() && !entityServer); +} + float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15; diff --git a/interface/src/octree/SafeLanding.h b/interface/src/octree/SafeLanding.h index 51357b60ff..157fda53aa 100644 --- a/interface/src/octree/SafeLanding.h +++ b/interface/src/octree/SafeLanding.h @@ -40,6 +40,7 @@ private: bool isSequenceNumbersComplete(); void debugDumpSequenceIDs() const; bool isEntityLoadingComplete(); + bool isEntityServerNotRunning(); std::mutex _lock; using Locker = std::lock_guard; diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index b7c5809b3a..9a67964801 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -15,7 +15,7 @@ (function() { Script.include("/~/system/libraries/Xform.js"); Script.include("/~/system/libraries/globals.js"); - var DEBUG = false; + var DEBUG = true; var TOTAL_LOADING_PROGRESS = 3.7; var EPSILON = 0.05; var TEXTURE_EPSILON = 0.01; From 1a95ee2b31fcb3b0dcb77d758ce17d9d4d9fb14a Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 9 Nov 2018 09:27:55 -0800 Subject: [PATCH 63/82] making requested changes --- interface/src/octree/SafeLanding.cpp | 4 ++-- scripts/system/interstitialPage.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 224ef064b6..ff32e03006 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "EntityTreeRenderer.h" #include "RenderableModelEntityItem.h" @@ -21,7 +22,6 @@ const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits::max() + 1; const quint64 MAX_ELAPSED_TIME = 1000; // msec -const quint64 MICRO_TO_MILI_SECONDS = 1000; namespace { template bool lessThanWraparound(int a, int b) { @@ -110,7 +110,7 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) { } bool SafeLanding::isLoadSequenceComplete() { - quint64 elapsedTime = (usecTimestampNow() - _startTime) / MICRO_TO_MILI_SECONDS; + quint64 elapsedTime = (usecTimestampNow() - _startTime) / USECS_PER_MSEC; if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) || (elapsedTime >= MAX_ELAPSED_TIME && isEntityServerNotRunning() && _sequenceNumbers.empty())) { Locker lock(_lock); diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 9a67964801..cd8869d805 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -15,7 +15,7 @@ (function() { Script.include("/~/system/libraries/Xform.js"); Script.include("/~/system/libraries/globals.js"); - var DEBUG = true; + var DEBUG = false; var TOTAL_LOADING_PROGRESS = 3.7; var EPSILON = 0.05; var TEXTURE_EPSILON = 0.01; @@ -197,7 +197,7 @@ var loadingBarProgress = Overlays.addOverlay("image3d", { name: "Loading-Bar-Progress", - localPosition: { x: 0.0, y: -0.86, z: 0.0 }, + localPosition: { x: 0.0, y: -0.91, z: 0.0 }, url: LOADING_BAR_PROGRESS, alpha: 1, dimensions: { x: TOTAL_LOADING_PROGRESS, y: 0.3}, @@ -482,7 +482,7 @@ var end = 0; var xLocalPosition = (progressPercentage * (end - start)) + start; var properties = { - localPosition: { x: xLocalPosition, y: -0.93, z: 0.0 }, + localPosition: { x: xLocalPosition, y: -0.91, z: 0.0 }, dimensions: { x: progress, y: 0.3 From 812373cdabe1f8aa81fd3f427bbc58b6326c84c9 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 9 Nov 2018 10:37:21 -0800 Subject: [PATCH 64/82] fixing loading bar visual --- scripts/system/interstitialPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index cd8869d805..e4dc778985 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -274,6 +274,7 @@ previousCameraMode = Camera.mode; Camera.mode = "first person"; updateProgressBar(0.0); + scaleInterstitialPage(MyAvatar.sensorToWorldScale); timer = Script.setTimeout(update, 2000); } } @@ -482,7 +483,7 @@ var end = 0; var xLocalPosition = (progressPercentage * (end - start)) + start; var properties = { - localPosition: { x: xLocalPosition, y: -0.91, z: 0.0 }, + localPosition: { x: xLocalPosition, y: (HMD.active ? -0.93 : -0.91), z: 0.0 }, dimensions: { x: progress, y: 0.3 From c7b3b9c0d2313b416406212fcd976b4f66403c1d Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 13 Nov 2018 11:49:59 -0800 Subject: [PATCH 65/82] Reverted previous commit. --- tools/nitpick/src/ui/Nitpick.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/nitpick/src/ui/Nitpick.cpp b/tools/nitpick/src/ui/Nitpick.cpp index 8893173284..a4aef8fad5 100644 --- a/tools/nitpick/src/ui/Nitpick.cpp +++ b/tools/nitpick/src/ui/Nitpick.cpp @@ -246,6 +246,10 @@ void Nitpick::downloadFiles(const QStringList& URLs, const QString& directoryNam _ui.progressBar->setValue(0); _ui.progressBar->setVisible(true); + foreach (auto downloader, _downloaders) { + delete downloader; + } + _downloaders.clear(); for (int i = 0; i < _numberOfFilesToDownload; ++i) { downloadFile(URLs[i]); @@ -273,10 +277,6 @@ void Nitpick::saveFile(int index) { } else if (_caller == _testRunner) { _testRunner->downloadComplete(); } - - foreach (auto downloader, _downloaders) { - delete downloader; - } } else { _ui.progressBar->setValue(_numberOfFilesDownloaded); } From 620c9e2f93fd62fdfab33a6e73bb6c8035cebd90 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 13 Nov 2018 13:38:44 -0800 Subject: [PATCH 66/82] All results now logged, so don't mark as failed. --- tools/nitpick/src/Test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nitpick/src/Test.cpp b/tools/nitpick/src/Test.cpp index 13a03c32e8..47458d00ee 100644 --- a/tools/nitpick/src/Test.cpp +++ b/tools/nitpick/src/Test.cpp @@ -167,7 +167,7 @@ void Test::appendTestResultsToFile(const QString& _testResultsFolderPath, TestRe // Create text file describing the failure QTextStream stream(&descriptionFile); - stream << "Test failed in folder " << testResult._pathname.left(testResult._pathname.length() - 1) << endl; // remove trailing '/' + stream << "Test in folder " << testResult._pathname.left(testResult._pathname.length() - 1) << endl; // remove trailing '/' stream << "Expected image was " << testResult._expectedImageFilename << endl; stream << "Actual image was " << testResult._actualImageFilename << endl; stream << "Similarity index was " << testResult._error << endl; From ecee31960299f71859d621568ccdfa029c778d8a Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Tue, 13 Nov 2018 15:20:46 -0800 Subject: [PATCH 67/82] Get logic working correctly. --- interface/resources/html/tabletHelp.html | 2 +- interface/src/Application.cpp | 46 +++++++++++++++++++----- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/interface/resources/html/tabletHelp.html b/interface/resources/html/tabletHelp.html index 8d4214d5af..dd7931d0ed 100644 --- a/interface/resources/html/tabletHelp.html +++ b/interface/resources/html/tabletHelp.html @@ -144,7 +144,7 @@ handControllerImageURL = "img/tablet-help-oculus.jpg"; break; default: - handControllerImageURL = null; + handControllerImageURL = ""; count = 2; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e537d618e9..9430d15794 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3400,21 +3400,51 @@ void Application::showHelp() { static const QString TAB_GAMEPAD = "gamepad"; static const QString TAB_HAND_CONTROLLERS = "handControllers"; - QString handControllerName = ""; + QString handControllerName; QString defaultTab = TAB_KEYBOARD_MOUSE; - if (PluginUtils::isViveControllerAvailable()) { - defaultTab = TAB_HAND_CONTROLLERS; - handControllerName = HAND_CONTROLLER_NAME_VIVE; - } else if (PluginUtils::isOculusTouchControllerAvailable()) { - defaultTab = TAB_HAND_CONTROLLERS; - handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; - } else if (qApp->getActiveDisplayPlugin()->getName() == "WindowMS") { + qDebug() << "Printing names..."; + for (auto& inputPlugin : PluginManager::getInstance()->getInputPlugins()) { + qDebug() << inputPlugin->getName(); + auto subdeviceNames = inputPlugin->getSubdeviceNames(); + for (auto& subdeviceName : subdeviceNames) { + qDebug() << " -|" << subdeviceName; + } + } + + qDebug() << "----------------------"; + + auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins(); + for (auto& displayPlugin : displayPlugins) { + qDebug() << displayPlugin->getName(); + } + + if (PluginUtils::isHMDAvailable("WindowsMR")) { defaultTab = TAB_HAND_CONTROLLERS; handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; + //} else if (PluginUtils::isViveControllerAvailable()) { + } else if (PluginUtils::isHMDAvailable("HTC Vive")) { + defaultTab = TAB_HAND_CONTROLLERS; + handControllerName = HAND_CONTROLLER_NAME_VIVE; + } else if (PluginUtils::isHMDAvailable("Oculus Rift")) { + defaultTab = TAB_HAND_CONTROLLERS; + handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; } else if (PluginUtils::isXboxControllerAvailable()) { defaultTab = TAB_GAMEPAD; } + //if (QString::compare(qApp->getActiveDisplayPlugin()->getName(), "WindowsMR") == 0) { + // defaultTab = TAB_HAND_CONTROLLERS; + // handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; + ////} else if (PluginUtils::isViveControllerAvailable()) { + //} else if (QString::compare(qApp->getActiveDisplayPlugin()->getName(), "HTC Vive") == 0) { + // defaultTab = TAB_HAND_CONTROLLERS; + // handControllerName = HAND_CONTROLLER_NAME_VIVE; + //} else if (PluginUtils::isOculusTouchControllerAvailable()) { + // defaultTab = TAB_HAND_CONTROLLERS; + // handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; + //} else if (PluginUtils::isXboxControllerAvailable()) { + // defaultTab = TAB_GAMEPAD; + //} // TODO need some way to detect windowsMR to load controls reference default tab in Help > Controls Reference menu. QUrlQuery queryString; From dd8bbeb0e5378c49d22db7b740a28cfe8e98abea Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Tue, 13 Nov 2018 15:36:25 -0800 Subject: [PATCH 68/82] Clean up code and remove comments. --- interface/src/Application.cpp | 41 ++++++----------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 9430d15794..aec580ff9d 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3396,6 +3396,10 @@ void Application::showHelp() { static const QString HAND_CONTROLLER_NAME_OCULUS_TOUCH = "oculus"; static const QString HAND_CONTROLLER_NAME_WINDOWS_MR = "windowsMR"; + static const QString VIVE_PLUGIN_NAME = "HTC Vive"; + static const QString OCULUS_RIFT_PLUGIN_NAME = "Oculus Rift"; + static const QString WINDOWS_MR_PLUGIN_NAME = "WindowsMR"; + static const QString TAB_KEYBOARD_MOUSE = "kbm"; static const QString TAB_GAMEPAD = "gamepad"; static const QString TAB_HAND_CONTROLLERS = "handControllers"; @@ -3403,49 +3407,18 @@ void Application::showHelp() { QString handControllerName; QString defaultTab = TAB_KEYBOARD_MOUSE; - qDebug() << "Printing names..."; - for (auto& inputPlugin : PluginManager::getInstance()->getInputPlugins()) { - qDebug() << inputPlugin->getName(); - auto subdeviceNames = inputPlugin->getSubdeviceNames(); - for (auto& subdeviceName : subdeviceNames) { - qDebug() << " -|" << subdeviceName; - } - } - - qDebug() << "----------------------"; - - auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins(); - for (auto& displayPlugin : displayPlugins) { - qDebug() << displayPlugin->getName(); - } - - if (PluginUtils::isHMDAvailable("WindowsMR")) { + if (PluginUtils::isHMDAvailable(WINDOWS_MR_PLUGIN_NAME)) { defaultTab = TAB_HAND_CONTROLLERS; handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; - //} else if (PluginUtils::isViveControllerAvailable()) { - } else if (PluginUtils::isHMDAvailable("HTC Vive")) { + } else if (PluginUtils::isHMDAvailable(VIVE_PLUGIN_NAME)) { defaultTab = TAB_HAND_CONTROLLERS; handControllerName = HAND_CONTROLLER_NAME_VIVE; - } else if (PluginUtils::isHMDAvailable("Oculus Rift")) { + } else if (PluginUtils::isHMDAvailable(OCULUS_RIFT_PLUGIN_NAME)) { defaultTab = TAB_HAND_CONTROLLERS; handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; } else if (PluginUtils::isXboxControllerAvailable()) { defaultTab = TAB_GAMEPAD; } - //if (QString::compare(qApp->getActiveDisplayPlugin()->getName(), "WindowsMR") == 0) { - // defaultTab = TAB_HAND_CONTROLLERS; - // handControllerName = HAND_CONTROLLER_NAME_WINDOWS_MR; - ////} else if (PluginUtils::isViveControllerAvailable()) { - //} else if (QString::compare(qApp->getActiveDisplayPlugin()->getName(), "HTC Vive") == 0) { - // defaultTab = TAB_HAND_CONTROLLERS; - // handControllerName = HAND_CONTROLLER_NAME_VIVE; - //} else if (PluginUtils::isOculusTouchControllerAvailable()) { - // defaultTab = TAB_HAND_CONTROLLERS; - // handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; - //} else if (PluginUtils::isXboxControllerAvailable()) { - // defaultTab = TAB_GAMEPAD; - //} - // TODO need some way to detect windowsMR to load controls reference default tab in Help > Controls Reference menu. QUrlQuery queryString; queryString.addQueryItem("handControllerName", handControllerName); From 1e17b878e70d3e7dd90a10c0c0a0708ab6a72ed8 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 15 Nov 2018 07:32:26 -0800 Subject: [PATCH 69/82] CR updates. --- tools/nitpick/src/PythonInterface.h | 3 +-- tools/nitpick/src/TestRunner.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/nitpick/src/PythonInterface.h b/tools/nitpick/src/PythonInterface.h index a218b68039..a6e954f356 100644 --- a/tools/nitpick/src/PythonInterface.h +++ b/tools/nitpick/src/PythonInterface.h @@ -21,8 +21,7 @@ public: private: #ifdef Q_OS_WIN const QString _pythonExe{ "python.exe" }; -#endif -#ifdef Q_OS_MACOS +#elif const QString _pythonExe{ "python" }; #endif diff --git a/tools/nitpick/src/TestRunner.h b/tools/nitpick/src/TestRunner.h index 11129d2f36..00f0f66ecf 100644 --- a/tools/nitpick/src/TestRunner.h +++ b/tools/nitpick/src/TestRunner.h @@ -94,7 +94,7 @@ private: #elif defined(Q_OS_MAC) const QString INSTALLER_FILENAME_LATEST{ "HighFidelity-Beta-latest-dev.dmg" }; #else - const QString INSTALLER_FILENAME_LATEST{ "just to pass compilation" }; + const QString INSTALLER_FILENAME_LATEST{ "" }; #endif QString _installerURL; From fb0a84e80047c05bf788a31253c4f9026546797f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 15 Nov 2018 07:54:56 -0800 Subject: [PATCH 70/82] CR updates. --- tools/nitpick/src/PythonInterface.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/nitpick/src/PythonInterface.h b/tools/nitpick/src/PythonInterface.h index a6e954f356..947b359037 100644 --- a/tools/nitpick/src/PythonInterface.h +++ b/tools/nitpick/src/PythonInterface.h @@ -21,7 +21,8 @@ public: private: #ifdef Q_OS_WIN const QString _pythonExe{ "python.exe" }; -#elif +#else + // Both Mac and Linux use "python" const QString _pythonExe{ "python" }; #endif From 20ad05726efd0d86dac24f924f36d741b76cd014 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 13 Nov 2018 15:13:30 -0800 Subject: [PATCH 71/82] entity server timout --- .../qml/hifi/tablet/TabletAddressDialog.qml | 2 +- interface/src/Application.cpp | 26 ++++++++++++++++++- interface/src/Application.h | 4 +++ interface/src/octree/SafeLanding.cpp | 15 +---------- interface/src/octree/SafeLanding.h | 1 - 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index b8972378ad..ab0a98a8c5 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -56,7 +56,7 @@ StackView { Qt.callLater(function() { addressBarDialog.keyboardEnabled = HMD.active; addressLine.forceActiveFocus(); - addressBarDialog.raised = true; + addressBarDialog.keyboardRaised = true; }) } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a9d75e745c..47a73cee57 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -371,6 +371,8 @@ static const QString INFO_HELP_PATH = "html/tabletHelp.html"; static const unsigned int THROTTLED_SIM_FRAMERATE = 15; static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SIM_FRAMERATE; +static const int ENTITY_SERVER_ADDED_TIMEOUT = 5000; +static const int ENTITY_SERVER_CONNECTION_TIMEOUT = 5000; static const uint32_t INVALID_FRAME = UINT32_MAX; @@ -1224,6 +1226,18 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo getOverlays().deleteOverlay(getTabletScreenID()); getOverlays().deleteOverlay(getTabletHomeButtonID()); getOverlays().deleteOverlay(getTabletFrameID()); + _failedToConnectToEntityServer = false; + }); + + _entityServerConnectionTimer.setSingleShot(true); + connect(&_entityServerConnectionTimer, &QTimer::timeout, this, &Application::setFailedToConnectToEntityServer); + + connect(&domainHandler, &DomainHandler::connectedToDomain, this, [this]() { + if (!isServerlessMode()) { + _entityServerConnectionTimer.setInterval(ENTITY_SERVER_ADDED_TIMEOUT); + _entityServerConnectionTimer.start(); + _failedToConnectToEntityServer = false; + } }); connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &Application::domainConnectionRefused); @@ -6630,7 +6644,13 @@ void Application::resettingDomain() { } void Application::nodeAdded(SharedNodePointer node) const { - // nothing to do here + if (node->getType() == NodeType::EntityServer) { + if (!_failedToConnectToEntityServer) { + _entityServerConnectionTimer.stop(); + _entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT); + _entityServerConnectionTimer.start(); + } + } } void Application::nodeActivated(SharedNodePointer node) { @@ -6658,6 +6678,10 @@ void Application::nodeActivated(SharedNodePointer node) { if (node->getType() == NodeType::EntityServer) { _queryExpiry = SteadyClock::now(); _octreeQuery.incrementConnectionID(); + + if (!_failedToConnectToEntityServer) { + _entityServerConnectionTimer.stop(); + } } if (node->getType() == NodeType::AudioMixer && !isInterstitialMode()) { diff --git a/interface/src/Application.h b/interface/src/Application.h index 14e30b8006..053cb158e0 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -307,6 +307,7 @@ public: bool isServerlessMode() const; bool isInterstitialMode() const { return _interstitialMode; } + bool failedToConnectToEntityServer() const { return _failedToConnectToEntityServer; } void replaceDomainContent(const QString& url); @@ -460,6 +461,7 @@ private slots: void loadSettings(); void saveSettings() const; + void setFailedToConnectToEntityServer() { _failedToConnectToEntityServer = true; } bool acceptSnapshot(const QString& urlString); bool askToSetAvatarUrl(const QString& url); @@ -710,6 +712,7 @@ private: bool _isForeground = true; // starts out assumed to be in foreground bool _isGLInitialized { false }; bool _physicsEnabled { false }; + bool _failedToConnectToEntityServer { false }; bool _reticleClickPressed { false }; @@ -756,6 +759,7 @@ private: QStringList _addAssetToWorldInfoMessages; // Info message QTimer _addAssetToWorldInfoTimer; QTimer _addAssetToWorldErrorTimer; + mutable QTimer _entityServerConnectionTimer; FileScriptingInterface* _fileDownload; AudioInjectorPointer _snapshotSoundInjector; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index ff32e03006..9efad22d09 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -11,9 +11,7 @@ #include "SafeLanding.h" -#include #include -#include #include "EntityTreeRenderer.h" #include "RenderableModelEntityItem.h" @@ -21,7 +19,6 @@ #include "Application.h" const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits::max() + 1; -const quint64 MAX_ELAPSED_TIME = 1000; // msec namespace { template bool lessThanWraparound(int a, int b) { @@ -110,9 +107,7 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) { } bool SafeLanding::isLoadSequenceComplete() { - quint64 elapsedTime = (usecTimestampNow() - _startTime) / USECS_PER_MSEC; - if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) || - (elapsedTime >= MAX_ELAPSED_TIME && isEntityServerNotRunning() && _sequenceNumbers.empty())) { + if ((isEntityLoadingComplete() && isSequenceNumbersComplete()) || qApp->failedToConnectToEntityServer()) { Locker lock(_lock); _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; @@ -124,14 +119,6 @@ bool SafeLanding::isLoadSequenceComplete() { return !_trackingEntities; } -bool SafeLanding::isEntityServerNotRunning() { - auto nodeList = DependencyManager::get(); - const auto& domainHandler = nodeList->getDomainHandler(); - auto entityServer = nodeList->soloNodeOfType(NodeType::EntityServer); - - return (domainHandler.isConnected() && !entityServer); -} - float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15; diff --git a/interface/src/octree/SafeLanding.h b/interface/src/octree/SafeLanding.h index 157fda53aa..51357b60ff 100644 --- a/interface/src/octree/SafeLanding.h +++ b/interface/src/octree/SafeLanding.h @@ -40,7 +40,6 @@ private: bool isSequenceNumbersComplete(); void debugDumpSequenceIDs() const; bool isEntityLoadingComplete(); - bool isEntityServerNotRunning(); std::mutex _lock; using Locker = std::lock_guard; From 34224c4f16382ae0a3faf311fca388302bc7067d Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 15 Nov 2018 14:08:21 -0800 Subject: [PATCH 72/82] Fix XBox One controller detection. --- libraries/plugins/src/plugins/PluginUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/plugins/src/plugins/PluginUtils.cpp b/libraries/plugins/src/plugins/PluginUtils.cpp index ce67f7c585..f6419ccba0 100644 --- a/libraries/plugins/src/plugins/PluginUtils.cpp +++ b/libraries/plugins/src/plugins/PluginUtils.cpp @@ -65,6 +65,6 @@ bool PluginUtils::isOculusTouchControllerAvailable() { }; bool PluginUtils::isXboxControllerAvailable() { - return isSubdeviceContainingNameAvailable("X360 Controller"); + return isSubdeviceContainingNameAvailable("X360 Controller") || isSubdeviceContainingNameAvailable("XInput Controller"); }; From 60832b071cb8088ec432131b464807e9d3c56b33 Mon Sep 17 00:00:00 2001 From: r3tk0n Date: Thu, 15 Nov 2018 14:08:38 -0800 Subject: [PATCH 73/82] Fix logic for cases with rift headset but no touch controllers. --- interface/src/Application.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index aec580ff9d..a4277d6132 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3414,10 +3414,18 @@ void Application::showHelp() { defaultTab = TAB_HAND_CONTROLLERS; handControllerName = HAND_CONTROLLER_NAME_VIVE; } else if (PluginUtils::isHMDAvailable(OCULUS_RIFT_PLUGIN_NAME)) { - defaultTab = TAB_HAND_CONTROLLERS; - handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; + if (PluginUtils::isOculusTouchControllerAvailable()) { + defaultTab = TAB_HAND_CONTROLLERS; + handControllerName = HAND_CONTROLLER_NAME_OCULUS_TOUCH; + } else if (PluginUtils::isXboxControllerAvailable()) { + defaultTab = TAB_GAMEPAD; + } else { + defaultTab = TAB_KEYBOARD_MOUSE; + } } else if (PluginUtils::isXboxControllerAvailable()) { defaultTab = TAB_GAMEPAD; + } else { + defaultTab = TAB_KEYBOARD_MOUSE; } QUrlQuery queryString; From de7f4a4a4d8d4578d38416d2308a91d80a545a25 Mon Sep 17 00:00:00 2001 From: David Back Date: Thu, 15 Nov 2018 15:23:18 -0800 Subject: [PATCH 74/82] fix entity list resizing --- scripts/system/html/js/entityList.js | 2 +- scripts/system/html/js/listView.js | 20 +++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index 00c50169a6..39673b8f16 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -1219,7 +1219,7 @@ function loaded() { refreshSortOrder(); refreshEntities(); - window.onresize = updateColumnWidths; + window.addEventListener("resize", updateColumnWidths); }); augmentSpinButtons(); diff --git a/scripts/system/html/js/listView.js b/scripts/system/html/js/listView.js index 07aba53f1c..f775a4cb24 100644 --- a/scripts/system/html/js/listView.js +++ b/scripts/system/html/js/listView.js @@ -72,11 +72,6 @@ ListView.prototype = { } }, - onScroll: function() { - var that = this.listView; - that.scroll(); - }, - scroll: function() { let scrollTop = this.elTableScroll.scrollTop; let scrollHeight = this.getScrollHeight(); @@ -244,18 +239,13 @@ ListView.prototype = { } }, - onResize: function() { - var that = this.listView; - that.resize(); - }, - resize: function() { if (!this.elTableBody || !this.elTableScroll) { debugPrint("ListView.resize - no valid table body or table scroll element"); return; } - let prevScrollTop = this.elTableScroll.scrollTop; + let prevScrollTop = this.elTableScroll.scrollTop; // take up available window space this.elTableScroll.style.height = window.innerHeight - WINDOW_NONVARIABLE_HEIGHT; @@ -305,10 +295,10 @@ ListView.prototype = { this.elTableBody.appendChild(this.elBottomBuffer); this.elBottomBuffer.setAttribute("height", 0); - this.elTableScroll.listView = this; - this.elTableScroll.onscroll = this.onScroll; - window.listView = this; - window.onresize = this.onResize; + this.onScroll = this.scroll.bind(this); + this.elTableScroll.addEventListener("scroll", this.onScroll); + this.onResize = this.resize.bind(this); + window.addEventListener("resize", this.onResize); // initialize all row elements this.resize(); From bb0f046a728bd30d4f157adb80bf791c5483d93e Mon Sep 17 00:00:00 2001 From: birarda Date: Thu, 15 Nov 2018 17:28:34 -0800 Subject: [PATCH 75/82] add throttle start and backoff to DS settings --- assignment-client/src/audio/AudioMixer.cpp | 15 ++++++++++----- assignment-client/src/audio/AudioMixer.h | 4 +++- domain-server/resources/describe-settings.json | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index d6f893c42e..5d203595c2 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -488,11 +488,8 @@ void AudioMixer::throttle(chrono::microseconds duration, int frame) { // target different mix and backoff ratios (they also have different backoff rates) // this is to prevent oscillation, and encourage throttling to find a steady state - const float TARGET = 0.9f; - // on a "regular" machine with 100 avatars, this is the largest value where - // - overthrottling can be recovered - // - oscillations will not occur after the recovery - const float BACKOFF_TARGET = 0.44f; + const float TARGET = _throttleStartTarget; + const float BACKOFF_TARGET = _throttleBackoffTarget; // the mixer is known to struggle at about 80 on a "regular" machine // so throttle 2/80 the streams to ensure smooth audio (throttling is linear) @@ -551,6 +548,14 @@ void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) { _slavePool.setNumThreads(numThreads); } } + + const QString THROTTLE_START_KEY = "throttle_start"; + const QString THROTTLE_BACKOFF_KEY = "throttle_backoff"; + + _throttleStartTarget = audioThreadingGroupObject[THROTTLE_START_KEY].toDouble(_throttleStartTarget); + _throttleBackoffTarget = audioThreadingGroupObject[THROTTLE_BACKOFF_KEY].toDouble(_throttleBackoffTarget); + + qCDebug(audio) << "Throttle Start:" << _throttleStartTarget << "Throttle Backoff:" << _throttleBackoffTarget; } if (settingsObject.contains(AUDIO_BUFFER_GROUP_KEY)) { diff --git a/assignment-client/src/audio/AudioMixer.h b/assignment-client/src/audio/AudioMixer.h index b8ea0d5c58..c7726d2fea 100644 --- a/assignment-client/src/audio/AudioMixer.h +++ b/assignment-client/src/audio/AudioMixer.h @@ -144,11 +144,13 @@ private: static std::map _availableCodecs; static QStringList _codecPreferenceOrder; - static std::vector _audioZones; static std::vector _zoneSettings; static std::vector _zoneReverbSettings; + float _throttleStartTarget = 0.9f; + float _throttleBackoffTarget = 0.44f; + AudioMixerSlave::SharedData _workerSharedData; }; diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 5d1f725ab4..49023c9af8 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -1012,6 +1012,24 @@ "placeholder": "1", "default": "1", "advanced": true + }, + { + "name": "throttle_start", + "type": "double", + "label": "Throttle Start Target", + "help": "Target percentage of frame time to start throttling", + "placeholder": "0.9", + "default": 0.9, + "advanced": true + }, + { + "name": "throttle_backoff", + "type": "double", + "label": "Throttle Backoff Target", + "help": "Target percentage of frame time to backoff throttling", + "placeholder": "0.44", + "default": 0.44, + "advanced": true } ] }, From 7fba4c467322a937762db20e905ce62fba315a8f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 15 Nov 2018 17:41:01 -0800 Subject: [PATCH 76/82] Deleted unneeded file. --- .../AppDataHighFidelity/Interface/AccountInfo.bin | Bin 489 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tools/nitpick/AppDataHighFidelity/Interface/AccountInfo.bin diff --git a/tools/nitpick/AppDataHighFidelity/Interface/AccountInfo.bin b/tools/nitpick/AppDataHighFidelity/Interface/AccountInfo.bin deleted file mode 100644 index 65c971ea793926e8f7518d36c6079a59b4cc08e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 489 zcmZwDIZgvX6a>(RL`XzHz#(8ZGh;F&5@N{FEZx`=U}O(SWQ3fJvv3Dcw;T{q(O;|T ze;nZ2%53&x=hC@zPl8$RO|Z2SoLO0WuoA6Jf=6q!cV|W$PaH}(x$fuwHf-O*_G%nA zug~+%bKIoPhf&apCcROkQCf8hNg_vhkUa5_0l~HGDQko1ZiyTL-sL>kK znJMirv{|oHyD*6y#LuteZyXr}y=^`)c}q-5WyrjPP9q9hg-($@q>Wmg)jJm&efAoZ zd-b5o4i}jz`AWUYq}a!$LZQw-XjJ){#)wl_Ud=Y{-3fN)?CxIqvq%2$AEff1^k1Zz EU+;ia(EtDd From 6440c13bfe9a6ad70549d53246dff5a0a92c9d40 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 15 Nov 2018 18:50:56 -0800 Subject: [PATCH 77/82] Updated manual. --- tools/nitpick/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nitpick/README.md b/tools/nitpick/README.md index d21614f5f5..e8129ae29e 100644 --- a/tools/nitpick/README.md +++ b/tools/nitpick/README.md @@ -14,7 +14,7 @@ Nitpick has 5 functions, separated into 4 tabs: ## Installation ### Executable -1. On Windows: download the installer by browsing to [here](). +1. On Windows: download the installer by browsing to [here](). 2. Double click on the installer and install to a convenient location ![](./setup_7z.PNG) 3. To run nitpick, double click **nitpick.exe**. From 6daac008ff660ce8a6db9651d6257441802b7812 Mon Sep 17 00:00:00 2001 From: birarda Date: Fri, 16 Nov 2018 11:50:13 -0800 Subject: [PATCH 78/82] sanitize throttle start and backoff values from DS settings --- assignment-client/src/audio/AudioMixer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 5d203595c2..e8568a7ff3 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -552,8 +552,18 @@ void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) { const QString THROTTLE_START_KEY = "throttle_start"; const QString THROTTLE_BACKOFF_KEY = "throttle_backoff"; - _throttleStartTarget = audioThreadingGroupObject[THROTTLE_START_KEY].toDouble(_throttleStartTarget); - _throttleBackoffTarget = audioThreadingGroupObject[THROTTLE_BACKOFF_KEY].toDouble(_throttleBackoffTarget); + float settingsThrottleStart = audioThreadingGroupObject[THROTTLE_START_KEY].toDouble(_throttleStartTarget); + float settingsThrottleBackoff = audioThreadingGroupObject[THROTTLE_BACKOFF_KEY].toDouble(_throttleBackoffTarget); + + if (settingsThrottleBackoff > settingsThrottleStart) { + qCWarning(audio) << "Throttle backoff target cannot be higher than throttle start target. Using default values."; + } else if (settingsThrottleBackoff < 0.0f || settingsThrottleStart > 1.0f) { + qCWarning(audio) << "Throttle start and backoff targets must be greater than or equal to 0.0" + << "and lesser than or equal to 1.0. Using default values."; + } else { + _throttleStartTarget = settingsThrottleStart; + _throttleBackoffTarget = settingsThrottleBackoff; + } qCDebug(audio) << "Throttle Start:" << _throttleStartTarget << "Throttle Backoff:" << _throttleBackoffTarget; } From 31d37e7e75569d1c5c33ef97085539ea1b4afa0a Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Thu, 15 Nov 2018 02:38:39 +0100 Subject: [PATCH 79/82] Fix entity list double click rename / highlight issue --- scripts/system/html/js/entityList.js | 32 +++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index 39673b8f16..ac2a4132ae 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -153,6 +153,9 @@ const ICON_FOR_TYPE = { Text: "l", }; +const DOUBLE_CLICK_TIMEOUT = 300; // ms +const RENAME_COOLDOWN = 400; // ms + // List of all entities let entities = []; // List of all entities, indexed by Entity ID @@ -181,6 +184,9 @@ let currentResizeEl = null; let startResizeEvent = null; let resizeColumnIndex = 0; let startThClick = null; +let renameTimeout = null; +let renameLastBlur = null; +let renameLastEntityID = null; let elEntityTable, elEntityTableHeader, @@ -394,6 +400,7 @@ function loaded() { entityListContextMenu = new EntityListContextMenu(); function startRenamingEntity(entityID) { + renameLastEntityID = entityID; let entity = entitiesByID[entityID]; if (!entity || entity.locked || !entity.elRow) { return; @@ -423,6 +430,8 @@ function loaded() { })); entity.name = value; elCell.innerText = value; + + renameLastBlur = Date.now(); }; elCell.innerHTML = ""; @@ -478,6 +487,13 @@ function loaded() { entityListContextMenu.open(clickEvent, entityID, enabledContextMenuItems); } + let clearRenameTimeout = () => { + if (renameTimeout !== null) { + window.clearTimeout(renameTimeout); + renameTimeout = null; + } + }; + function onRowClicked(clickEvent) { let entityID = this.dataset.entityID; let selection = [entityID]; @@ -516,7 +532,15 @@ function loaded() { } else if (!clickEvent.ctrlKey && !clickEvent.shiftKey && selectedEntities.length === 1) { // if reselecting the same entity then start renaming it if (selectedEntities[0] === entityID) { - startRenamingEntity(entityID); + if (renameLastBlur && renameLastEntityID === entityID && (Date.now() - renameLastBlur) < RENAME_COOLDOWN) { + + return; + } + clearRenameTimeout(); + renameTimeout = window.setTimeout(() => { + renameTimeout = null; + startRenamingEntity(entityID); + }, DOUBLE_CLICK_TIMEOUT); } } @@ -530,6 +554,8 @@ function loaded() { } function onRowDoubleClicked() { + clearRenameTimeout(); + let selection = [this.dataset.entityID]; updateSelectedEntities(selection, false); @@ -1100,12 +1126,12 @@ function loaded() { startResizeEvent = ev; } } - } + }; document.onmouseup = function(ev) { startResizeEvent = null; ev.stopPropagation(); - } + }; function setSpaceMode(spaceMode) { if (spaceMode === "local") { From e89346c146386a17cc08143fcd113a569152690d Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Fri, 16 Nov 2018 20:02:16 +0100 Subject: [PATCH 80/82] making rename functionality list refresh proof --- scripts/system/html/js/entityList.js | 45 +++++++++++++++++++++++--- scripts/system/html/js/listView.js | 8 +++-- scripts/system/libraries/entityList.js | 2 +- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index ac2a4132ae..328c8c76e1 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -187,6 +187,7 @@ let startThClick = null; let renameTimeout = null; let renameLastBlur = null; let renameLastEntityID = null; +let isRenameFieldIsBeingMoved = false; let elEntityTable, elEntityTableHeader, @@ -210,7 +211,8 @@ let elEntityTable, elNoEntitiesMessage, elColumnsMultiselectBox, elColumnsOptions, - elToggleSpaceMode; + elToggleSpaceMode, + elRenameInput; const ENABLE_PROFILING = false; let profileIndent = ''; @@ -395,7 +397,7 @@ function loaded() { elEntityTableHeaderRow = document.querySelectorAll("#entity-table thead th"); entityList = new ListView(elEntityTableBody, elEntityTableScroll, elEntityTableHeaderRow, - createRow, updateRow, clearRow, WINDOW_NONVARIABLE_HEIGHT); + createRow, updateRow, clearRow, beforeUpdate, afterUpdate, WINDOW_NONVARIABLE_HEIGHT); entityListContextMenu = new EntityListContextMenu(); @@ -407,7 +409,7 @@ function loaded() { } let elCell = entity.elRow.childNodes[getColumnIndex("name")]; - let elRenameInput = document.createElement("input"); + elRenameInput = document.createElement("input"); elRenameInput.setAttribute('class', 'rename-entity'); elRenameInput.value = entity.name; let ignoreClicks = function(event) { @@ -422,6 +424,9 @@ function loaded() { }; elRenameInput.onblur = function(event) { + if (isRenameFieldIsBeingMoved) { + return; + } let value = elRenameInput.value; EventBridge.emitWebEvent(JSON.stringify({ type: 'rename', @@ -429,9 +434,10 @@ function loaded() { name: value })); entity.name = value; - elCell.innerText = value; + elRenameInput.parentElement.innerText = value; renameLastBlur = Date.now(); + elRenameInput = null; }; elCell.innerHTML = ""; @@ -440,6 +446,32 @@ function loaded() { elRenameInput.select(); } + function beforeUpdate() { + // move the rename input to the body + if (elRenameInput) { + isRenameFieldIsBeingMoved = true; + document.body.appendChild(elRenameInput); + // keep the focus + elRenameInput.select(); + } + } + + function afterUpdate() { + if (!elRenameInput || !isRenameFieldIsBeingMoved) { + return; + } + let entity = entitiesByID[renameLastEntityID]; + if (!entity || entity.locked || !entity.elRow) { + return; + } + let elCell = entity.elRow.childNodes[getColumnIndex("name")]; + elCell.innerHTML = ""; + elCell.appendChild(elRenameInput); + // keep the focus + elRenameInput.select(); + isRenameFieldIsBeingMoved = false; + } + entityListContextMenu.setOnSelectedCallback(function(optionName, selectedEntityID) { switch (optionName) { case "Cut": @@ -464,6 +496,11 @@ function loaded() { }); function onRowContextMenu(clickEvent) { + if (elRenameInput) { + // disallow the context menu from popping up while renaming + return; + } + let entityID = this.dataset.entityID; if (!selectedEntities.includes(entityID)) { diff --git a/scripts/system/html/js/listView.js b/scripts/system/html/js/listView.js index f775a4cb24..4336698688 100644 --- a/scripts/system/html/js/listView.js +++ b/scripts/system/html/js/listView.js @@ -14,7 +14,7 @@ debugPrint = function (message) { }; function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunction, - updateRowFunction, clearRowFunction, WINDOW_NONVARIABLE_HEIGHT) { + updateRowFunction, clearRowFunction, beforeRefreshFunction, afterRefreshFunction, WINDOW_NONVARIABLE_HEIGHT) { this.elTableBody = elTableBody; this.elTableScroll = elTableScroll; this.elTableHeaderRow = elTableHeaderRow; @@ -25,6 +25,8 @@ function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunctio this.createRowFunction = createRowFunction; this.updateRowFunction = updateRowFunction; this.clearRowFunction = clearRowFunction; + this.beforeRefreshFunction = beforeRefreshFunction; + this.afterRefreshFunction = afterRefreshFunction; // the list of row elements created in the table up to max viewable height plus SCROLL_ROWS rows for scrolling buffer this.elRows = []; @@ -173,6 +175,7 @@ ListView.prototype = { }, refresh: function() { + this.beforeRefreshFunction(); // block refreshing before rows are initialized let numRows = this.getNumRows(); if (numRows === 0) { @@ -211,6 +214,7 @@ ListView.prototype = { this.lastRowShiftScrollTop = 0; } } + this.afterRefreshFunction(); }, refreshBuffers: function() { @@ -230,7 +234,7 @@ ListView.prototype = { refreshRowOffset: function() { // make sure the row offset isn't causing visible rows to pass the end of the item list and is clamped to 0 - var numRows = this.getNumRows(); + let numRows = this.getNumRows(); if (this.rowOffset + numRows > this.itemData.length) { this.rowOffset = this.itemData.length - numRows; } diff --git a/scripts/system/libraries/entityList.js b/scripts/system/libraries/entityList.js index 8942c84f33..eeb16fd60d 100644 --- a/scripts/system/libraries/entityList.js +++ b/scripts/system/libraries/entityList.js @@ -17,7 +17,7 @@ var profileIndent = ''; const PROFILE_NOOP = function(_name, fn, args) { fn.apply(this, args); }; -PROFILE = !PROFILING_ENABLED ? PROFILE_NOOP : function(name, fn, args) { +const PROFILE = !PROFILING_ENABLED ? PROFILE_NOOP : function(name, fn, args) { console.log("PROFILE-Script " + profileIndent + "(" + name + ") Begin"); var previousIndent = profileIndent; profileIndent += ' '; From 7b3d2bed15a61caf4a2fef24612e6ca32ba01efb Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Fri, 16 Nov 2018 20:49:25 +0100 Subject: [PATCH 81/82] CR fixes --- scripts/system/html/js/entityList.js | 16 ++++++++-------- scripts/system/html/js/listView.js | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index 328c8c76e1..fe657cd8b5 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -187,7 +187,7 @@ let startThClick = null; let renameTimeout = null; let renameLastBlur = null; let renameLastEntityID = null; -let isRenameFieldIsBeingMoved = false; +let isRenameFieldBeingMoved = false; let elEntityTable, elEntityTableHeader, @@ -397,7 +397,7 @@ function loaded() { elEntityTableHeaderRow = document.querySelectorAll("#entity-table thead th"); entityList = new ListView(elEntityTableBody, elEntityTableScroll, elEntityTableHeaderRow, - createRow, updateRow, clearRow, beforeUpdate, afterUpdate, WINDOW_NONVARIABLE_HEIGHT); + createRow, updateRow, clearRow, preRefresh, postRefresh, WINDOW_NONVARIABLE_HEIGHT); entityListContextMenu = new EntityListContextMenu(); @@ -424,7 +424,7 @@ function loaded() { }; elRenameInput.onblur = function(event) { - if (isRenameFieldIsBeingMoved) { + if (isRenameFieldBeingMoved) { return; } let value = elRenameInput.value; @@ -446,18 +446,18 @@ function loaded() { elRenameInput.select(); } - function beforeUpdate() { + function preRefresh() { // move the rename input to the body if (elRenameInput) { - isRenameFieldIsBeingMoved = true; + isRenameFieldBeingMoved = true; document.body.appendChild(elRenameInput); // keep the focus elRenameInput.select(); } } - function afterUpdate() { - if (!elRenameInput || !isRenameFieldIsBeingMoved) { + function postRefresh() { + if (!elRenameInput || !isRenameFieldBeingMoved) { return; } let entity = entitiesByID[renameLastEntityID]; @@ -469,7 +469,7 @@ function loaded() { elCell.appendChild(elRenameInput); // keep the focus elRenameInput.select(); - isRenameFieldIsBeingMoved = false; + isRenameFieldBeingMoved = false; } entityListContextMenu.setOnSelectedCallback(function(optionName, selectedEntityID) { diff --git a/scripts/system/html/js/listView.js b/scripts/system/html/js/listView.js index 4336698688..482576e2fe 100644 --- a/scripts/system/html/js/listView.js +++ b/scripts/system/html/js/listView.js @@ -14,7 +14,7 @@ debugPrint = function (message) { }; function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunction, - updateRowFunction, clearRowFunction, beforeRefreshFunction, afterRefreshFunction, WINDOW_NONVARIABLE_HEIGHT) { + updateRowFunction, clearRowFunction, preRefreshFunction, postRefreshFunction, WINDOW_NONVARIABLE_HEIGHT) { this.elTableBody = elTableBody; this.elTableScroll = elTableScroll; this.elTableHeaderRow = elTableHeaderRow; @@ -25,8 +25,8 @@ function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunctio this.createRowFunction = createRowFunction; this.updateRowFunction = updateRowFunction; this.clearRowFunction = clearRowFunction; - this.beforeRefreshFunction = beforeRefreshFunction; - this.afterRefreshFunction = afterRefreshFunction; + this.preRefreshFunction = preRefreshFunction; + this.postRefreshFunction = postRefreshFunction; // the list of row elements created in the table up to max viewable height plus SCROLL_ROWS rows for scrolling buffer this.elRows = []; @@ -175,7 +175,7 @@ ListView.prototype = { }, refresh: function() { - this.beforeRefreshFunction(); + this.preRefreshFunction(); // block refreshing before rows are initialized let numRows = this.getNumRows(); if (numRows === 0) { @@ -214,7 +214,7 @@ ListView.prototype = { this.lastRowShiftScrollTop = 0; } } - this.afterRefreshFunction(); + this.postRefreshFunction(); }, refreshBuffers: function() { From ba790ae47013470e9bce78a87e07c060e1a1c5b8 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Sat, 17 Nov 2018 01:20:36 +0100 Subject: [PATCH 82/82] fix behavior after merge. --- scripts/system/html/js/entityList.js | 6 +++--- scripts/system/html/js/listView.js | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/system/html/js/entityList.js b/scripts/system/html/js/entityList.js index fe657cd8b5..84ad59df36 100644 --- a/scripts/system/html/js/entityList.js +++ b/scripts/system/html/js/entityList.js @@ -396,8 +396,8 @@ function loaded() { elEntityTableHeaderRow = document.querySelectorAll("#entity-table thead th"); - entityList = new ListView(elEntityTableBody, elEntityTableScroll, elEntityTableHeaderRow, - createRow, updateRow, clearRow, preRefresh, postRefresh, WINDOW_NONVARIABLE_HEIGHT); + entityList = new ListView(elEntityTableBody, elEntityTableScroll, elEntityTableHeaderRow, createRow, updateRow, + clearRow, preRefresh, postRefresh, preRefresh, WINDOW_NONVARIABLE_HEIGHT); entityListContextMenu = new EntityListContextMenu(); @@ -448,7 +448,7 @@ function loaded() { function preRefresh() { // move the rename input to the body - if (elRenameInput) { + if (!isRenameFieldBeingMoved && elRenameInput) { isRenameFieldBeingMoved = true; document.body.appendChild(elRenameInput); // keep the focus diff --git a/scripts/system/html/js/listView.js b/scripts/system/html/js/listView.js index 482576e2fe..49a91388a5 100644 --- a/scripts/system/html/js/listView.js +++ b/scripts/system/html/js/listView.js @@ -13,8 +13,8 @@ debugPrint = function (message) { console.log(message); }; -function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunction, - updateRowFunction, clearRowFunction, preRefreshFunction, postRefreshFunction, WINDOW_NONVARIABLE_HEIGHT) { +function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunction, updateRowFunction, clearRowFunction, + preRefreshFunction, postRefreshFunction, preResizeFunction, WINDOW_NONVARIABLE_HEIGHT) { this.elTableBody = elTableBody; this.elTableScroll = elTableScroll; this.elTableHeaderRow = elTableHeaderRow; @@ -27,6 +27,7 @@ function ListView(elTableBody, elTableScroll, elTableHeaderRow, createRowFunctio this.clearRowFunction = clearRowFunction; this.preRefreshFunction = preRefreshFunction; this.postRefreshFunction = postRefreshFunction; + this.preResizeFunction = preResizeFunction; // the list of row elements created in the table up to max viewable height plus SCROLL_ROWS rows for scrolling buffer this.elRows = []; @@ -248,7 +249,7 @@ ListView.prototype = { debugPrint("ListView.resize - no valid table body or table scroll element"); return; } - + this.preResizeFunction(); let prevScrollTop = this.elTableScroll.scrollTop; // take up available window space