Enable shell tests

We need to use sudo: required, and dist: trusty to avoid old versions of
bash in travis which don't support the -n argument to the `wait` shell
built-in.

We had to disable the -e checks in etcd.sh since the killall || killall
parts were causing those to trigger in travis.
This commit is contained in:
James Shubin
2016-01-28 06:31:29 -05:00
parent 0795cadad1
commit 358604def2
5 changed files with 13 additions and 15 deletions

View File

@@ -3,7 +3,8 @@ go:
- 1.4.3
- 1.5.2
- tip
sudo: false
dist: trusty
sudo: required
install: 'make deps'
script: 'make test'
matrix:

View File

@@ -24,6 +24,7 @@ race:
build: mgmt
mgmt: main.go
@echo "Building: $(PROGRAM), version: $(VERSION)."
go generate
go build -ldflags "-X main.version=$(VERSION) -X main.program=$(PROGRAM)"

View File

@@ -14,18 +14,17 @@ if [ $travis -eq 0 ]; then
fi
sudo yum install -y golang golang-googlecode-tools-stringer
sudo yum install -y hg # some go dependencies are stored in mercurial
sudo yum install -y etcd
fi
$( # build etcd
git clone --recursive https://github.com/coreos/etcd/ && cd etcd
git checkout v2.2.4 # TODO: update to newer versions as needed
[ -x build ] && ./build
echo $PATH
mkdir -p ~/bin/
cp bin/etcd ~/bin/
cd -
rm -rf etcd # clean up to avoid failing on upstream gofmt errors
)
# build etcd
git clone --recursive https://github.com/coreos/etcd/ && cd etcd
git checkout v2.2.4 # TODO: update to newer versions as needed
[ -x build ] && ./build
mkdir -p ~/bin/
cp bin/etcd ~/bin/
cd -
rm -rf etcd # clean up to avoid failing on upstream gofmt errors
go get ./... # get all the go dependencies
go get golang.org/x/tools/cmd/vet # add in `go vet` for travis

View File

@@ -19,5 +19,5 @@ go vet && echo PASS
# do these longer tests only when running on ci
if env | grep -q -e '^TRAVIS=true$' -e '^JENKINS_URL='; then
go test -race
#./test/test-shell.sh
./test/test-shell.sh
fi

View File

@@ -1,7 +1,4 @@
# NOTE: boiler plate to run etcd; source with: . etcd.sh; should NOT be +x
set -o errexit
set -o nounset
set -o pipefail
cleanup ()
{
killall etcd || killall -9 etcd || true # kill etcd