move unit tests from image build to contrainer run

This commit is contained in:
Dominic Breuker
2018-03-09 08:55:49 +01:00
parent 829f633881
commit 584f8e779b
2 changed files with 6 additions and 3 deletions

View File

@@ -9,10 +9,8 @@ COPY cmd /go/src/github.com/dominicbreuker/pspy/cmd
COPY internal /go/src/github.com/dominicbreuker/pspy/internal
COPY vendor /go/src/github.com/dominicbreuker/pspy/vendor
# run tests
WORKDIR /go/src/github.com/dominicbreuker/pspy
# RUN go test ./...
# build executable
WORKDIR /go/src/github.com/dominicbreuker/pspy
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o bin/pspy main.go
### Prepare integration test ###

View File

@@ -1,5 +1,10 @@
#!/bin/bash
# run unit tests
echo "[+] running unit tests"
sudo /bin/sh -c 'GOPATH=/go /usr/local/go/bin/go test ./...'
# run integration test
sudo cron -f &
sleep 1
sudo ps | grep cron 1>/dev/null