fix(接口测试): 接口用例转性能测试时修改取样器的testName

--bug=1011595 --user=宋天阳 [性能测试]github
#11743单接口用例转换为性能测试用例时,请求统计中的用例名称建议显示为原单接口用例名称,请修改
https://www.tapd.cn/55049933/s/1128591
This commit is contained in:
song-tianyang 2022-04-01 11:24:02 +08:00 committed by 刘瑞斌
parent 850c1665d0
commit d18b3eaf3a
6 changed files with 13 additions and 0 deletions

View File

@ -65,6 +65,10 @@ public class ParameterConfig extends MsParameter {
* 是否是导入/导出操作
*/
private boolean isOperating;
/**
* 导入/导出操作时取样器的testname值
*/
private String operatingSampleTestName;
/**
* 项目ID支持单接口执行
*/

View File

@ -83,6 +83,8 @@ public class MsDubboSampler extends MsTestElement {
// 非导出操作且不是启用状态则跳过执行
if (!config.isOperating() && !this.isEnable()) {
return;
}else if(config.isOperating() && StringUtils.isNotEmpty(config.getOperatingSampleTestName())){
this.setName(config.getOperatingSampleTestName());
}
if (this.getReferenced() != null && "Deleted".equals(this.getReferenced())) {
return;

View File

@ -134,6 +134,8 @@ public class MsHTTPSamplerProxy extends MsTestElement {
// 非导出操作且不是启用状态则跳过执行Ms
if (!config.isOperating() && !this.isEnable()) {
return;
}else if(config.isOperating() && StringUtils.isNotEmpty(config.getOperatingSampleTestName())){
this.setName(config.getOperatingSampleTestName());
}
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
boolean ref = this.setRefElement();

View File

@ -83,6 +83,8 @@ public class MsJDBCSampler extends MsTestElement {
// 非导出操作且不是启用状态则跳过执行
if (config != null && !config.isOperating() && !this.isEnable()) {
return;
}else if(config.isOperating() && StringUtils.isNotEmpty(config.getOperatingSampleTestName())){
this.setName(config.getOperatingSampleTestName());
}
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
boolean ref = this.setRefElement();

View File

@ -121,6 +121,8 @@ public class MsTCPSampler extends MsTestElement {
// 非导出操作且不是启用状态则跳过执行
if (!config.isOperating() && !this.isEnable()) {
return;
}else if(config.isOperating() && StringUtils.isNotEmpty(config.getOperatingSampleTestName())){
this.setName(config.getOperatingSampleTestName());
}
if (this.getReferenced() != null && MsTestElementConstants.REF.name().equals(this.getReferenced())) {
boolean ref = this.setRefElement();

View File

@ -615,6 +615,7 @@ public class APITestService {
ParameterConfig config = new ParameterConfig();
config.setProjectId(runRequest.getProjectId());
config.setOperating(true);
config.setOperatingSampleTestName(runRequest.getName());
Map<String, EnvironmentConfig> envConfig = new HashMap<>();
Map<String, String> map = runRequest.getEnvironmentMap();