自定义编译修改 ,测试用例生成修改
This commit is contained in:
parent
31c50b7daf
commit
3237c23db0
@ -41,20 +41,7 @@ public class CustomCompilerWorker extends SshWorker {
|
||||
log.info(taskDef.getTaskName());
|
||||
Map<String, Object> taskProperties = taskDef.getTaskProperties();
|
||||
Object commandScriptObj = taskProperties.get(DIYImageExecuteCommandConstant.COMMAND_SCRIPT);
|
||||
Object machineIdObj = taskProperties.get(DIYImageExecuteCommandConstant.MACHINE_ID);
|
||||
String commandScript = commandScriptObj instanceof String ? ((String) commandScriptObj) : null;
|
||||
Long machineId = null;
|
||||
try {
|
||||
machineId=Long.valueOf(String.valueOf(machineIdObj));
|
||||
} catch (NumberFormatException e) {
|
||||
log.error("缺少参数:{}",DIYImageExecuteCommandConstant.MACHINE_ID);
|
||||
toBadEnding();
|
||||
}
|
||||
if (StringUtils.isEmpty(commandScript) ||machineIdObj == null) {
|
||||
// 缺少参数
|
||||
toBadEnding();
|
||||
}
|
||||
|
||||
try {
|
||||
//将节点的配置信息反编译成对象
|
||||
log.info("构建脚本" + commandScript);
|
||||
@ -62,14 +49,11 @@ public class CustomCompilerWorker extends SshWorker {
|
||||
//如果machineId为0,则说明该节点没有配置机器,则使用开始节点的机器
|
||||
|
||||
PipPipeline pipeline = (PipPipeline) getContextManager().getContext(taskDef.getPipelineId()).getContextDef();
|
||||
// String resourceId = pipeline.getResourceId();
|
||||
// ResourceFindResp resourceById = getResourceManagerService().findResourceById(resourceId);
|
||||
// PipResourceMachine resourceMachine = resourceById.getResourceMachine();
|
||||
|
||||
//获取机器
|
||||
String resourceType = taskProperties.get("resourceType").toString();
|
||||
String resourceId = taskProperties.get("resourceId").toString();
|
||||
if (StringUtils.isEmpty(resourceId) || StringUtils.isEmpty(resourceType)) {
|
||||
append(context,"缺少参数");
|
||||
// 缺少参数
|
||||
toBadEnding();
|
||||
}
|
||||
@ -101,12 +85,13 @@ public class CustomCompilerWorker extends SshWorker {
|
||||
append(context,"上传路径:"+"/home/casic/706/ai_test_527");
|
||||
// 上传目标 到目标服务器
|
||||
//通过taskProperties获取制品路径
|
||||
String remoteDir = taskProperties.get("remoteDir").toString();
|
||||
// String remoteDir = taskProperties.get("remoteDir").toString();
|
||||
String remoteDir = null;
|
||||
if (StringUtils.isEmpty(remoteDir)){
|
||||
//则默认路径写死
|
||||
remoteDir = "/home/casic/706/ai_test_527";
|
||||
}
|
||||
SftpUploadUtil.uploadFileViaSftp(resourceMachine.getMachineHost(),Integer.valueOf(resourceMachine.getSshPort()),resourceMachine.getUsername(), CryptogramUtil.doDecrypt(resourceMachine.getPassword()),null,file.getAbsolutePath(),"/home/casic/706/ai_test_527",file.getName());
|
||||
SftpUploadUtil.uploadFileViaSftp(resourceMachine.getMachineHost(),Integer.valueOf(resourceMachine.getSshPort()),resourceMachine.getUsername(), CryptogramUtil.doDecrypt(resourceMachine.getPassword()),null,file.getAbsolutePath(),remoteDir,file.getName());
|
||||
|
||||
//TODO 得改一下
|
||||
statusCode = shell(resourceMachine, null,context,
|
||||
|
@ -56,15 +56,15 @@ public class TestCaseGenerationWorker extends SshWorker {
|
||||
toBadEnding();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(seedTarget)) {
|
||||
commandScript += "--output-dir " + seedTarget + " --count 100";
|
||||
commandScript += " --output-dir " + seedTarget + " --count 100";
|
||||
} else {
|
||||
commandScript += "--output-dir case --count 100";
|
||||
commandScript += " --output-dir case --count 100";
|
||||
}
|
||||
try {
|
||||
//将节点的配置信息反编译成对象
|
||||
log.info("构建脚本" + commandScript);
|
||||
//获取机器
|
||||
statusCode = shell(resourceMachine, CryptogramUtil.doDecrypt(resourceMachine.getPassword()), context,
|
||||
statusCode = shell(resourceMachine, null, context,
|
||||
"echo \"测试用例生成\"",
|
||||
"cd /home/casic/706/yunqi",// 基础目录
|
||||
commandScript
|
||||
|
Loading…
x
Reference in New Issue
Block a user