improve circleci config
- update docker machine version to 0.9.0 - save coverage.txt as artifact - save docker logs as artifact - test if coverage.txt exists - 2>&1 redirect stderr to stdout in tests
This commit is contained in:
parent
1bf5ae9c8d
commit
d5d7286cb6
6
Makefile
6
Makefile
|
@ -22,11 +22,11 @@ dist:
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@echo "--> Running go test"
|
@echo "--> Running go test"
|
||||||
@go test $(PACKAGES)
|
@go test -v $(PACKAGES)
|
||||||
|
|
||||||
test_race:
|
test_race:
|
||||||
@echo "--> Running go test --race"
|
@echo "--> Running go test --race"
|
||||||
@go test -race $(PACKAGES)
|
@go test -v -race $(PACKAGES)
|
||||||
|
|
||||||
test_integrations:
|
test_integrations:
|
||||||
@bash ./test/test.sh
|
@bash ./test/test.sh
|
||||||
|
@ -48,7 +48,7 @@ get_deps:
|
||||||
@go get -d $(PACKAGES)
|
@go get -d $(PACKAGES)
|
||||||
@go list -f '{{join .TestImports "\n"}}' ./... | \
|
@go list -f '{{join .TestImports "\n"}}' ./... | \
|
||||||
grep -v /vendor/ | sort | uniq | \
|
grep -v /vendor/ | sort | uniq | \
|
||||||
xargs go get
|
xargs go get -d
|
||||||
|
|
||||||
get_vendor_deps: tools
|
get_vendor_deps: tools
|
||||||
@rm -rf vendor/
|
@rm -rf vendor/
|
||||||
|
|
33
circle.yml
33
circle.yml
|
@ -1,38 +1,33 @@
|
||||||
|
---
|
||||||
machine:
|
machine:
|
||||||
environment:
|
environment:
|
||||||
MACH_PREFIX: tendermint-test-mach
|
MACH_PREFIX: tendermint-test-mach
|
||||||
GOPATH: /home/ubuntu/.go_workspace
|
|
||||||
REPO: $GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
|
|
||||||
DOCKER_VERSION: 1.10.0
|
DOCKER_VERSION: 1.10.0
|
||||||
DOCKER_MACHINE_VERSION: 0.6.0
|
DOCKER_MACHINE_VERSION: 0.9.0
|
||||||
|
GOPATH: "$HOME/.go_project"
|
||||||
|
PROJECT_PARENT_PATH: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME"
|
||||||
|
PROJECT_PATH: "$PROJECT_PARENT_PATH/$CIRCLE_PROJECT_REPONAME"
|
||||||
hosts:
|
hosts:
|
||||||
circlehost: 127.0.0.1
|
|
||||||
localhost: 127.0.0.1
|
localhost: 127.0.0.1
|
||||||
|
|
||||||
checkout:
|
|
||||||
post:
|
|
||||||
- rm -rf $REPO
|
|
||||||
- mkdir -p $HOME/.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME
|
|
||||||
- mv $HOME/$CIRCLE_PROJECT_REPONAME $REPO
|
|
||||||
# - git submodule sync
|
|
||||||
# - git submodule update --init # use submodules
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
override:
|
override:
|
||||||
- echo $MACH_PREFIX $GOPATH $REPO $DOCKER_VERSION $DOCKER_MACHINE_VERSION
|
|
||||||
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | sudo bash -s -- $DOCKER_VERSION
|
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | sudo bash -s -- $DOCKER_VERSION
|
||||||
- sudo curl -sSL -o /usr/bin/docker-machine https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine-linux-x86_64; sudo chmod 0755 /usr/bin/docker-machine
|
|
||||||
- sudo start docker
|
- sudo start docker
|
||||||
|
- sudo curl -sSL -o /usr/bin/docker-machine "https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine-`uname -s`-`uname -m`"; sudo chmod 0755 /usr/bin/docker-machine
|
||||||
|
- mkdir -p "$PROJECT_PARENT_PATH"
|
||||||
|
- ln -sf "$HOME/$CIRCLE_PROJECT_REPONAME/" "$PROJECT_PATH"
|
||||||
|
post:
|
||||||
- go version
|
- go version
|
||||||
- docker version
|
- docker version
|
||||||
- docker-machine version
|
- docker-machine version
|
||||||
|
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- "cd $REPO && set -o pipefail && make test_integrations | tee ~/test_integrations.log":
|
- cd "$PROJECT_PATH" && set -o pipefail && make test_integrations 2>&1 | tee test_integrations.log:
|
||||||
timeout: 1800
|
timeout: 1800
|
||||||
- "cp ~/test_integrations.log $CIRCLE_ARTIFACTS"
|
|
||||||
post:
|
post:
|
||||||
- "cd $REPO && bash <(curl -s https://codecov.io/bash)"
|
- cd "$PROJECT_PATH" && mv test_integrations.log "${CIRCLE_ARTIFACTS}"
|
||||||
|
- cd "$PROJECT_PATH" && bash <(curl -s https://codecov.io/bash) -f coverage.txt
|
||||||
|
- cd "$PROJECT_PATH" && [[ -f coverage.txt ]] && mv coverage.txt "${CIRCLE_ARTIFACTS}"
|
||||||
|
- sudo cp /var/log/upstart/docker.log "${CIRCLE_ARTIFACTS}"
|
||||||
|
|
|
@ -5,7 +5,7 @@ PKGS=$(go list github.com/tendermint/tendermint/... | grep -v /vendor/)
|
||||||
set -e
|
set -e
|
||||||
echo "mode: atomic" > coverage.txt
|
echo "mode: atomic" > coverage.txt
|
||||||
for pkg in ${PKGS[@]}; do
|
for pkg in ${PKGS[@]}; do
|
||||||
go test -timeout 30m -race -coverprofile=profile.out -covermode=atomic $pkg
|
go test -v -timeout 30m -race -coverprofile=profile.out -covermode=atomic $pkg
|
||||||
if [ -f profile.out ]; then
|
if [ -f profile.out ]; then
|
||||||
tail -n +2 profile.out >> coverage.txt;
|
tail -n +2 profile.out >> coverage.txt;
|
||||||
rm profile.out
|
rm profile.out
|
||||||
|
|
|
@ -21,7 +21,7 @@ for lib in "${LIBS_GO_TEST[@]}"; do
|
||||||
bash scripts/glide/checkout.sh $GLIDE $lib
|
bash scripts/glide/checkout.sh $GLIDE $lib
|
||||||
|
|
||||||
echo "Testing $lib ..."
|
echo "Testing $lib ..."
|
||||||
go test --race github.com/tendermint/$lib/...
|
go test -v --race github.com/tendermint/$lib/...
|
||||||
if [[ "$?" != 0 ]]; then
|
if [[ "$?" != 0 ]]; then
|
||||||
echo "FAIL"
|
echo "FAIL"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue