test status

This commit is contained in:
Captain.B 2020-03-19 13:54:59 +08:00
parent ed3186caf8
commit f0dcf4e364
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,5 @@
package io.metersphere.commons.constants;
public enum TestStatus {
Running, Completed
}

View File

@ -7,6 +7,7 @@ import io.metersphere.base.mapper.LoadTestFileMapper;
import io.metersphere.base.mapper.LoadTestMapper; import io.metersphere.base.mapper.LoadTestMapper;
import io.metersphere.base.mapper.ext.ExtLoadTestMapper; import io.metersphere.base.mapper.ext.ExtLoadTestMapper;
import io.metersphere.commons.constants.EngineType; import io.metersphere.commons.constants.EngineType;
import io.metersphere.commons.constants.TestStatus;
import io.metersphere.commons.exception.MSException; import io.metersphere.commons.exception.MSException;
import io.metersphere.commons.utils.LogUtil; import io.metersphere.commons.utils.LogUtil;
import io.metersphere.controller.request.testplan.*; import io.metersphere.controller.request.testplan.*;
@ -179,7 +180,9 @@ public class LoadTestService {
} }
engine.start(); engine.start();
// 标记running状态
loadTest.setStatus(TestStatus.Running.name());
loadTestMapper.updateByPrimaryKeySelective(loadTest);
// todo通过调用stop方法能够停止正在运行的engine但是如果部署了多个backend实例页面发送的停止请求如何定位到具体的engine // todo通过调用stop方法能够停止正在运行的engine但是如果部署了多个backend实例页面发送的停止请求如何定位到具体的engine
} }