Skip to content

Commit

Permalink
适配HuiLuChongFa
Browse files Browse the repository at this point in the history
  • Loading branch information
zengln committed Sep 1, 2021
1 parent dafec9a commit 0f466e7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Jmeter2Blade/adapter/znlyAdapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def deal_csv_threadgroup(root):

if sub_element.tag == "BeanShellPreProcessor":
script = sub_element.element.find(".//stringProp[@name='script']").text
logger.debug(re.findall(r'new FileInputStream\(vars.get\("(.*?)"\)\);', script))
csv_file = re.findall(r'new FileInputStream\(vars.get\("(.*?)"\)\);', script)[0]
csv_file_path = arguments_local.get(csv_file)
csv_file_name = os.path.split(csv_file_path)[-1]
Expand Down Expand Up @@ -492,14 +493,18 @@ def deal_threadgroup(root, node_path):
elif sub_element.tag == "HTTPSamplerProxy" and "正例" in sub_element.get("testname"):
thread_group_cases = True
break
elif sub_element.tag == "CounterConfig":
# 有计数器,也是一种读取csv的情况
csv_flag = True
break

if csv_flag:
for sub_element in sub_elements:
if not sub_element.isEnabled():
continue

if sub_element.tag == "IfController":
root = sub_element
# if sub_element.tag == "IfController":
# root = sub_element

cases = deal_csv_threadgroup(root)
for case in cases:
Expand Down Expand Up @@ -561,7 +566,7 @@ def deal_threadgroup(root, node_path):

# 本地数据库名称与blade数据库名称映射
data_sources = {
"HS0001": "smart_route_jmeter_oracle"
"bupps": "smart_route_jmeter_oracle"
}

check_msg_head = "bupps_resp_head_"
Expand All @@ -574,7 +579,7 @@ def deal_threadgroup(root, node_path):

JMX_DIR = Path(__file__).resolve().parent.parent

file_path = JMX_DIR / "file/智能路由/Auto-HeXinDuiZhang.jmx"
file_path = JMX_DIR / "file/智能路由/Auto-HuiLuChongFa.jmx"

# 读取xml文件
tree = ET.parse(file_path)
Expand Down

0 comments on commit 0f466e7

Please sign in to comment.