fix (接口自动化): 修复SQL请求引用步骤执行问题
--bug=1007360 --user=赵勇 【github #6716】[BUG]sql类型的后置内容修改,在场景直接引用接口的情况下是正确的,当引用了这个sql用例的场景被再次引用时,对sql用例的后置脚本修改显示是修改后的,但是执行的时候还是执行的之前的脚本内容 https://www.tapd.cn/55049933/s/1057910
This commit is contained in:
parent
6b4d42ee23
commit
a7e6aa4c9d
|
@ -90,6 +90,7 @@ public class MsDubboSampler extends MsTestElement {
|
||||||
}
|
}
|
||||||
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
||||||
this.setRefElement();
|
this.setRefElement();
|
||||||
|
hashTree = this.getHashTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
final HashTree testPlanTree = tree.add(dubboSample(config));
|
final HashTree testPlanTree = tree.add(dubboSample(config));
|
||||||
|
|
|
@ -9,8 +9,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import io.metersphere.api.dto.definition.request.ElementUtil;
|
import io.metersphere.api.dto.definition.request.ElementUtil;
|
||||||
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
||||||
import io.metersphere.api.dto.definition.request.processors.post.MsJSR223PostProcessor;
|
|
||||||
import io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor;
|
|
||||||
import io.metersphere.api.dto.scenario.DatabaseConfig;
|
import io.metersphere.api.dto.scenario.DatabaseConfig;
|
||||||
import io.metersphere.api.dto.scenario.KeyValue;
|
import io.metersphere.api.dto.scenario.KeyValue;
|
||||||
import io.metersphere.api.dto.scenario.environment.EnvironmentConfig;
|
import io.metersphere.api.dto.scenario.environment.EnvironmentConfig;
|
||||||
|
@ -86,6 +84,7 @@ public class MsJDBCSampler extends MsTestElement {
|
||||||
}
|
}
|
||||||
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
||||||
this.setRefElement();
|
this.setRefElement();
|
||||||
|
hashTree = this.getHashTree();
|
||||||
}
|
}
|
||||||
if (config.getConfig() == null) {
|
if (config.getConfig() == null) {
|
||||||
// 单独接口执行
|
// 单独接口执行
|
||||||
|
@ -123,9 +122,9 @@ public class MsJDBCSampler extends MsTestElement {
|
||||||
this.dataSource = null;
|
this.dataSource = null;
|
||||||
// 取当前环境下默认的一个数据源
|
// 取当前环境下默认的一个数据源
|
||||||
if (config.isEffective(this.getProjectId())) {
|
if (config.isEffective(this.getProjectId())) {
|
||||||
if(config.getConfig().get(this.getProjectId()) != null){
|
if (config.getConfig().get(this.getProjectId()) != null) {
|
||||||
envConfig = config.getConfig().get(this.getProjectId());
|
envConfig = config.getConfig().get(this.getProjectId());
|
||||||
if(CollectionUtils.isNotEmpty(envConfig.getDatabaseConfigs())){
|
if (CollectionUtils.isNotEmpty(envConfig.getDatabaseConfigs())) {
|
||||||
this.dataSource = envConfig.getDatabaseConfigs().get(0);
|
this.dataSource = envConfig.getDatabaseConfigs().get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import io.metersphere.api.dto.automation.EsbDataStruct;
|
||||||
import io.metersphere.api.dto.automation.TcpTreeTableDataStruct;
|
import io.metersphere.api.dto.automation.TcpTreeTableDataStruct;
|
||||||
import io.metersphere.api.dto.definition.request.ElementUtil;
|
import io.metersphere.api.dto.definition.request.ElementUtil;
|
||||||
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
import io.metersphere.api.dto.definition.request.ParameterConfig;
|
||||||
import io.metersphere.api.dto.definition.request.processors.post.MsJSR223PostProcessor;
|
|
||||||
import io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor;
|
import io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor;
|
||||||
import io.metersphere.api.dto.scenario.KeyValue;
|
import io.metersphere.api.dto.scenario.KeyValue;
|
||||||
import io.metersphere.api.dto.scenario.environment.EnvironmentConfig;
|
import io.metersphere.api.dto.scenario.environment.EnvironmentConfig;
|
||||||
|
@ -122,6 +121,7 @@ public class MsTCPSampler extends MsTestElement {
|
||||||
}
|
}
|
||||||
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
|
||||||
this.setRefElement();
|
this.setRefElement();
|
||||||
|
hashTree = this.getHashTree();
|
||||||
}
|
}
|
||||||
if (config.getConfig() == null) {
|
if (config.getConfig() == null) {
|
||||||
// 单独接口执行
|
// 单独接口执行
|
||||||
|
|
|
@ -355,7 +355,7 @@ public class ApiAutomationService {
|
||||||
scenario.setVersion(version + 1);
|
scenario.setVersion(version + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteUpdateBodyFile(scenario);
|
deleteUpdateBodyFile(scenario,beforeScenario);
|
||||||
List<ApiMethodUrlDTO> useUrl = this.parseUrl(scenario);
|
List<ApiMethodUrlDTO> useUrl = this.parseUrl(scenario);
|
||||||
scenario.setUseUrl(JSONArray.toJSONString(useUrl));
|
scenario.setUseUrl(JSONArray.toJSONString(useUrl));
|
||||||
apiScenarioMapper.updateByPrimaryKeySelective(scenario);
|
apiScenarioMapper.updateByPrimaryKeySelective(scenario);
|
||||||
|
@ -376,8 +376,7 @@ public class ApiAutomationService {
|
||||||
*
|
*
|
||||||
* @param scenario
|
* @param scenario
|
||||||
*/
|
*/
|
||||||
public void deleteUpdateBodyFile(ApiScenarioWithBLOBs scenario) {
|
public void deleteUpdateBodyFile(ApiScenarioWithBLOBs scenario,ApiScenarioWithBLOBs oldScenario) {
|
||||||
ApiScenarioWithBLOBs oldScenario = apiScenarioMapper.selectByPrimaryKey(scenario.getId());
|
|
||||||
Set<String> newRequestIds = getRequestIds(scenario.getScenarioDefinition());
|
Set<String> newRequestIds = getRequestIds(scenario.getScenarioDefinition());
|
||||||
MsTestElement msTestElement = parseScenarioDefinition(oldScenario.getScenarioDefinition());
|
MsTestElement msTestElement = parseScenarioDefinition(oldScenario.getScenarioDefinition());
|
||||||
List<MsHTTPSamplerProxy> oldRequests = MsHTTPSamplerProxy.findHttpSampleFromHashTree(msTestElement);
|
List<MsHTTPSamplerProxy> oldRequests = MsHTTPSamplerProxy.findHttpSampleFromHashTree(msTestElement);
|
||||||
|
|
Loading…
Reference in New Issue