mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-25 07:12:17 +08:00
Run and compare benchmarks after successful ci-build
This commit is contained in:
parent
36af486303
commit
9ae4be8184
@ -7,3 +7,5 @@ env:
|
|||||||
go: [1.12.x, 1.13.x]
|
go: [1.12.x, 1.13.x]
|
||||||
services:
|
services:
|
||||||
- redis-server
|
- redis-server
|
||||||
|
after_success:
|
||||||
|
- bash ./.travis/benchcmp.sh
|
||||||
|
15
.travis/benchcmp.sh
Executable file
15
.travis/benchcmp.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
if [ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ]; then
|
||||||
|
REMOTE_URL="$(git config --get remote.origin.url)";
|
||||||
|
cd ${TRAVIS_BUILD_DIR}/.. && \
|
||||||
|
git clone ${REMOTE_URL} "${TRAVIS_REPO_SLUG}-bench" && \
|
||||||
|
cd "${TRAVIS_REPO_SLUG}-bench" && \
|
||||||
|
# Benchmark master
|
||||||
|
git checkout master && \
|
||||||
|
go test -run=XXX -bench=. ./... > master.txt && \
|
||||||
|
# Benchmark feature branch
|
||||||
|
git checkout ${TRAVIS_COMMIT} && \
|
||||||
|
go test -run=XXX -bench=. ./... > feature.txt && \
|
||||||
|
go get -u golang.org/x/tools/cmd/benchcmp && \
|
||||||
|
# compare two benchmarks
|
||||||
|
benchcmp master.txt feature.txt;
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user