From 06ad3903c48adbef54889797e7d713885222b493 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 4 Sep 2018 10:05:17 -0700 Subject: [PATCH] Kills High Fidelity processes (which is a good thing in this context). --- tools/auto-tester/src/TestRunner.cpp | 15 ++++++++++++++- tools/auto-tester/src/TestRunner.h | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/auto-tester/src/TestRunner.cpp b/tools/auto-tester/src/TestRunner.cpp index bd427dd66b..6754e6ff46 100644 --- a/tools/auto-tester/src/TestRunner.cpp +++ b/tools/auto-tester/src/TestRunner.cpp @@ -36,6 +36,7 @@ void TestRunner::run() { void TestRunner::installerDownloadComplete() { runInstaller(); createSnapshotFolder(); + killProcesses(); restoreHighFidelityAppDataFolder(); } @@ -46,8 +47,8 @@ void TestRunner::runInstaller() { QStringList arguments{ QStringList() << QString("/S") << QString("/D=") + QDir::toNativeSeparators(_tempFolder) }; QString installerFullPath = _tempFolder + "/" + INSTALLER_FILENAME; + QString commandLine = QDir::toNativeSeparators(installerFullPath + " /S /D=" + _tempFolder); - system(commandLine.toStdString().c_str()); } @@ -98,4 +99,16 @@ void TestRunner::selectTemporaryFolder() { void TestRunner::createSnapshotFolder() { QDir().mkdir(_tempFolder + "/" + SNAPSHOT_FOLDER_NAME); +} +void TestRunner::killProcesses() { + killProcessByName("assignment-client.exe"); + killProcessByName("domain-server.exe"); + killProcessByName("server-console.exe"); +} + +void TestRunner::killProcessByName(QString processName) { +#ifdef Q_OS_WIN + QString commandLine = "taskkill /im " + processName + " /f >nul"; + system(commandLine.toStdString().c_str()); +#endif } \ No newline at end of file diff --git a/tools/auto-tester/src/TestRunner.h b/tools/auto-tester/src/TestRunner.h index 69445e0ba4..6e0566f7d5 100644 --- a/tools/auto-tester/src/TestRunner.h +++ b/tools/auto-tester/src/TestRunner.h @@ -30,6 +30,8 @@ public: void restoreHighFidelityAppDataFolder(); void selectTemporaryFolder(); void createSnapshotFolder(); + void killProcesses(); + void killProcessByName(QString processName); private: QDir _appDataFolder;