mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:17:34 +02:00
Can extract filename after selecting zipped results and temporary folder.
This commit is contained in:
parent
2cb0b2ea8d
commit
ed94ffa384
7 changed files with 47 additions and 7 deletions
|
@ -1027,3 +1027,19 @@ QString Test::getExpectedImagePartialSourceDirectory(const QString& filename) {
|
||||||
void Test::setTestRailCreateMode(TestRailCreateMode testRailCreateMode) {
|
void Test::setTestRailCreateMode(TestRailCreateMode testRailCreateMode) {
|
||||||
_testRailCreateMode = testRailCreateMode;
|
_testRailCreateMode = testRailCreateMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Test::createWebPage() {
|
||||||
|
QString testResults = QFileDialog::getOpenFileName(nullptr, "Please select the zipped test results to update from", nullptr,
|
||||||
|
"Zipped Test Results (*.zip)");
|
||||||
|
if (testResults.isNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString tempDirectory = QFileDialog::getExistingDirectory(nullptr, "Please select a folder to store temporary files in",
|
||||||
|
nullptr, QFileDialog::ShowDirsOnly);
|
||||||
|
if (tempDirectory.isNull()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_awsInterface.createWebPageFromResults(testResults, tempDirectory);
|
||||||
|
}
|
|
@ -16,6 +16,7 @@
|
||||||
#include <QtCore/QRegularExpression>
|
#include <QtCore/QRegularExpression>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
|
|
||||||
|
#include "AWSInterface.h"
|
||||||
#include "ImageComparer.h"
|
#include "ImageComparer.h"
|
||||||
#include "ui/MismatchWindow.h"
|
#include "ui/MismatchWindow.h"
|
||||||
#include "TestRailInterface.h"
|
#include "TestRailInterface.h"
|
||||||
|
@ -97,6 +98,8 @@ public:
|
||||||
|
|
||||||
void setTestRailCreateMode(TestRailCreateMode testRailCreateMode);
|
void setTestRailCreateMode(TestRailCreateMode testRailCreateMode);
|
||||||
|
|
||||||
|
void createWebPage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QProgressBar* _progressBar;
|
QProgressBar* _progressBar;
|
||||||
QCheckBox* _checkBoxInteractiveMode;
|
QCheckBox* _checkBoxInteractiveMode;
|
||||||
|
@ -151,8 +154,9 @@ private:
|
||||||
bool _exitWhenComplete{ false };
|
bool _exitWhenComplete{ false };
|
||||||
|
|
||||||
TestRailInterface _testRailInterface;
|
TestRailInterface _testRailInterface;
|
||||||
|
|
||||||
TestRailCreateMode _testRailCreateMode { PYTHON };
|
TestRailCreateMode _testRailCreateMode { PYTHON };
|
||||||
|
|
||||||
|
AWSInterface _awsInterface;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_test_h
|
#endif // hifi_test_h
|
|
@ -530,7 +530,7 @@ void TestRailInterface::updateRunWithResults() {
|
||||||
|
|
||||||
stream << "failed_tests = set()\n";
|
stream << "failed_tests = set()\n";
|
||||||
|
|
||||||
stream << "for entry in listdir('" + _outputDirectory + "/" + tempName + "'):\n";
|
stream << "for entry in listdir('" + _outputDirectory + "/" + TEMP_NAME + "'):\n";
|
||||||
stream << "\tparts = entry.split('--tests.')[1].split('.')\n";
|
stream << "\tparts = entry.split('--tests.')[1].split('.')\n";
|
||||||
stream << "\tfailed_test = parts[0]\n";
|
stream << "\tfailed_test = parts[0]\n";
|
||||||
stream << "\tfor i in range(1, len(parts) - 1):\n";
|
stream << "\tfor i in range(1, len(parts) - 1):\n";
|
||||||
|
@ -1157,11 +1157,20 @@ void TestRailInterface::updateTestRailRunResults(const QString& testResults, con
|
||||||
createTestRailDotPyScript();
|
createTestRailDotPyScript();
|
||||||
|
|
||||||
// Extract test failures from zipped folder
|
// Extract test failures from zipped folder
|
||||||
QString tempSubDirectory = tempDirectory + "/" + tempName;
|
QString tempSubDirectory = tempDirectory + "/" + TEMP_NAME;
|
||||||
QDir dir = tempSubDirectory;
|
QDir dir = tempSubDirectory;
|
||||||
dir.mkdir(tempSubDirectory);
|
dir.mkdir(tempSubDirectory);
|
||||||
JlCompress::extractDir(testResults, tempSubDirectory);
|
JlCompress::extractDir(testResults, tempSubDirectory);
|
||||||
|
|
||||||
// TestRail will be updated after the process initiated by getTestRunFromTestRail has completed
|
// TestRail will be updated after the process initiated by getTestRunFromTestRail has completed
|
||||||
getRunsFromTestRail();
|
getRunsFromTestRail();
|
||||||
|
|
||||||
|
dir.rmdir(tempSubDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TestRailInterface::extractTestFailuresFromZippedFolder(const QString& testResults, const QString& tempDirectory) {
|
||||||
|
QString tempSubDirectory = tempDirectory + "/" + TEMP_NAME;
|
||||||
|
QDir dir = tempSubDirectory;
|
||||||
|
dir.mkdir(tempSubDirectory);
|
||||||
|
JlCompress::extractDir(testResults, tempSubDirectory);
|
||||||
}
|
}
|
|
@ -89,6 +89,7 @@ public:
|
||||||
void updateRunWithResults();
|
void updateRunWithResults();
|
||||||
|
|
||||||
bool setPythonCommand();
|
bool setPythonCommand();
|
||||||
|
void extractTestFailuresFromZippedFolder(const QString& testResults, const QString& tempDirectory);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// HighFidelity Interface project ID in TestRail
|
// HighFidelity Interface project ID in TestRail
|
||||||
|
@ -111,6 +112,7 @@ private:
|
||||||
QString _suiteID;
|
QString _suiteID;
|
||||||
|
|
||||||
QString _testDirectory;
|
QString _testDirectory;
|
||||||
|
QString _testResults;
|
||||||
QString _outputDirectory;
|
QString _outputDirectory;
|
||||||
QString _userGitHub;
|
QString _userGitHub;
|
||||||
QString _branchGitHub;
|
QString _branchGitHub;
|
||||||
|
@ -126,7 +128,7 @@ private:
|
||||||
QStringList _runNames;
|
QStringList _runNames;
|
||||||
std::vector<int> _runIDs;
|
std::vector<int> _runIDs;
|
||||||
|
|
||||||
QString tempName{ "fgadhcUDHSFaidsfh3478JJJFSDFIUSOEIrf" };
|
QString TEMP_NAME{ "fgadhcUDHSFaidsfh3478JJJFSDFIUSOEIrf" };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -36,7 +36,7 @@ AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) {
|
||||||
_ui.statusLabel->setText("");
|
_ui.statusLabel->setText("");
|
||||||
_ui.plainTextEdit->setReadOnly(true);
|
_ui.plainTextEdit->setReadOnly(true);
|
||||||
|
|
||||||
setWindowTitle("Auto Tester - v5.1");
|
setWindowTitle("Auto Tester - v6.0");
|
||||||
|
|
||||||
// Coming soon to an auto-tester near you...
|
// Coming soon to an auto-tester near you...
|
||||||
//// _helpWindow.textBrowser->setText()
|
//// _helpWindow.textBrowser->setText()
|
||||||
|
@ -212,6 +212,10 @@ void AutoTester::on_createXMLScriptRadioButton_clicked() {
|
||||||
_test->setTestRailCreateMode(XML);
|
_test->setTestRailCreateMode(XML);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoTester::on_createWebPagePushButton_clicked() {
|
||||||
|
_test->createWebPage();
|
||||||
|
}
|
||||||
|
|
||||||
void AutoTester::downloadFile(const QUrl& url) {
|
void AutoTester::downloadFile(const QUrl& url) {
|
||||||
_downloaders.emplace_back(new Downloader(url, this));
|
_downloaders.emplace_back(new Downloader(url, this));
|
||||||
connect(_downloaders[_index], SIGNAL(downloaded()), _signalMapper, SLOT(map()));
|
connect(_downloaders[_index], SIGNAL(downloaded()), _signalMapper, SLOT(map()));
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "HelpWindow.h"
|
#include "HelpWindow.h"
|
||||||
#include "../TestRunner.h"
|
#include "../TestRunner.h"
|
||||||
|
#include "../AWSInterface.h"
|
||||||
|
|
||||||
class AutoTester : public QMainWindow {
|
class AutoTester : public QMainWindow {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -84,6 +85,8 @@ private slots:
|
||||||
void on_createPythonScriptRadioButton_clicked();
|
void on_createPythonScriptRadioButton_clicked();
|
||||||
void on_createXMLScriptRadioButton_clicked();
|
void on_createXMLScriptRadioButton_clicked();
|
||||||
|
|
||||||
|
void on_createWebPagePushButton_clicked();
|
||||||
|
|
||||||
void on_closeButton_clicked();
|
void on_closeButton_clicked();
|
||||||
|
|
||||||
void saveFile(int index);
|
void saveFile(int index);
|
||||||
|
@ -96,6 +99,8 @@ private:
|
||||||
Test* _test{ nullptr };
|
Test* _test{ nullptr };
|
||||||
TestRunner* _testRunner{ nullptr };
|
TestRunner* _testRunner{ nullptr };
|
||||||
|
|
||||||
|
AWSInterface _awsInterface;
|
||||||
|
|
||||||
std::vector<Downloader*> _downloaders;
|
std::vector<Downloader*> _downloaders;
|
||||||
|
|
||||||
// local storage for parameters - folder to store downloaded files in, and a list of their names
|
// local storage for parameters - folder to store downloaded files in, and a list of their names
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>3</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_1">
|
<widget class="QWidget" name="tab_1">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
@ -680,7 +680,7 @@
|
||||||
</property>
|
</property>
|
||||||
<widget class="QPushButton" name="createWebPagePushButton">
|
<widget class="QPushButton" name="createWebPagePushButton">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
|
|
Loading…
Reference in a new issue