fix(测试跟踪): 测试计划报告分享性能报告资源池信息不显示

--bug=1016200 --user=陈建星 【测试跟踪】定时任务执行测试计划,执行完性能测试报告中资源池是uuid https://www.tapd.cn/55049933/s/1233833
This commit is contained in:
chenjianxing 2022-08-25 15:19:22 +08:00 committed by jianxing
parent 28a6a13b75
commit 9148652f37
4 changed files with 44 additions and 17 deletions

View File

@ -597,10 +597,10 @@ public class ShareInfoService {
ShareInfoService shareInfoService = CommonBeanFactory.getBean(ShareInfoService.class); ShareInfoService shareInfoService = CommonBeanFactory.getBean(ShareInfoService.class);
shareInfoService.validateExpired(shareInfo); shareInfoService.validateExpired(shareInfo);
if (shareInfo == null) { if (shareInfo == null) {
MSException.throwException("shareInfo not exist!"); MSException.throwException("ShareInfo not exist!");
} else { } else {
if (!StringUtils.equals(customData, shareInfo.getCustomData())) { if (!StringUtils.equals(customData, shareInfo.getCustomData())) {
MSException.throwException("validate failure!"); MSException.throwException("ShareInfo validate failure!");
} }
} }
} }

View File

@ -168,7 +168,7 @@ public class ShareController {
@GetMapping("/api/definition/report/getReport/{shareId}/{testId}") @GetMapping("/api/definition/report/getReport/{shareId}/{testId}")
public APIReportResult getApiReport(@PathVariable String shareId, @PathVariable String testId) { public APIReportResult getApiReport(@PathVariable String shareId, @PathVariable String testId) {
// shareInfoService.apiReportValidate(shareId, testId); shareInfoService.validateExpired(shareId);
return apiDefinitionService.getDbResult(testId); return apiDefinitionService.getDbResult(testId);
} }
@ -180,25 +180,25 @@ public class ShareController {
@GetMapping("/performance/report/{shareId}/{reportId}") @GetMapping("/performance/report/{shareId}/{reportId}")
public ReportDTO getLoadTestReport(@PathVariable String shareId, @PathVariable String reportId) { public ReportDTO getLoadTestReport(@PathVariable String shareId, @PathVariable String reportId) {
//todo shareInfoService.validateExpired(shareId);
return performanceReportService.getReportTestAndProInfo(reportId); return performanceReportService.getReportTestAndProInfo(reportId);
} }
@GetMapping("/performance/report/content/report_time/{shareId}/{reportId}") @GetMapping("/performance/report/content/report_time/{shareId}/{reportId}")
public ReportTimeInfo getReportTimeInfo(@PathVariable String shareId, @PathVariable String reportId) { public ReportTimeInfo getReportTimeInfo(@PathVariable String shareId, @PathVariable String reportId) {
// todo shareInfoService.validateExpired(shareId);
return performanceReportService.getReportTimeInfo(reportId); return performanceReportService.getReportTimeInfo(reportId);
} }
@PostMapping("/test/plan/load/case/report/exist/{shareId}") @PostMapping("/test/plan/load/case/report/exist/{shareId}")
public Boolean isExistReport(@PathVariable String shareId, @RequestBody LoadCaseReportRequest request) { public Boolean isExistReport(@PathVariable String shareId, @RequestBody LoadCaseReportRequest request) {
// testPlanLoadCaseService todo checkout shareInfoService.validateExpired(shareId);
return testPlanLoadCaseService.isExistReport(request); return testPlanLoadCaseService.isExistReport(request);
} }
@GetMapping("/performance/report/get-advanced-config/{shareId}/{reportId}") @GetMapping("/performance/report/get-advanced-config/{shareId}/{reportId}")
public String getAdvancedConfig(@PathVariable String shareId, @PathVariable String reportId) { public String getAdvancedConfig(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validate(shareId, reportId); shareInfoService.validateExpired(shareId);
return performanceReportService.getAdvancedConfiguration(reportId); return performanceReportService.getAdvancedConfiguration(reportId);
} }
@ -209,12 +209,13 @@ public class ShareController {
@GetMapping("/performance/report/get-jmx-content/{shareId}/{reportId}") @GetMapping("/performance/report/get-jmx-content/{shareId}/{reportId}")
public LoadTestExportJmx getJmxContent(@PathVariable String shareId, @PathVariable String reportId) { public LoadTestExportJmx getJmxContent(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getJmxContent(reportId).get(0); return performanceReportService.getJmxContent(reportId).get(0);
} }
@GetMapping("/performance/get-jmx-content/{shareId}/{testId}") @GetMapping("/performance/get-jmx-content/{shareId}/{testId}")
public List<LoadTestExportJmx> getOldJmxContent(@PathVariable String shareId, @PathVariable String testId) { public List<LoadTestExportJmx> getOldJmxContent(@PathVariable String shareId, @PathVariable String testId) {
// checkPermissionService.checkPerformanceTestOwner(testId); shareInfoService.validateExpired(shareId);
return performanceTestService.getJmxContent(testId); return performanceTestService.getJmxContent(testId);
} }
@ -226,51 +227,61 @@ public class ShareController {
@GetMapping("/performance/report/content/testoverview/{shareId}/{reportId}") @GetMapping("/performance/report/content/testoverview/{shareId}/{reportId}")
public TestOverview getTestOverview(@PathVariable String shareId, @PathVariable String reportId) { public TestOverview getTestOverview(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getTestOverview(reportId); return performanceReportService.getTestOverview(reportId);
} }
@GetMapping("/performance/report/content/load_chart/{shareId}/{reportId}") @GetMapping("/performance/report/content/load_chart/{shareId}/{reportId}")
public List<ChartsData> getLoadChartData(@PathVariable String shareId, @PathVariable String reportId) { public List<ChartsData> getLoadChartData(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getLoadChartData(reportId); return performanceReportService.getLoadChartData(reportId);
} }
@GetMapping("/performance/report/content/res_chart/{shareId}/{reportId}") @GetMapping("/performance/report/content/res_chart/{shareId}/{reportId}")
public List<ChartsData> getResponseTimeChartData(@PathVariable String shareId, @PathVariable String reportId) { public List<ChartsData> getResponseTimeChartData(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getResponseTimeChartData(reportId); return performanceReportService.getResponseTimeChartData(reportId);
} }
@GetMapping("/performance/report/content/error_chart/{shareId}/{reportId}") @GetMapping("/performance/report/content/error_chart/{shareId}/{reportId}")
public List<ChartsData> getErrorChartData(@PathVariable String shareId, @PathVariable String reportId) { public List<ChartsData> getErrorChartData(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getErrorChartData(reportId); return performanceReportService.getErrorChartData(reportId);
} }
@GetMapping("/performance/report/content/response_code_chart/{shareId}/{reportId}") @GetMapping("/performance/report/content/response_code_chart/{shareId}/{reportId}")
public List<ChartsData> getResponseCodeChartData(@PathVariable String shareId, @PathVariable String reportId) { public List<ChartsData> getResponseCodeChartData(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getResponseCodeChartData(reportId); return performanceReportService.getResponseCodeChartData(reportId);
} }
@GetMapping("/performance/report/content/{shareId}/{reportKey}/{reportId}") @GetMapping("/performance/report/content/{shareId}/{reportKey}/{reportId}")
public List<ChartsData> getReportChart(@PathVariable String shareId, @PathVariable String reportKey, @PathVariable String reportId) { public List<ChartsData> getReportChart(@PathVariable String shareId, @PathVariable String reportKey, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getReportChart(reportKey, reportId); return performanceReportService.getReportChart(reportKey, reportId);
} }
@GetMapping("/performance/report/content/{shareId}/{reportId}") @GetMapping("/performance/report/content/{shareId}/{reportId}")
public List<Statistics> getReportContent(@PathVariable String shareId, @PathVariable String reportId) { public List<Statistics> getReportContent(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getReportStatistics(reportId); return performanceReportService.getReportStatistics(reportId);
} }
@GetMapping("/performance/report/content/errors/{shareId}/{reportId}") @GetMapping("/performance/report/content/errors/{shareId}/{reportId}")
public List<Errors> getReportErrors(@PathVariable String shareId, @PathVariable String reportId) { public List<Errors> getReportErrors(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getReportErrors(reportId); return performanceReportService.getReportErrors(reportId);
} }
@GetMapping("/performance/report/content/errors_top5/{shareId}/{reportId}") @GetMapping("/performance/report/content/errors_top5/{shareId}/{reportId}")
public List<ErrorsTop5> getReportErrorsTop5(@PathVariable String shareId, @PathVariable String reportId) { public List<ErrorsTop5> getReportErrorsTop5(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getReportErrorsTOP5(reportId); return performanceReportService.getReportErrorsTOP5(reportId);
} }
@GetMapping("/performance/report/log/resource/{shareId}/{reportId}") @GetMapping("/performance/report/log/resource/{shareId}/{reportId}")
public List<LogDetailDTO> getResourceIds(@PathVariable String shareId, @PathVariable String reportId) { public List<LogDetailDTO> getResourceIds(@PathVariable String shareId, @PathVariable String reportId) {
shareInfoService.validateExpired(shareId);
return performanceReportService.getReportLogResource(reportId); return performanceReportService.getReportLogResource(reportId);
} }
@ -281,23 +292,26 @@ public class ShareController {
@GetMapping("/performance/report/log/{shareId}/{reportId}/{resourceId}/{goPage}") @GetMapping("/performance/report/log/{shareId}/{reportId}/{resourceId}/{goPage}")
public Pager<List<LoadTestReportLog>> logs(@PathVariable String shareId, @PathVariable String reportId, @PathVariable String resourceId, @PathVariable int goPage) { public Pager<List<LoadTestReportLog>> logs(@PathVariable String shareId, @PathVariable String reportId, @PathVariable String resourceId, @PathVariable int goPage) {
shareInfoService.validateExpired(shareId);
Page<Object> page = PageHelper.startPage(goPage, 1, true); Page<Object> page = PageHelper.startPage(goPage, 1, true);
return PageUtils.setPageInfo(page, performanceReportService.getReportLogs(reportId, resourceId)); return PageUtils.setPageInfo(page, performanceReportService.getReportLogs(reportId, resourceId));
} }
@GetMapping("/metric/query/{shareId}/{id}") @GetMapping("/metric/query/{shareId}/{id}")
public List<MetricData> queryMetric(@PathVariable String shareId, @PathVariable("id") String reportId) { public List<MetricData> queryMetric(@PathVariable String shareId, @PathVariable("id") String reportId) {
shareInfoService.validateExpired(shareId);
return metricService.queryMetric(reportId); return metricService.queryMetric(reportId);
} }
@GetMapping("/metric/query/resource/{shareId}/{id}") @GetMapping("/metric/query/resource/{shareId}/{id}")
public List<Monitor> queryReportResource(@PathVariable String shareId, @PathVariable("id") String reportId) { public List<Monitor> queryReportResource(@PathVariable String shareId, @PathVariable("id") String reportId) {
shareInfoService.validateExpired(shareId);
return metricService.queryReportResource(reportId); return metricService.queryReportResource(reportId);
} }
@GetMapping("/performance/report/get-load-config/{shareId}/{testId}") @GetMapping("/performance/report/get-load-config/{shareId}/{testId}")
public String getLoadConfiguration(@PathVariable String shareId, @PathVariable String testId) { public String getLoadConfiguration(@PathVariable String shareId, @PathVariable String testId) {
//checkPermissionService.checkPerformanceTestOwner(testId); shareInfoService.validateExpired(shareId);
return performanceTestService.getLoadConfiguration(testId); return performanceTestService.getLoadConfiguration(testId);
} }

View File

@ -1,13 +1,26 @@
<template> <template>
<el-container> <el-container>
<ms-aside-container width="500px" :default-hidden-bottom-top="200" :enable-auto-height="true"> <ms-aside-container width="500px" :default-hidden-bottom-top="200" :enable-auto-height="true">
<load-failure-result :class="{'init-height': !showResponse}" :is-db="isDb" @rowClick="getReport" :is-all="isAll" <load-failure-result :class="{'init-height': !showResponse}"
:share-id="shareId" :is-share="isShare" :is-template="isTemplate" :is-db="isDb"
:report="report" :plan-id="planId" @setSize="setAllSize"/> :is-all="isAll"
:share-id="shareId"
:is-share="isShare"
:is-template="isTemplate"
:report="report"
:plan-id="planId"
@rowClick="getReport"
@setSize="setAllSize"/>
</ms-aside-container> </ms-aside-container>
<ms-main-container> <ms-main-container>
<load-case-report-view :is-plan-report="true" :share-id="shareId" :is-share="isShare" v-show="showResponse" <load-case-report-view v-show="showResponse"
:plan-report-template="response" :report-id="reportId" ref="loadCaseReportView"/> :is-plan-report="true"
:share-id="shareId"
:is-share="isShare"
:plan-id="planId"
:plan-report-template="response"
:report-id="reportId"
ref="loadCaseReportView"/>
<div class="empty" v-show="!showResponse">{{ $t('test_track.plan.load_case.content_empty') }}</div> <div class="empty" v-show="!showResponse">{{ $t('test_track.plan.load_case.content_empty') }}</div>
</ms-main-container> </ms-main-container>
</el-container> </el-container>

View File

@ -9,8 +9,7 @@ import filters from "@/common/js/filter";
import icon from "@/common/js/icon"; import icon from "@/common/js/icon";
import message from "@/common/js/message"; import message from "@/common/js/message";
import mavonEditor from "mavon-editor"; import mavonEditor from "mavon-editor";
import ajax from "@/common/js/ajax";
// import CKEditor from '@ckeditor/ckeditor5-vue';
function planReportUse(id, template) { function planReportUse(id, template) {
Vue.use(ElementUI, { Vue.use(ElementUI, {
@ -31,7 +30,8 @@ function planReportUse(id, template) {
Vue.use(filters); Vue.use(filters);
Vue.use(icon); Vue.use(icon);
Vue.use(message); Vue.use(message);
// Vue.use(CKEditor); Vue.use(message);
Vue.use(ajax);
Vue.use(mavonEditor); Vue.use(mavonEditor);
Vue.use(Popover); Vue.use(Popover);