fix(测试跟踪): 只有测试计划执行的权限,执行关联接口的功能用例会权限错误
--bug=1032874 --user=陈建星 有测试计划执行的权限,无法执行功能用例 https://www.tapd.cn/55049933/s/1436100
This commit is contained in:
parent
f912c5c0b8
commit
3cb5202f98
|
@ -327,26 +327,38 @@ public class TestPlanTestCaseService {
|
|||
switch (type) {
|
||||
case "performance":
|
||||
if (serviceIdSet.contains(MicroServiceName.PERFORMANCE_TEST)) {
|
||||
try {
|
||||
LoadTest loadTest = planPerformanceTestService.get(id);
|
||||
if (loadTest != null) {
|
||||
dto.setTestName(loadTest.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "testcase":
|
||||
if (serviceIdSet.contains(MicroServiceName.API_TEST)) {
|
||||
try {
|
||||
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = planApiTestCaseService.get(id);
|
||||
if (apiTestCaseWithBLOBs != null) {
|
||||
dto.setTestName(apiTestCaseWithBLOBs.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "automation":
|
||||
if (serviceIdSet.contains(MicroServiceName.API_TEST)) {
|
||||
try {
|
||||
ApiScenarioWithBLOBs apiScenarioWithBLOBs = panApiAutomationService.get(id);
|
||||
if (apiScenarioWithBLOBs != null) {
|
||||
dto.setTestName(apiScenarioWithBLOBs.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -2846,6 +2846,7 @@ public class TestCaseService {
|
|||
List<UiScenario> uiScenarios = new ArrayList<>();
|
||||
|
||||
if (serviceIdSet.contains(MicroServiceName.API_TEST)) {
|
||||
try {
|
||||
apiCases = relevanceApiCaseService.getApiCaseByIds(
|
||||
getTestIds(testCaseTests, TestCaseTestType.testcase.name()));
|
||||
apiScenarios = relevanceApiCaseService.getScenarioCaseByIds(
|
||||
|
@ -2855,20 +2856,31 @@ public class TestCaseService {
|
|||
projectIds.addAll(scenarioProjectIds);
|
||||
versionIds.addAll(apiCases.stream().map(s -> s.getVersionId()).collect(Collectors.toList()));
|
||||
versionIds.addAll(apiScenarios.stream().map(s -> s.getVersionId()).collect(Collectors.toList()));
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (serviceIdSet.contains(MicroServiceName.PERFORMANCE_TEST)) {
|
||||
try {
|
||||
apiLoadTests = relevanceLoadCaseService.getLoadCaseByIds(
|
||||
getTestIds(testCaseTests, TestCaseTestType.performance.name()));
|
||||
projectIds.addAll(apiLoadTests.stream().map(s -> s.getProjectId()).collect(Collectors.toList()));
|
||||
versionIds.addAll(apiLoadTests.stream().map(l -> l.getVersionId()).collect(Collectors.toList()));
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (serviceIdSet.contains(MicroServiceName.UI_TEST)) {
|
||||
try {
|
||||
uiScenarios = relevanceUiCaseService.getUiCaseByIds(
|
||||
getTestIds(testCaseTests, TestCaseTestType.uiAutomation.name()));
|
||||
projectIds.addAll(uiScenarios.stream().map(s -> s.getProjectId()).collect(Collectors.toList()));
|
||||
versionIds.addAll(uiScenarios.stream().map(l -> l.getVersionId()).collect(Collectors.toList()));
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue