used names instead of numbers for each scenario

pull/16402/head
Bill Feng 6 years ago
parent 21824afb09
commit 0ce7f91d9e
  1. 8
      test/cpp/qps/json_run_localhost_scenario_gen.py
  2. 2
      test/cpp/qps/json_run_localhost_scenarios.bzl
  3. 12
      test/cpp/qps/qps_benchmark_script.bzl
  4. 10
      test/cpp/qps/qps_json_driver_scenario_gen.py
  5. 2
      test/cpp/qps/qps_json_driver_scenarios.bzl
  6. 0
      tools/buildgen/generate_build_additions.sh

@ -27,11 +27,11 @@ def generate_args():
if 'args' in item and len(item['args']) > 2]
deserialized_scenarios = [json.loads(item)['scenarios'][0] \
for item in json_run_localhost_arg_set]
all_scenarios = [{'scenarios' : [scenario]} \
for scenario in deserialized_scenarios]
all_scenarios = {scenario['name'].encode('ascii', 'ignore'): \
'\'{\'scenarios\' : [' + json.dumps(scenario) + ']}\'' \
for scenario in deserialized_scenarios}
serialized_scenarios_str = str(['\'' + json.dumps(scenario) + '\'' \
for scenario in all_scenarios])
serialized_scenarios_str = str(all_scenarios).encode('ascii', 'ignore')
with open('json_run_localhost_scenarios.bzl', 'wb') as f:
f.write('JSON_RUN_LOCALHOST_SCENARIOS = ' + serialized_scenarios_str + '\n')

File diff suppressed because one or more lines are too long

@ -28,15 +28,14 @@ load("//test/cpp/qps:qps_json_driver_scenarios.bzl", "QPS_JSON_DRIVER_SCENARIOS"
load("//test/cpp/qps:json_run_localhost_scenarios.bzl", "JSON_RUN_LOCALHOST_SCENARIOS")
def qps_json_driver_batch():
idx = 0 # number for differentiating names
for scenario in QPS_JSON_DRIVER_SCENARIOS:
grpc_cc_test(
name = "qps_json_driver_test_%s" % str(idx),
name = "qps_json_driver_test_%s" % scenario,
srcs = ["qps_json_driver.cc"],
args = [
"--run_inproc",
"--scenarios_json",
scenario,
QPS_JSON_DRIVER_SCENARIOS[scenario],
],
external_deps = [
"gflags",
@ -49,17 +48,15 @@ def qps_json_driver_batch():
"//test/cpp/util:test_util",
],
)
idx += 1
def json_run_localhost_batch():
idx = 0 # number for differentiating names
for scenario in JSON_RUN_LOCALHOST_SCENARIOS:
grpc_cc_test(
name = "json_run_localhost_%s" % str(idx),
name = "json_run_localhost_%s" % scenario,
srcs = ["json_run_localhost.cc"],
args = [
"--scenarios_json",
scenario,
JSON_RUN_LOCALHOST_SCENARIOS[scenario],
],
data = [
"//test/cpp/qps:qps_json_driver",
@ -73,4 +70,3 @@ def json_run_localhost_batch():
"//test/cpp/util:test_util",
],
)
idx += 1

@ -27,12 +27,12 @@ def generate_args():
if 'args' in item and len(item['args']) > 2]
deserialized_scenarios = [json.loads(item)['scenarios'][0] \
for item in qps_json_driver_arg_set]
all_scenarios = [{'scenarios' : [scenario]} \
for scenario in deserialized_scenarios]
all_scenarios = {scenario['name'].encode('ascii', 'ignore'): \
'\'{\'scenarios\' : [' + json.dumps(scenario) + ']}\'' \
for scenario in deserialized_scenarios}
serialized_scenarios_str = str(['\'' + json.dumps(scenario) + '\'' \
for scenario in all_scenarios])
with open('qps_json_driver_scenarios.bzl', 'wb') as f:
serialized_scenarios_str = str(all_scenarios).encode('ascii', 'ignore')
with open('qps_json_driver_scenarios.bzl', 'w') as f:
f.write('QPS_JSON_DRIVER_SCENARIOS = ' + serialized_scenarios_str + '\n')
generate_args()

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save