fix: playbook 支持 python 脚本

This commit is contained in:
zhangshuai
2024-11-26 10:08:24 +08:00
parent 35eebd7beb
commit 83b17b5f5e
5 changed files with 135 additions and 32 deletions

View File

@@ -22,18 +22,20 @@ public class PlaybookRunnable implements Runnable {
private String tid;
private File apkFile;
private String packageName;
private File playbookDir;
private File scriptPath;
private String type;
private boolean reInstall;
private boolean clearCache;
private boolean unInstall;
private boolean interrupt;
public PlaybookRunnable(EnvApiYml envApiYml, File apkFile, File playbookDir, String tid, String packageName, Boolean reInstall, Boolean clearCache, Boolean unInstall) {
public PlaybookRunnable(EnvApiYml envApiYml, File apkFile, File scriptPath, String tid, String packageName, String type, Boolean reInstall, Boolean clearCache, Boolean unInstall) {
this.envApiYml = envApiYml;
this.tid = tid;
this.apkFile = apkFile;
this.packageName = packageName;
this.playbookDir = playbookDir;
this.scriptPath = scriptPath;
this.type = type;
this.reInstall = reInstall;
this.clearCache = clearCache;
this.unInstall = unInstall;
@@ -118,7 +120,7 @@ public class PlaybookRunnable implements Runnable {
// exec playbook
if (interrupt) return;
AdbUtil.CommandResult airtestResult = adbUtil.execPlaybook(playbookDir.getPath(), tid, packageName, logFile);
AdbUtil.CommandResult airtestResult = adbUtil.execPlaybook(scriptPath.getPath(), tid, packageName, type, logFile);
if (0 != airtestResult.exitCode()) {
T.FileUtil.appendString(String.format("ERROR: Exec playbook failed: exit code %s \n", airtestResult.exitCode()), logFile, "UTF-8");
throw new APIException("playbook exec error");