启动测试
This commit is contained in:
parent
d6f285a1d4
commit
792cb2bfe8
|
@ -1,11 +1,15 @@
|
||||||
package io.metersphere.controller.request;
|
package io.metersphere.controller.request;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class TestRequest {
|
public class TestRequest {
|
||||||
|
|
||||||
private int size;
|
private int size;
|
||||||
private String fileString;
|
private String fileString;
|
||||||
private String testId;
|
private String testId;
|
||||||
private String image;
|
private String image;
|
||||||
|
private Map<String, String> testData = new HashMap<>();
|
||||||
|
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return size;
|
return size;
|
||||||
|
@ -38,4 +42,12 @@ public class TestRequest {
|
||||||
public void setImage(String image) {
|
public void setImage(String image) {
|
||||||
this.image = image;
|
this.image = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getTestData() {
|
||||||
|
return testData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestData(Map<String, String> testData) {
|
||||||
|
this.testData = testData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public abstract class AbstractEngine implements Engine {
|
||||||
if (resourcePool == null) {
|
if (resourcePool == null) {
|
||||||
MSException.throwException("Resource Pool is empty");
|
MSException.throwException("Resource Pool is empty");
|
||||||
}
|
}
|
||||||
if (!ResourcePoolTypeEnum.K8S.name().equals(resourcePool.getType())) {
|
if (!ResourcePoolTypeEnum.K8S.name().equals(resourcePool.getType()) && !ResourcePoolTypeEnum.NODE.name().equals(resourcePool.getType())) {
|
||||||
MSException.throwException("Invalid Resource Pool type.");
|
MSException.throwException("Invalid Resource Pool type.");
|
||||||
}
|
}
|
||||||
this.resourceList = testResourceService.getResourcesByPoolId(resourcePool.getId());
|
this.resourceList = testResourceService.getResourcesByPoolId(resourcePool.getId());
|
||||||
|
|
|
@ -84,6 +84,7 @@ public class DockerTestEngine extends AbstractEngine {
|
||||||
testRequest.setTestId(testId);
|
testRequest.setTestId(testId);
|
||||||
testRequest.setFileString(content);
|
testRequest.setFileString(content);
|
||||||
testRequest.setImage(registryService.getRegistry() + JMETER_IMAGE);
|
testRequest.setImage(registryService.getRegistry() + JMETER_IMAGE);
|
||||||
|
testRequest.setTestData(context.getTestData());
|
||||||
|
|
||||||
// todo 判断测试状态
|
// todo 判断测试状态
|
||||||
String taskStatusUri = String.format(BASE_URL + "/jmeter/task/status/" + testId, nodeIp, port);
|
String taskStatusUri = String.format(BASE_URL + "/jmeter/task/status/" + testId, nodeIp, port);
|
||||||
|
|
Loading…
Reference in New Issue