Commit a0396e26 authored by Yong Tang's avatar Yong Tang Committed by GitHub

Add benchmark result to GitHub PR (#2123)

* Add benchmark result to GitHub PR
Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Post benchmark to comments
Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Test Stuff
Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Update using jq.
Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Update
Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 8d4378d7
#!/usr/bin/env bash
set -e +o pipefail
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
echo -e "NOTE: The CPU benchmarks are performed on Travis VMs and vary widly between runs," > .benchmark.body
echo -e " you can't trust them. The memory benchmarks are OK\n\n" >> .benchmark.body
cat .benchmark.log >> .benchmark.body
jq -n --arg body "$(cat .benchmark.body)" '{body: $body}' > .benchmark.json
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
--data-binary "@.benchmark.json" \
"https://api.github.com/repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments"
fi
...@@ -46,3 +46,4 @@ script: ...@@ -46,3 +46,4 @@ script:
after_success: after_success:
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)
- bash .benchmark.sh
...@@ -72,7 +72,7 @@ ifeq ($(TEST_TYPE),benchmark) ...@@ -72,7 +72,7 @@ ifeq ($(TEST_TYPE),benchmark)
( cd request; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old ( cd request; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
( cd core; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old ( cd core; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
( cd coremain; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old ( cd coremain; go test -run=NONE -bench=. -benchmem=true -tags 'etcd' ./... ) >> old
if command -v benchcmp; then benchcmp old new ; fi if command -v benchcmp; then benchcmp old new > .benchmark.log ; cat .benchmark.log ; fi
git checkout - git checkout -
endif endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment