fix(测试跟踪): jenkins执行测试计划时不再会同时触发测试计划的通知和场景用例的通知

--bug=1013358 --user=宋天阳 【消息通知】用jenkins 跑一个包含100+
场景的测试计划,邮箱收到100+条通知,建议只接收执行该测试计划的一个通知
https://www.tapd.cn/55049933/s/1173807
This commit is contained in:
song-tianyang 2022-06-06 15:27:36 +08:00 committed by f2c-ci-robot[bot]
parent 700107a073
commit 1689b29b02
3 changed files with 6 additions and 1 deletions

View File

@ -221,6 +221,10 @@ public class ApiScenarioReportService {
if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString())) { if (StringUtils.equals(reportType, RunModeConstants.SET_REPORT.toString())) {
return report; return report;
} }
if(StringUtils.equalsAnyIgnoreCase(report.getTriggerMode(),ReportTriggerMode.JENKINS_RUN_TEST_PLAN.name())){
//jenkins运行测试计划时执行的场景触发方式改回API
report.setTriggerMode(ReportTriggerMode.API.name());
}
if (runMode.equals("CASE")) { if (runMode.equals("CASE")) {
report.setTriggerMode(TriggerMode.MANUAL.name()); report.setTriggerMode(TriggerMode.MANUAL.name());
} }

View File

@ -4,6 +4,7 @@ public enum ReportTriggerMode {
MANUAL, MANUAL,
SCHEDULE, SCHEDULE,
API, API,
JENKINS_RUN_TEST_PLAN,
/** /**
* 性能测试用例执行触发报告 * 性能测试用例执行触发报告
*/ */

View File

@ -1020,7 +1020,7 @@ public class TestPlanService {
scenarioRequest.setReportId(scenarioReportID); scenarioRequest.setReportId(scenarioReportID);
scenarioRequest.setProjectId(projectID); scenarioRequest.setProjectId(projectID);
if (StringUtils.equals(triggerMode, ReportTriggerMode.API.name())) { if (StringUtils.equals(triggerMode, ReportTriggerMode.API.name())) {
scenarioRequest.setTriggerMode(ReportTriggerMode.API.name()); scenarioRequest.setTriggerMode(ReportTriggerMode.JENKINS_RUN_TEST_PLAN.name());
scenarioRequest.setRunMode(ApiRunMode.JENKINS_SCENARIO_PLAN.name()); scenarioRequest.setRunMode(ApiRunMode.JENKINS_SCENARIO_PLAN.name());
} else if (StringUtils.equals(triggerMode, ReportTriggerMode.MANUAL.name())) { } else if (StringUtils.equals(triggerMode, ReportTriggerMode.MANUAL.name())) {
scenarioRequest.setTriggerMode(ReportTriggerMode.MANUAL.name()); scenarioRequest.setTriggerMode(ReportTriggerMode.MANUAL.name());