fix:jenkins调用测试报告不更新

This commit is contained in:
wenyann 2021-07-01 13:50:20 +08:00 committed by 刘瑞斌
parent fa5e5ae87c
commit 33ff754cc4
6 changed files with 18 additions and 5 deletions

View File

@ -103,6 +103,11 @@ public class WorkspaceController {
return workspaceService.getWorkspaceIdsByOrgId(orgId);
}
@GetMapping("/list/orgworkspace/{userId}/{orgId}")
public List<WorkspaceDTO> getWorkspaceListByOrgId(@PathVariable String userId, @PathVariable String orgId) {
return workspaceService.getWorkspaceIdsByOrgId(orgId);
}
@PostMapping("/member/update")
@MsAuditLog(module = "workspace_member", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = WorkspaceService.class)
public void updateOrgMember(@RequestBody WorkspaceMemberDTO memberDTO) {

View File

@ -152,14 +152,15 @@ public class TestPlanController {
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
return PageUtils.setPageInfo(page, testPlanProjectService.getProjectByPlanId(request));
}
@PostMapping("/testplan/jenkins")
public void runJenkins(@RequestBody TestplanRunRequest testplanRunRequest) {
public String runJenkins(@RequestBody TestplanRunRequest testplanRunRequest) {
ApiRunConfigDTO api = new ApiRunConfigDTO();
api.setMode(testplanRunRequest.getMode());
api.setResourcePoolId(testplanRunRequest.getResourcePoolId());
api.setOnSampleError(true);
api.setReportType("iddReport");
String apiRunConfig = JSONObject.toJSONString(api);
testPlanService.run(testplanRunRequest.getTestPlanId(), testplanRunRequest.getProjectId(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig);
return testPlanService.run(testplanRunRequest.getTestPlanId(), testplanRunRequest.getProjectId(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig);
}
}

View File

@ -500,6 +500,12 @@ public class TestPlanReportService {
noticeSendService.send(testPlanReport.getTriggerMode(), noticeModel);
}
public List<TestPlanReport> getTestPlanReportApi(String planId) {
TestPlanReportExample example = new TestPlanReportExample();
example.createCriteria().andTestPlanIdEqualTo(planId);
return testPlanReportMapper.selectByExample(example);
}
public TestPlanReport getTestPlanReport(String planId) {
return testPlanReportMapper.selectByPrimaryKey(planId);
}

View File

@ -1000,7 +1000,7 @@ public class TestPlanService {
return returnId;
}
public void run(String testPlanID, String projectID, String userId, String triggerMode, String apiRunConfig) {
public String run(String testPlanID, String projectID, String userId, String triggerMode, String apiRunConfig) {
Map<String, String> planScenarioIdMap;
Map<String, String> apiTestCaseIdMap;
Map<String, String> performanceIdMap;
@ -1160,6 +1160,7 @@ public class TestPlanService {
testPlanReport.setIsPerformanceExecuting(performaceIsExcuting);
testPlanReportService.update(testPlanReport);
}
return testPlanReport.getId();
}
public String getLogDetails(String id) {

View File

@ -87,7 +87,7 @@ export const Test_Plan_Function_Test_Case = [
//测试计划-api用例
export const Test_Plan_Api_Case = [
{id: 'num', label: i18n.t('commons.id')},
{id: 'name', label: i18n.t('api_test.definition.api_name')},
{id: 'name', label: i18n.t('test_track.case.name')},
{id: 'priority', label: i18n.t('test_track.case.priority')},
{id: 'path', label: i18n.t('api_test.definition.api_path')},
{id: 'createUser', label: '创建人'},

View File

@ -37,7 +37,7 @@
show-overflow-tooltip
:key="index"/>
<el-table-column v-if="item.id == 'name'" prop="name" sortable="custom" min-width="120"
:label="$t('api_test.definition.api_name')" show-overflow-tooltip :key="index"/>
:label="$t('test_track.case.name')" show-overflow-tooltip :key="index"/>
<el-table-column
v-if="item.id == 'priority'"