Skip to content

Commit

Permalink
Bugfix: uninstall app before XCTest to clear data (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou9584 authored Jul 13, 2023
1 parent dd34de9 commit 0a4cd05
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.microsoft.hydralab.common.util.Const;
import com.microsoft.hydralab.common.util.FileUtil;
import com.microsoft.hydralab.common.util.ShellUtils;
import com.microsoft.hydralab.common.util.ThreadUtils;
import com.microsoft.hydralab.performance.PerformanceTestManagementService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -69,6 +70,13 @@ private void initializeTest(TestRunDevice testRunDevice, TestTask testTask, Test

@Override
protected void reInstallApp(TestRunDevice testRunDevice, TestTask testTask, Logger logger) {
checkTestTaskCancel(testTask);
if (testTask.getNeedUninstall()) {
testRunDeviceOrchestrator.uninstallApp(testRunDevice, testTask.getPkgName(), logger);
ThreadUtils.safeSleep(3000);
} else if (testTask.getNeedClearData()) {
testRunDeviceOrchestrator.resetPackage(testRunDevice, testTask.getPkgName(), logger);
}
}

private void unzipXctestFolder(File zipFile, TestRun testRun, Logger logger) {
Expand Down

0 comments on commit 0a4cd05

Please sign in to comment.