set -e -x

export GOROOT=$(readlink -nf /var/vcap/packages/golang_1.4)
export PATH=${GOROOT}/bin:${PATH}

export GOPATH=$BOSH_INSTALL_TARGET

mkdir -p ${GOPATH}/src
cp -a . ${GOPATH}/src

go install github.com/cloudfoundry-incubator/diego-cli-plugin

cd ${GOPATH}/src/github.com/cloudfoundry-incubator/docker-cache-acceptance-tests

go install github.com/onsi/ginkgo/ginkgo

go test -c ./caching
go test -c ./feature
go test -c ./smoke

# clean up artifacts
rm *.test
rm -rf ${GOPATH}/pkg
