#!/bin/bash -x

cd $GOPATH/src/github.com/dropbox/changes-artifacts/
export PATH=$GOPATH/bin:$PATH

go get -v github.com/jstemmer/go-junit-report
go get -v ./...

go run server.go -migrations-only

go run server.go &
sudo fakes3 -r /var/cache/fakes3 -p 4569 &

go test -race -cover -v ./... | tee test.output | go-junit-report > junit.xml

pkill -9 server
sudo pkill -9 fakes3

cat test.output

#!/bin/bash -x

cd $GOPATH/src/github.com/dropbox/changes-artifacts/
export PATH=$GOPATH/bin:$PATH

go get -v github.com/jstemmer/go-junit-report
go get -v ./...

go run server.go -migrations-only

go run server.go &
sudo fakes3 -r /var/cache/fakes3 -p 4569 &

go test -race -cover -v ./... | tee test.output | go-junit-report > junit.xml

statuscode=${PIPESTATUS[0]}

pkill -9 server
sudo pkill -9 fakes3

cat test.output

exit $statuscode

Return correct exit code using go test status while using go-junit-report.
Return correct exit code using go test status while using go-junit-report.

Summary: Test script should not return successful exit code if `go test` failed.

Test Plan: Tested with failing `go test`

Reviewers: kylec

Reviewed By: kylec

Subscribers: changesbot, anupc

Differential Revision: https://tails.corp.dropbox.com/D133524
