[experiments] Make output more diffable/readable (#30807)

* [experiments] Make output more diffable/readable

* Automated change: Fix sanity tests

* buildifier sized indentations

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/30626/head
Craig Tiller 2 years ago committed by GitHub
parent e8685fc8d2
commit f4202cefbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      bazel/experiments.bzl
  2. 14
      tools/codegen/core/gen_experiments.py

@ -15,4 +15,12 @@
# Automatically generated by tools/codegen/core/gen_experiments.py
"""Dictionary of tags to experiments so we know when to test different experiments."""
EXPERIMENTS = {"endpoint_test": ["tcp_frame_size_tuning"], "core_end2end_test": ["tcp_frame_size_tuning"]}
EXPERIMENTS = {
"core_end2end_test": [
"tcp_frame_size_tuning",
],
"endpoint_test": [
"tcp_frame_size_tuning",
],
}

@ -91,7 +91,10 @@ def snake_to_pascal(s):
def put_banner(files, banner, prefix):
for f in files:
for line in banner:
print('%s %s' % (prefix, line), file=f)
if not line:
print(prefix, file=f)
else:
print('%s %s' % (prefix, line), file=f)
print(file=f)
@ -215,4 +218,11 @@ with open('bazel/experiments.bzl', 'w') as B:
"\"\"\"Dictionary of tags to experiments so we know when to test different experiments.\"\"\"",
file=B)
print("EXPERIMENTS=%r" % dict(tags_to_experiments), file=B)
print(file=B)
print("EXPERIMENTS = {", file=B)
for tag, experiments in sorted(tags_to_experiments.items()):
print(" \"%s\": [" % tag, file=B)
for experiment in sorted(experiments):
print(" \"%s\"," % experiment, file=B)
print(" ],", file=B)
print("}", file=B)

Loading…
Cancel
Save