feat(接口自动化): 完善实时执行结果
This commit is contained in:
parent
5e4ab41e46
commit
8fb591fdc9
|
@ -2,6 +2,7 @@ package io.metersphere.api.jmeter;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import io.metersphere.api.dto.RunRequest;
|
import io.metersphere.api.dto.RunRequest;
|
||||||
|
import io.metersphere.api.dto.automation.ExecuteType;
|
||||||
import io.metersphere.api.dto.automation.RunModeConfig;
|
import io.metersphere.api.dto.automation.RunModeConfig;
|
||||||
import io.metersphere.api.service.ApiScenarioReportService;
|
import io.metersphere.api.service.ApiScenarioReportService;
|
||||||
import io.metersphere.base.domain.TestResource;
|
import io.metersphere.base.domain.TestResource;
|
||||||
|
@ -123,9 +124,11 @@ public class JMeterService {
|
||||||
|
|
||||||
public void runLocal(String testId, HashTree testPlan, String debugReportId, String runMode) {
|
public void runLocal(String testId, HashTree testPlan, String debugReportId, String runMode) {
|
||||||
init();
|
init();
|
||||||
FixedTask.tasks.put(testId,System.currentTimeMillis());
|
FixedTask.tasks.put(testId, System.currentTimeMillis());
|
||||||
addBackendListener(testId, debugReportId, runMode, testPlan);
|
addBackendListener(testId, debugReportId, runMode, testPlan);
|
||||||
addResultCollector(testId, testPlan);
|
if (ExecuteType.Debug.name().equals(debugReportId)) {
|
||||||
|
addResultCollector(testId, testPlan);
|
||||||
|
}
|
||||||
LocalRunner runner = new LocalRunner(testPlan);
|
LocalRunner runner = new LocalRunner(testPlan);
|
||||||
runner.run();
|
runner.run();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1380,7 +1380,7 @@ public class ApiAutomationService {
|
||||||
FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles);
|
FileUtils.createBodyFiles(request.getScenarioFileIds(), scenarioFiles);
|
||||||
|
|
||||||
// 调用执行方法
|
// 调用执行方法
|
||||||
jMeterService.runLocal(request.getId(), hashTree, request.getReportId(), ApiRunMode.SCENARIO.name());
|
jMeterService.runLocal(request.getId(), hashTree, request.getExecuteType(), ApiRunMode.SCENARIO.name());
|
||||||
return request.getId();
|
return request.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue