Run integration tests under Docker

This commit is contained in:
Jakob Borg 2014-11-23 22:30:29 +01:00
parent 4ccfa98771
commit 3a8315971e
2 changed files with 19 additions and 6 deletions

View File

@ -2,7 +2,7 @@
set -euo pipefail
IFS=$'\n\t'
DOCKERIMGV=1.3.3-2
DOCKERIMGV=1.3.3-3
case "${1:-default}" in
default)
@ -116,6 +116,21 @@ case "${1:-default}" in
sh -c './build.sh clean && STTRACE=all ./build.sh test-cov && ./build.sh all'
;;
docker-test)
docker run --rm -h syncthing-builder -u $(id -u) -t \
-v $(pwd):/tmp/syncthing \
syncthing/build:$DOCKERIMGV \
sh -euxc 'mkdir -p /go/src/github.com/syncthing \
&& cd /go/src/github.com/syncthing \
&& cp -r /tmp/syncthing syncthing \
&& cd syncthing \
&& ./build.sh clean \
&& ./build.sh \
&& export GOPATH=$(pwd)/Godeps/_workspace:$GOPATH \
&& cd test \
&& ./all.sh'
;;
*)
echo "Unknown build command $1"
;;

View File

@ -29,11 +29,6 @@ RUN go get github.com/calmh/gonative \
&& rm -rf go \
&& gonative -version $GOLANG_VERSION
# Random build users needs to be able to create stuff in /go
RUN rm -rf /go/pkg \
&& chmod 777 /go
# Rebuild the special and missing versions
RUN bash -xec '\
@ -56,3 +51,6 @@ RUN go get github.com/tools/godep \
&& go get github.com/axw/gocov/gocov \
&& go get github.com/AlekSi/gocov-xml
# Random build users needs to be able to create stuff in /go
RUN chmod -R 777 /go/bin /go/pkg /go/src