From b77d70e163be7d20edcd3ee3590cb63154c01c42 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 20 Feb 2023 18:48:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D7=E5=A4=A9=E5=A4=B1=E8=B4=A5=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=9C=AA=E7=BB=9F=E8=AE=A1=E5=9C=BA=E6=99=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=89=A7=E8=A1=8C=E6=97=B6=E7=9A=84=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023470 --user=宋天阳 【测试跟踪】首页- 过去7天测试计划失败用例TOP 10,没有统计接口场景失败的次数 https://www.tapd.cn/55049933/s/1338954 --- .../main/java/io/metersphere/service/TestResultService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java b/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java index f2825bd34b..d807920030 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/TestResultService.java @@ -223,6 +223,10 @@ public class TestResultService { if (planRunModes.contains(dto.getRunMode())) { TestPlanApiScenario testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(scenarioReport.getScenarioId()); + if (testPlanApiScenario == null) { + //测试计划-场景列表中,批量/单独执行场景时,关联ID记录在testID中 + testPlanApiScenario = testPlanApiScenarioMapper.selectByPrimaryKey(dto.getTestId()); + } if (testPlanApiScenario != null) { ApiScenarioWithBLOBs apiScenario = apiScenarioMapper.selectByPrimaryKey(testPlanApiScenario.getApiScenarioId()); if (apiScenario != null) {