fix(接口测试): 修复jmx导入平台转成性能测试没有生成jmx的缺陷
--bug=1025157 --user=王孝刚 [性能测试]chrome插件录制的jmx导入接口自动化再转性能测试用例没有加载场景文件 https://www.tapd.cn/55049933/s/1359698
This commit is contained in:
parent
a1ef3f575b
commit
ef1254c76d
|
@ -872,21 +872,7 @@ public class ApiScenarioService {
|
||||||
Map<String, String> envMap = environmentGroupProjectService.getEnvMap(environmentGroupId);
|
Map<String, String> envMap = environmentGroupProjectService.getEnvMap(environmentGroupId);
|
||||||
scenario.setEnvironmentMap(envMap);
|
scenario.setEnvironmentMap(envMap);
|
||||||
}
|
}
|
||||||
// 针对导入的jmx 处理
|
|
||||||
boolean isUseElement = false;
|
|
||||||
if (CollectionUtils.isNotEmpty(scenario.getHashTree())) {
|
|
||||||
for (MsTestElement testElement : scenario.getHashTree()) {
|
|
||||||
if (testElement instanceof MsJmeterElement) {
|
|
||||||
isUseElement = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isUseElement) {
|
|
||||||
scenario.toHashTree(jmeterHashTree, scenario.getHashTree(), config);
|
|
||||||
ElementUtil.accuracyHashTree(jmeterHashTree);
|
|
||||||
repositoryMetadata = ApiFileUtil.getRepositoryFileMetadata(jmeterHashTree);
|
|
||||||
jmx = scenario.getJmx(jmeterHashTree);
|
|
||||||
} else {
|
|
||||||
MsThreadGroup group = new MsThreadGroup();
|
MsThreadGroup group = new MsThreadGroup();
|
||||||
group.setLabel(apiScenario.getName());
|
group.setLabel(apiScenario.getName());
|
||||||
group.setName(apiScenario.getName());
|
group.setName(apiScenario.getName());
|
||||||
|
@ -899,7 +885,6 @@ public class ApiScenarioService {
|
||||||
testPlan.toHashTree(jmeterHashTree, testPlan.getHashTree(), config);
|
testPlan.toHashTree(jmeterHashTree, testPlan.getHashTree(), config);
|
||||||
repositoryMetadata = ApiFileUtil.getRepositoryFileMetadata(jmeterHashTree);
|
repositoryMetadata = ApiFileUtil.getRepositoryFileMetadata(jmeterHashTree);
|
||||||
jmx = testPlan.getJmx(jmeterHashTree);
|
jmx = testPlan.getJmx(jmeterHashTree);
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LogUtil.error(ex);
|
LogUtil.error(ex);
|
||||||
|
|
Loading…
Reference in New Issue