aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/run_microbenchmark.py
diff options
context:
space:
mode:
authorGravatar Matt Kwong <mattkwong@google.com>2017-03-09 15:08:01 -0800
committerGravatar Matt Kwong <mattkwong@google.com>2017-03-16 17:04:33 -0700
commitaff1c05ed78e52f41c8b1e7c03b3c57f08368130 (patch)
tree854974c3366ba2239253f431d9a05940252ac1f5 /tools/run_tests/run_microbenchmark.py
parent4166dc3536986c5295131a6e7c5920baaae487b3 (diff)
Make Jenkins post microbenchmarking diff in a comment
Diffstat (limited to 'tools/run_tests/run_microbenchmark.py')
-rwxr-xr-xtools/run_tests/run_microbenchmark.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py
index 57b2636e56..12d98158a0 100755
--- a/tools/run_tests/run_microbenchmark.py
+++ b/tools/run_tests/run_microbenchmark.py
@@ -229,6 +229,8 @@ argp.add_argument('--summary_time',
type=int,
help='Minimum time to run benchmarks for the summary collection')
args = argp.parse_args()
+if args.diff_perf:
+ git_comment = ''
try:
for collect in args.collect:
@@ -262,7 +264,14 @@ try:
if diff:
heading('Performance diff: %s' % bm_name)
text(diff)
+ git_comment += '```\\nPerformance diff: %s\\n%s\\n```\\n' % (bm_name, diff.replace('\n', '\\n'))
finally:
+ if args.diff_perf:
+ subprocess.call(['tools/jenkins/comment_on_pr.sh "%s"' % git_comment.replace('`', '\`')],
+ stdout=subprocess.PIPE,
+ shell=True)
+ if not os.path.exists('reports'):
+ os.makedirs('reports')
index_html += "</body>\n</html>\n"
with open('reports/index.html', 'w') as f:
f.write(index_html)