fix: 部分缺陷
This commit is contained in:
parent
a0db35359c
commit
caec40d1ff
|
@ -208,7 +208,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
||||||
//环境
|
//环境
|
||||||
String name = apiAutomationService.get(debugReportId).getName();
|
String name = apiAutomationService.get(debugReportId).getName();
|
||||||
//时间
|
//时间
|
||||||
Long time = apiTestCaseWithBLOBs.getUpdateTime();
|
Long time = apiTestCaseWithBLOBs.getCreateTime();
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String executionTime = null;
|
String executionTime = null;
|
||||||
String time_ = String.valueOf(time);
|
String time_ = String.valueOf(time);
|
||||||
|
@ -286,7 +286,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
||||||
String executionEnvironment = apiScenario.getScenarioDefinition();
|
String executionEnvironment = apiScenario.getScenarioDefinition();
|
||||||
JSONObject json = JSONObject.parseObject(executionEnvironment);
|
JSONObject json = JSONObject.parseObject(executionEnvironment);
|
||||||
String name = "";
|
String name = "";
|
||||||
if (json.getString("environmentMap").length() > 0) {
|
if (json.getString("environmentMap").length() > 2) {
|
||||||
JSONObject environment = JSONObject.parseObject(json.getString("environmentMap"));
|
JSONObject environment = JSONObject.parseObject(json.getString("environmentMap"));
|
||||||
String environmentId = environment.get(apiScenario.getProjectId()).toString();
|
String environmentId = environment.get(apiScenario.getProjectId()).toString();
|
||||||
name = apiAutomationService.get(environmentId).getName();
|
name = apiAutomationService.get(environmentId).getName();
|
||||||
|
@ -363,13 +363,13 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
|
||||||
String subject = "";
|
String subject = "";
|
||||||
String event = "";
|
String event = "";
|
||||||
if (StringUtils.equals(ReportTriggerMode.API.name(), report.getTriggerMode())) {
|
if (StringUtils.equals(ReportTriggerMode.API.name(), report.getTriggerMode())) {
|
||||||
successContext = "接口测试 API任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行成功" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "【接口定义暂无报告链接】" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测)路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
successContext = "接口测试 API任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行成功" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
||||||
failedContext = "接口测试 API任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行失败" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "【接口定义暂无报告链接】" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
failedContext = "接口测试 API任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行失败" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
||||||
subject = Translator.get("task_notification_jenkins");
|
subject = Translator.get("task_notification_jenkins");
|
||||||
}
|
}
|
||||||
if (StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), report.getTriggerMode())) {
|
if (StringUtils.equals(ReportTriggerMode.SCHEDULE.name(), report.getTriggerMode())) {
|
||||||
successContext = "接口测试定时任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行成功" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "【接口定义暂无报告链接】" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
successContext = "接口测试定时任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行成功" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
||||||
failedContext = "接口测试定时任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行失败" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "【接口定义暂无报告链接】" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
failedContext = "接口测试定时任务通知:'" + report.getExecutor() + "所执行的" + report.getName() + "'执行失败" + "\n" + "执行环境:" + report.getExecutionEnvironment() + "\n" + "[接口定义暂无报告链接]" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + "(旧版)接口测试路径" + url + "\n" + "(新版)接口测试路径" + url2;
|
||||||
subject = Translator.get("task_notification");
|
subject = Translator.get("task_notification");
|
||||||
}
|
}
|
||||||
if (StringUtils.equals("Success", report.getStatus())) {
|
if (StringUtils.equals("Success", report.getStatus())) {
|
||||||
|
|
|
@ -14,6 +14,9 @@ public interface ExtTestPlanLoadCaseMapper {
|
||||||
List<TestPlanLoadCaseDTO> selectByIdIn(@Param("request") LoadCaseRequest request);
|
List<TestPlanLoadCaseDTO> selectByIdIn(@Param("request") LoadCaseRequest request);
|
||||||
|
|
||||||
void updateCaseStatus(@Param("reportId") String reportId, @Param("status") String status);
|
void updateCaseStatus(@Param("reportId") String reportId, @Param("status") String status);
|
||||||
|
|
||||||
|
void updateCaseStatusByApi(@Param("testPlanId") String testPlanId, @Param("loadCaseId") String loadCaseId, @Param("status") String status);
|
||||||
|
|
||||||
List<String> getStatusByTestPlanId(@Param("planId") String planId);
|
List<String> getStatusByTestPlanId(@Param("planId") String planId);
|
||||||
|
|
||||||
List<String> selectTestPlanLoadCaseId(@Param("request") LoadCaseRequest request);
|
List<String> selectTestPlanLoadCaseId(@Param("request") LoadCaseRequest request);
|
||||||
|
|
|
@ -6,6 +6,12 @@
|
||||||
set status = #{status}
|
set status = #{status}
|
||||||
where tplc.load_report_id = #{reportId}
|
where tplc.load_report_id = #{reportId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateCaseStatusByApi">
|
||||||
|
update test_plan_load_case tplc
|
||||||
|
set status = #{status}
|
||||||
|
where tplc.load_case_id = #{loadCaseId}
|
||||||
|
and tplc.test_plan_id = #{testPlanId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="selectIdsNotInPlan" resultType="java.lang.String">
|
<select id="selectIdsNotInPlan" resultType="java.lang.String">
|
||||||
select load_test.id
|
select load_test.id
|
||||||
|
|
|
@ -76,4 +76,9 @@ public class TestPlanLoadCaseController {
|
||||||
public void update(@RequestBody TestPlanLoadCase testPlanLoadCase) {
|
public void update(@RequestBody TestPlanLoadCase testPlanLoadCase) {
|
||||||
testPlanLoadCaseService.update(testPlanLoadCase);
|
testPlanLoadCaseService.update(testPlanLoadCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update/api")
|
||||||
|
public void updateByApi(@RequestBody TestPlanLoadCase testPlanLoadCase) {
|
||||||
|
testPlanLoadCaseService.updateByApi(testPlanLoadCase);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,6 +221,13 @@ public class TestPlanLoadCaseService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateByApi(TestPlanLoadCase testPlanLoadCase) {
|
||||||
|
String testPlanId = testPlanLoadCase.getTestPlanId();
|
||||||
|
String loadCaseId = testPlanLoadCase.getLoadCaseId();
|
||||||
|
String status = testPlanLoadCase.getStatus();
|
||||||
|
extTestPlanLoadCaseMapper.updateCaseStatusByApi(testPlanId, loadCaseId, status);
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getStatus(String planId) {
|
public List<String> getStatus(String planId) {
|
||||||
return extTestPlanLoadCaseMapper.getStatusByTestPlanId(planId);
|
return extTestPlanLoadCaseMapper.getStatusByTestPlanId(planId);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue