add "scenarios" top level element

pull/24590/head
Jan Tattermusch 4 years ago
parent 4dfd34f002
commit 8b775834d6
  1. 5
      tools/run_tests/performance/scenario_config_exporter.py

@ -15,6 +15,8 @@
# limitations under the License.
# Helper script to extract JSON scenario definitions from scenario_config.py
# Useful to construct "ScenariosJSON" configuration accepted by the OSS benchmarks framework
# See https://github.com/grpc/test-infra/blob/master/config/samples/cxx_example_loadtest.yaml
import json
import re
@ -47,7 +49,8 @@ def dump_to_json_files(json_scenarios, filename_prefix='scenario_dump_'):
filename = "%s%s.json" % (filename_prefix, scenario['name'])
print('Writing file %s' % filename, file=sys.stderr)
with open(filename, 'w') as outfile:
json.dump(scenario, outfile, indent=2)
# the dump file should have {"scenarios" : []} as the top level element
json.dump({'scenarios': [scenario]}, outfile, indent=2)
if __name__ == "__main__":

Loading…
Cancel
Save