|
@@ -125,19 +125,15 @@ public class TraceDaemon extends Thread{
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
if ("BugReport".equals(reportType)) {
|
|
if ("BugReport".equals(reportType)) {
|
|
- PrintUtil.print("Generate bug report by AllenTian's docker", TAG);
|
|
|
|
- String command = "java -jar tasks/AutoTestReportGenerator.jar " + traceId;
|
|
|
|
|
|
+ PrintUtil.print(String.format("Generate bug report by %s's docker", reportType), TAG);
|
|
|
|
+ String command = String.format("java -jar tasks/%s.jar %s", reportType, traceId);
|
|
String result = OsUtil.runCommand(command);
|
|
String result = OsUtil.runCommand(command);
|
|
- // TODO 这里在田老师改了生成逻辑后,就可以删掉了
|
|
|
|
- if (!"success\n".equals(result)){
|
|
|
|
- PrintUtil.print(result, TAG);
|
|
|
|
- PrintUtil.print("Generate bug report failed, use default report.", TAG);
|
|
|
|
- FileUtils.copyFile(new File(AddressUtil.getMockDataJsonPath()), new File(AddressUtil.getDataJsonPath(traceId)));
|
|
|
|
- }
|
|
|
|
|
|
+ PrintUtil.print(result, TAG);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+ PrintUtil.print(String.format("Upload report json file"), TAG);
|
|
// 上传data.json文件
|
|
// 上传data.json文件
|
|
File data = new File(AddressUtil.getDataJsonPath(traceId));
|
|
File data = new File(AddressUtil.getDataJsonPath(traceId));
|
|
String path = ossService.uploadFileToTraceDir(data, traceId, Consts.REPORT_FILE_NAME);
|
|
String path = ossService.uploadFileToTraceDir(data, traceId, Consts.REPORT_FILE_NAME);
|
|
@@ -176,20 +172,6 @@ public class TraceDaemon extends Thread{
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 解析报告内容,上传截图
|
|
|
|
- * @param dataJson data.json文件
|
|
|
|
- */
|
|
|
|
- private void parseDataJson(File dataJson, String traceId){
|
|
|
|
- try {
|
|
|
|
- String content = FileUtils.readFileToString(dataJson, "UTF-8");
|
|
|
|
- JSONObject json = JSON.parseObject(content);
|
|
|
|
- JSONArray bugList = json.getJSONArray("bugList");
|
|
|
|
- } catch (IOException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
* @return 该trace下所有任务是否都已完成
|
|
* @return 该trace下所有任务是否都已完成
|
|
*/
|
|
*/
|
|
private boolean allTaskEnd(){
|
|
private boolean allTaskEnd(){
|