Merge branch 'addDailyTests' of https://github.com/NissimHadar/hifi into addDailyTests

This commit is contained in:
NissimHadar 2018-10-02 07:07:16 -07:00
commit 719a2140fe
9 changed files with 61 additions and 37 deletions

View file

@ -569,9 +569,6 @@ bool Test::createMDFile(const QString& directory) {
QString testName = testScriptLines.title;
stream << "# " << testName << "\n";
// Find the relevant part of the path to the test (i.e. from "tests" down)
QString partialPath = extractPathFromTestsDown(_testsRootDirectory);
stream << "## Run this script URL: [Manual](./test.js?raw=true) [Auto](./testAuto.js?raw=true)(from menu/Edit/Open and Run scripts from URL...)." << "\n\n";
stream << "## Preconditions" << "\n";

View file

@ -16,6 +16,7 @@
#include <QDateTime>
#include <QFile>
#include <QHostInfo>
#include <QMessageBox>
#include <QTextStream>
@ -46,7 +47,6 @@ QString TestRailInterface::getObject(const QString& path) {
return path.right(path.length() - path.lastIndexOf("/") - 1);
}
bool TestRailInterface::setPythonCommand() {
if (QProcessEnvironment::systemEnvironment().contains("PYTHON_PATH")) {
QString _pythonPath = QProcessEnvironment::systemEnvironment().value("PYTHON_PATH");
@ -478,8 +478,8 @@ void TestRailInterface::addRun() {
stream << "\tcase_ids.append(case['id'])\n\n";
// Now, we can create the run
stream << "data = { 'name': '" + _sectionNames[_testRailRunSelectorWindow.getSectionID()].replace("Section", "Run") +
"', 'suite_id': " + _suiteID +
stream << "data = { 'name': '" + _sectionNames[_testRailRunSelectorWindow.getSectionID()].replace("Section", "Run") + "[" +
QHostInfo::localHostName() + "]" + "', 'suite_id': " + _suiteID +
", 'include_all': False, 'case_ids': case_ids}\n";
stream << "run = client.send_post('add_run/" + _projectID + "', data)\n";
@ -1028,7 +1028,6 @@ void TestRailInterface::processTestPython(const QString& fullDirectory,
QString testContent = QString("Execute instructions in [THIS TEST](") + testMDName + ")";
QString testExpected = QString("Refer to the expected result in the linked description.");
stream << "data = {\n"
<< "\t'title': '" << title << "',\n"
<< "\t'template_id': 2,\n"

View file

@ -148,13 +148,15 @@ void TestRunner::runInstaller() {
QString installerFullPath = _workingFolder + "/" + _installerFilename;
QString commandLine =
QDir::toNativeSeparators(installerFullPath) + " /S /D=" + QDir::toNativeSeparators(_installationFolder);
"\"" + QDir::toNativeSeparators(installerFullPath) + "\"" + " /S /D=" + QDir::toNativeSeparators(_installationFolder);
installerWorker->setCommandLine(commandLine);
emit startInstaller();
}
void TestRunner::installationComplete() {
verifyInstallationSucceeded();
createSnapshotFolder();
updateStatusLabel("Running tests");
@ -166,6 +168,21 @@ void TestRunner::installationComplete() {
runInterfaceWithTestScript();
}
void TestRunner::verifyInstallationSucceeded() {
// Exit if the executables are missing.
// On Windows, the reason is probably that UAC has blocked the installation. This is treated as a critical error
#ifdef Q_OS_WIN
QFileInfo interfaceExe(QDir::toNativeSeparators(_installationFolder) + "\\interface.exe");
QFileInfo assignmentClientExe(QDir::toNativeSeparators(_installationFolder) + "\\assignment-client.exe");
QFileInfo domainServerExe(QDir::toNativeSeparators(_installationFolder) + "\\domain-server.exe");
if (!interfaceExe.exists() || !assignmentClientExe.exists() || !domainServerExe.exists()) {
QMessageBox::critical(0, "Installation of High Fidelity has failed", "Please verify that UAC has been disabled");
exit(-1);
}
#endif
}
void TestRunner::saveExistingHighFidelityAppDataFolder() {
QString dataDirectory{ "NOT FOUND" };
@ -283,7 +300,9 @@ void TestRunner::runInterfaceWithTestScript() {
QString url = QString("hifi://localhost");
if (_runServerless->isChecked()) {
// Move to an empty area
url = url + "/9999,9999,9999/0.0,0.0,0.0,1.0";
url = "file:///~serverless/tutorial.json";
} else {
url = "hifi://localhost";
}
QString testScript =

View file

@ -42,6 +42,7 @@ public:
void installerDownloadComplete();
void runInstaller();
void verifyInstallationSucceeded();
void saveExistingHighFidelityAppDataFolder();
void restoreHighFidelityAppDataFolder();

View file

@ -36,6 +36,8 @@ AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) {
_ui.statusLabel->setText("");
_ui.plainTextEdit->setReadOnly(true);
setWindowTitle("Auto Tester - v4.6");
// Coming soon to an auto-tester near you...
//// _helpWindow.textBrowser->setText()
}
@ -96,11 +98,11 @@ void AutoTester::startTestsEvaluation(const bool isRunningFromCommandLine,
void AutoTester::on_tabWidget_currentChanged(int index) {
if (index == 2 || index == 3) {
_ui.userTextEdit->setDisabled(false);
_ui.branchTextEdit->setDisabled(false);
_ui.userLineEdit->setDisabled(false);
_ui.branchLineEdit->setDisabled(false);
} else {
_ui.userTextEdit->setDisabled(true);
_ui.branchTextEdit->setDisabled(true);
_ui.userLineEdit->setDisabled(true);
_ui.branchLineEdit->setDisabled(true);
}
}
@ -280,19 +282,19 @@ void AutoTester::content() {
}
void AutoTester::setUserText(const QString& user) {
_ui.userTextEdit->setText(user);
_ui.userLineEdit->setText(user);
}
QString AutoTester::getSelectedUser() {
return _ui.userTextEdit->toPlainText();
return _ui.userLineEdit->text();
}
void AutoTester::setBranchText(const QString& branch) {
_ui.branchTextEdit->setText(branch);
_ui.branchLineEdit->setText(branch);
}
QString AutoTester::getSelectedBranch() {
return _ui.branchTextEdit->toPlainText();
return _ui.branchLineEdit->text();
}
void AutoTester::updateStatusLabel(const QString& status) {

View file

@ -673,26 +673,6 @@
<string>GitHub Branch</string>
</property>
</widget>
<widget class="QTextEdit" name="branchTextEdit">
<property name="geometry">
<rect>
<x>250</x>
<y>75</y>
<width>140</width>
<height>24</height>
</rect>
</property>
</widget>
<widget class="QTextEdit" name="userTextEdit">
<property name="geometry">
<rect>
<x>250</x>
<y>37</y>
<width>140</width>
<height>24</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
@ -724,6 +704,26 @@
<number>24</number>
</property>
</widget>
<widget class="QLineEdit" name="userLineEdit">
<property name="geometry">
<rect>
<x>220</x>
<y>40</y>
<width>161</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="branchLineEdit">
<property name="geometry">
<rect>
<x>220</x>
<y>80</y>
<width>161</width>
<height>21</height>
</rect>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">

View file

@ -25,6 +25,7 @@ void TestRailResultsSelectorWindow::reset() {
userLineEdit->setDisabled(false);
passwordLineEdit->setDisabled(false);
projectIDLineEdit->setDisabled(false);
suiteIDLineEdit->setDisabled(false);
OKButton->setDisabled(true);
@ -37,6 +38,7 @@ void TestRailResultsSelectorWindow::on_acceptButton_clicked() {
userLineEdit->setDisabled(true);
passwordLineEdit->setDisabled(true);
projectIDLineEdit->setDisabled(true);
suiteIDLineEdit->setDisabled(true);
OKButton->setDisabled(false);

View file

@ -24,6 +24,7 @@ void TestRailRunSelectorWindow::reset() {
userLineEdit->setDisabled(false);
passwordLineEdit->setDisabled(false);
projectIDLineEdit->setDisabled(false);
suiteIDLineEdit->setDisabled(false);
OKButton->setDisabled(true);
sectionsComboBox->setDisabled(true);
@ -34,6 +35,7 @@ void TestRailRunSelectorWindow::on_acceptButton_clicked() {
userLineEdit->setDisabled(true);
passwordLineEdit->setDisabled(true);
projectIDLineEdit->setDisabled(true);
suiteIDLineEdit->setDisabled(true);
OKButton->setDisabled(false);
sectionsComboBox->setDisabled(false);

View file

@ -25,6 +25,7 @@ void TestRailTestCasesSelectorWindow::reset() {
userLineEdit->setDisabled(false);
passwordLineEdit->setDisabled(false);
projectIDLineEdit->setDisabled(false);
suiteIDLineEdit->setDisabled(false);
OKButton->setDisabled(true);
@ -37,6 +38,7 @@ void TestRailTestCasesSelectorWindow::on_acceptButton_clicked() {
userLineEdit->setDisabled(true);
passwordLineEdit->setDisabled(true);
projectIDLineEdit->setDisabled(true);
suiteIDLineEdit->setDisabled(true);
OKButton->setDisabled(false);