feat: 消息设置内容修改

This commit is contained in:
wenyann 2020-10-29 18:35:07 +08:00
parent 9b07c26e05
commit 12387c9253
3 changed files with 13 additions and 10 deletions

View File

@ -183,13 +183,13 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
if (StringUtils.equals(NoticeConstants.API, report.getTriggerMode())) {
MessageSettingDetail messageSettingDetail = noticeService.searchMessage();
taskList = messageSettingDetail.getJenkinsTask();
successContext = "jenkins任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "jenkins任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
successContext = "ApiJenkins任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "ApiJenkins任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
}
if (StringUtils.equals(NoticeConstants.SCHEDULE, report.getTriggerMode())) {
taskList = noticeService.searchMessageSchedule(testResult.getTestId());
successContext = "定时任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "定时任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
successContext = "Api定时任务通知:'" + report.getName() + "'执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
failedContext = "Api定时任务通知:'" + report.getName() + "'执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
}
String finalSuccessContext = successContext;
String finalFailedContext = failedContext;

View File

@ -73,11 +73,11 @@ public class PerformanceNoticeTask {
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode())) {
MessageSettingDetail messageSettingDetail = noticeService.searchMessage();
taskList = messageSettingDetail.getJenkinsTask();
successContext = "jenkins性能测试任务通知" + loadTestReport.getName() + "执行成功" + "请点击下面链接进入测试报告页面" + url;
successContext = "LoadJenkins任务通知:" + loadTestReport.getName() + "执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
}
if (StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
taskList = noticeService.searchMessageSchedule(loadTestReport.getId());
successContext = "定时任务性能测试任务通知" + loadTestReport.getName() + "执行成功" + "请点击下面链接进入测试报告页面" + url;
taskList = noticeService.searchMessageSchedule(loadTestReport.getTestId());
successContext = "Load定时任务通知:" + loadTestReport.getName() + "执行成功" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
}
String finalSuccessContext = successContext;
taskList.forEach(r -> {
@ -112,11 +112,11 @@ public class PerformanceNoticeTask {
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode())) {
MessageSettingDetail messageSettingDetail = noticeService.searchMessage();
taskList = messageSettingDetail.getJenkinsTask();
failedContext = "jenkins性能测试任务通知" + loadTestReport.getName() + "执行失败" + "请点击下面链接进入测试报告页面" + url;
failedContext = "LoadJenkins任务通知:" + loadTestReport.getName() + "执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
}
if (StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
taskList = noticeService.searchMessageSchedule(loadTestReport.getId());
failedContext = "定时任务性能测试任务通知" + loadTestReport.getName() + "执行失败" + "请点击下面链接进入测试报告页面" + url;
taskList = noticeService.searchMessageSchedule(loadTestReport.getTestId());
failedContext = "Load定时任务通知:" + loadTestReport.getName() + "执行失败" + "\n" + "请点击下面链接进入测试报告页面" + "\n" + url;
}
String finalFailedContext = failedContext;
taskList.forEach(r -> {

View File

@ -233,6 +233,9 @@ public class PerformanceTestService {
if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, loadTestReport.getTriggerMode())) {
performanceNoticeTask.registerNoticeTask(loadTestReport);
}
/*if (StringUtils.equals(NoticeConstants.API, loadTestReport.getTriggerMode()) || StringUtils.equals(NoticeConstants.SCHEDULE, "SCHEDULE")) {
performanceNoticeTask.registerNoticeTask(loadTestReport);
}*/
return engine.getReportId();
}