This commit is contained in:
fit2-zhao 2021-01-28 18:03:37 +08:00
commit 7e2b2baf80
4 changed files with 25 additions and 1 deletions

View File

@ -177,6 +177,10 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl
} else if (StringUtils.equals(this.runMode, ApiRunMode.JENKINS.name())) {
apiDefinitionService.addResult(testResult);
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.DEFINITION.name());
apiTestService.changeStatus(testId, APITestStatus.Completed);
report = apiReportService.getRunningReport(testResult.getTestId());
apiReportService.complete(testResult, report);
apiDefinitionExecResultService.saveApiResult(testResult, ApiRunMode.API_PLAN.name());
} else if (StringUtils.equalsAny(this.runMode, ApiRunMode.API_PLAN.name(), ApiRunMode.SCHEDULE_API_PLAN.name())) {
apiDefinitionService.addResult(testResult);

View File

@ -15,6 +15,7 @@ import io.metersphere.track.dto.TestPlanDTOWithMetric;
import io.metersphere.track.request.testcase.PlanCaseRelevanceRequest;
import io.metersphere.track.request.testcase.QueryTestPlanRequest;
import io.metersphere.track.request.testplan.AddTestPlanRequest;
import io.metersphere.track.request.testplan.TestplanRunRequest;
import io.metersphere.track.request.testplancase.TestCaseRelevanceRequest;
import io.metersphere.track.service.TestPlanProjectService;
import io.metersphere.track.service.TestPlanService;
@ -136,4 +137,8 @@ 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){
testPlanService.run(testplanRunRequest.getTestPlanID(),testplanRunRequest.getProjectID(),testplanRunRequest.getUserId(),testplanRunRequest.getTriggerMode());
}
}

View File

@ -0,0 +1,15 @@
package io.metersphere.track.request.testplan;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TestplanRunRequest {
private String testPlanID;
private String projectID;
private String userId;
private String triggerMode;
}

@ -1 +1 @@
Subproject commit 26d36f3f81e889f58eed7c6903252a129b301d98
Subproject commit b35af517d888268abd3a8f2b58d6ea94335138a5