Merge branch 'v1.4' into master
This commit is contained in:
commit
cfa053968d
|
@ -32,7 +32,6 @@ public class DockerTestEngine extends AbstractEngine {
|
||||||
super.init(loadTest);
|
super.init(loadTest);
|
||||||
this.restTemplate = (RestTemplate) CommonBeanFactory.getBean("restTemplate");
|
this.restTemplate = (RestTemplate) CommonBeanFactory.getBean("restTemplate");
|
||||||
this.restTemplateWithTimeOut = (RestTemplate) CommonBeanFactory.getBean("restTemplateWithTimeOut");
|
this.restTemplateWithTimeOut = (RestTemplate) CommonBeanFactory.getBean("restTemplateWithTimeOut");
|
||||||
// todo 初始化操作
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,7 +59,6 @@ public class DockerTestEngine extends AbstractEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runTest(TestResource resource, long realThreadNum, int resourceIndex) {
|
private void runTest(TestResource resource, long realThreadNum, int resourceIndex) {
|
||||||
// todo 运行测试
|
|
||||||
EngineContext context = null;
|
EngineContext context = null;
|
||||||
try {
|
try {
|
||||||
context = EngineFactory.createContext(loadTest, resource.getId(), realThreadNum, this.getStartTime(), this.getReportId(), resourceIndex);
|
context = EngineFactory.createContext(loadTest, resource.getId(), realThreadNum, this.getStartTime(), this.getReportId(), resourceIndex);
|
||||||
|
@ -99,7 +97,6 @@ public class DockerTestEngine extends AbstractEngine {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
// TODO 停止运行测试
|
|
||||||
String testId = loadTest.getId();
|
String testId = loadTest.getId();
|
||||||
this.resourceList.forEach(r -> {
|
this.resourceList.forEach(r -> {
|
||||||
NodeDTO node = JSON.parseObject(r.getConfiguration(), NodeDTO.class);
|
NodeDTO node = JSON.parseObject(r.getConfiguration(), NodeDTO.class);
|
||||||
|
|
|
@ -20,8 +20,6 @@ import io.metersphere.dto.ScheduleDao;
|
||||||
import io.metersphere.i18n.Translator;
|
import io.metersphere.i18n.Translator;
|
||||||
import io.metersphere.job.sechedule.PerformanceTestJob;
|
import io.metersphere.job.sechedule.PerformanceTestJob;
|
||||||
import io.metersphere.notice.domain.NoticeDetail;
|
import io.metersphere.notice.domain.NoticeDetail;
|
||||||
import io.metersphere.notice.service.MailService;
|
|
||||||
import io.metersphere.notice.service.NoticeService;
|
|
||||||
import io.metersphere.performance.engine.Engine;
|
import io.metersphere.performance.engine.Engine;
|
||||||
import io.metersphere.performance.engine.EngineFactory;
|
import io.metersphere.performance.engine.EngineFactory;
|
||||||
import io.metersphere.performance.notice.PerformanceNoticeTask;
|
import io.metersphere.performance.notice.PerformanceNoticeTask;
|
||||||
|
@ -78,10 +76,6 @@ public class PerformanceTestService {
|
||||||
@Resource
|
@Resource
|
||||||
private TestCaseService testCaseService;
|
private TestCaseService testCaseService;
|
||||||
@Resource
|
@Resource
|
||||||
private NoticeService noticeService;
|
|
||||||
@Resource
|
|
||||||
private MailService mailService;
|
|
||||||
@Resource
|
|
||||||
private PerformanceNoticeTask performanceNoticeTask;
|
private PerformanceNoticeTask performanceNoticeTask;
|
||||||
|
|
||||||
public List<LoadTestDTO> list(QueryTestPlanRequest request) {
|
public List<LoadTestDTO> list(QueryTestPlanRequest request) {
|
||||||
|
@ -281,7 +275,6 @@ public class PerformanceTestService {
|
||||||
testReport.setUserId(SessionUtils.getUser().getId());
|
testReport.setUserId(SessionUtils.getUser().getId());
|
||||||
}
|
}
|
||||||
// 启动测试
|
// 启动测试
|
||||||
List<NoticeDetail> noticeList = null;
|
|
||||||
try {
|
try {
|
||||||
engine.start();
|
engine.start();
|
||||||
// 启动正常修改状态 starting
|
// 启动正常修改状态 starting
|
||||||
|
@ -307,6 +300,9 @@ public class PerformanceTestService {
|
||||||
reportResult.setReportValue("Ready"); // 初始化一个 result_status, 这个值用在data-streaming中
|
reportResult.setReportValue("Ready"); // 初始化一个 result_status, 这个值用在data-streaming中
|
||||||
loadTestReportResultMapper.insertSelective(reportResult);
|
loadTestReportResultMapper.insertSelective(reportResult);
|
||||||
} catch (MSException e) {
|
} catch (MSException e) {
|
||||||
|
// 启动失败之后清理任务
|
||||||
|
engine.stop();
|
||||||
|
|
||||||
LogUtil.error(e);
|
LogUtil.error(e);
|
||||||
loadTest.setStatus(PerformanceTestStatus.Error.name());
|
loadTest.setStatus(PerformanceTestStatus.Error.name());
|
||||||
loadTest.setDescription(e.getMessage());
|
loadTest.setDescription(e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue