From 9148652f3759c74c4a7efc2a0747594235ded2fd Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 25 Aug 2022 15:19:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5=E5=91=8A=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E6=80=A7=E8=83=BD=E6=8A=A5=E5=91=8A=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=B1=A0=E4=BF=A1=E6=81=AF=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1016200 --user=陈建星 【测试跟踪】定时任务执行测试计划,执行完性能测试报告中资源池是uuid https://www.tapd.cn/55049933/s/1233833 --- .../api/service/ShareInfoService.java | 4 +-- .../controller/ShareController.java | 28 ++++++++++++++----- .../report/detail/component/LoadAllResult.vue | 23 +++++++++++---- .../src/template/report/plan/planReportUse.js | 6 ++-- 4 files changed, 44 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java b/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java index 808d393fce..afe125d583 100644 --- a/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java +++ b/backend/src/main/java/io/metersphere/api/service/ShareInfoService.java @@ -597,10 +597,10 @@ public class ShareInfoService { ShareInfoService shareInfoService = CommonBeanFactory.getBean(ShareInfoService.class); shareInfoService.validateExpired(shareInfo); if (shareInfo == null) { - MSException.throwException("shareInfo not exist!"); + MSException.throwException("ShareInfo not exist!"); } else { if (!StringUtils.equals(customData, shareInfo.getCustomData())) { - MSException.throwException("validate failure!"); + MSException.throwException("ShareInfo validate failure!"); } } } diff --git a/backend/src/main/java/io/metersphere/controller/ShareController.java b/backend/src/main/java/io/metersphere/controller/ShareController.java index e8f72ee24e..edc014b14c 100644 --- a/backend/src/main/java/io/metersphere/controller/ShareController.java +++ b/backend/src/main/java/io/metersphere/controller/ShareController.java @@ -168,7 +168,7 @@ public class ShareController { @GetMapping("/api/definition/report/getReport/{shareId}/{testId}") public APIReportResult getApiReport(@PathVariable String shareId, @PathVariable String testId) { -// shareInfoService.apiReportValidate(shareId, testId); + shareInfoService.validateExpired(shareId); return apiDefinitionService.getDbResult(testId); } @@ -180,25 +180,25 @@ public class ShareController { @GetMapping("/performance/report/{shareId}/{reportId}") public ReportDTO getLoadTestReport(@PathVariable String shareId, @PathVariable String reportId) { - //todo + shareInfoService.validateExpired(shareId); return performanceReportService.getReportTestAndProInfo(reportId); } @GetMapping("/performance/report/content/report_time/{shareId}/{reportId}") public ReportTimeInfo getReportTimeInfo(@PathVariable String shareId, @PathVariable String reportId) { - // todo + shareInfoService.validateExpired(shareId); return performanceReportService.getReportTimeInfo(reportId); } @PostMapping("/test/plan/load/case/report/exist/{shareId}") public Boolean isExistReport(@PathVariable String shareId, @RequestBody LoadCaseReportRequest request) { - // testPlanLoadCaseService todo checkout + shareInfoService.validateExpired(shareId); return testPlanLoadCaseService.isExistReport(request); } @GetMapping("/performance/report/get-advanced-config/{shareId}/{reportId}") public String getAdvancedConfig(@PathVariable String shareId, @PathVariable String reportId) { - shareInfoService.validate(shareId, reportId); + shareInfoService.validateExpired(shareId); return performanceReportService.getAdvancedConfiguration(reportId); } @@ -209,12 +209,13 @@ public class ShareController { @GetMapping("/performance/report/get-jmx-content/{shareId}/{reportId}") public LoadTestExportJmx getJmxContent(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getJmxContent(reportId).get(0); } @GetMapping("/performance/get-jmx-content/{shareId}/{testId}") public List getOldJmxContent(@PathVariable String shareId, @PathVariable String testId) { -// checkPermissionService.checkPerformanceTestOwner(testId); + shareInfoService.validateExpired(shareId); return performanceTestService.getJmxContent(testId); } @@ -226,51 +227,61 @@ public class ShareController { @GetMapping("/performance/report/content/testoverview/{shareId}/{reportId}") public TestOverview getTestOverview(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getTestOverview(reportId); } @GetMapping("/performance/report/content/load_chart/{shareId}/{reportId}") public List getLoadChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getLoadChartData(reportId); } @GetMapping("/performance/report/content/res_chart/{shareId}/{reportId}") public List getResponseTimeChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getResponseTimeChartData(reportId); } @GetMapping("/performance/report/content/error_chart/{shareId}/{reportId}") public List getErrorChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getErrorChartData(reportId); } @GetMapping("/performance/report/content/response_code_chart/{shareId}/{reportId}") public List getResponseCodeChartData(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getResponseCodeChartData(reportId); } @GetMapping("/performance/report/content/{shareId}/{reportKey}/{reportId}") public List getReportChart(@PathVariable String shareId, @PathVariable String reportKey, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportChart(reportKey, reportId); } @GetMapping("/performance/report/content/{shareId}/{reportId}") public List getReportContent(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportStatistics(reportId); } @GetMapping("/performance/report/content/errors/{shareId}/{reportId}") public List getReportErrors(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportErrors(reportId); } @GetMapping("/performance/report/content/errors_top5/{shareId}/{reportId}") public List getReportErrorsTop5(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportErrorsTOP5(reportId); } @GetMapping("/performance/report/log/resource/{shareId}/{reportId}") public List getResourceIds(@PathVariable String shareId, @PathVariable String reportId) { + shareInfoService.validateExpired(shareId); return performanceReportService.getReportLogResource(reportId); } @@ -281,23 +292,26 @@ public class ShareController { @GetMapping("/performance/report/log/{shareId}/{reportId}/{resourceId}/{goPage}") public Pager> logs(@PathVariable String shareId, @PathVariable String reportId, @PathVariable String resourceId, @PathVariable int goPage) { + shareInfoService.validateExpired(shareId); Page page = PageHelper.startPage(goPage, 1, true); return PageUtils.setPageInfo(page, performanceReportService.getReportLogs(reportId, resourceId)); } @GetMapping("/metric/query/{shareId}/{id}") public List queryMetric(@PathVariable String shareId, @PathVariable("id") String reportId) { + shareInfoService.validateExpired(shareId); return metricService.queryMetric(reportId); } @GetMapping("/metric/query/resource/{shareId}/{id}") public List queryReportResource(@PathVariable String shareId, @PathVariable("id") String reportId) { + shareInfoService.validateExpired(shareId); return metricService.queryReportResource(reportId); } @GetMapping("/performance/report/get-load-config/{shareId}/{testId}") public String getLoadConfiguration(@PathVariable String shareId, @PathVariable String testId) { - //checkPermissionService.checkPerformanceTestOwner(testId); + shareInfoService.validateExpired(shareId); return performanceTestService.getLoadConfiguration(testId); } diff --git a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue index d0f10a7ae4..c88f9cf6c3 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/detail/component/LoadAllResult.vue @@ -1,13 +1,26 @@