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