grafana/scripts/circle-test-backend.sh

24 lines
521 B
Bash
Raw Normal View History

#!/bin/bash
function exit_if_fail {
command=$@
echo "Executing '$command'"
eval $command
rc=$?
if [ $rc -ne 0 ]; then
echo "'$command' returned $rc."
exit $rc
fi
}
echo "running go fmt"
exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
echo "running go vet"
2017-02-05 14:21:05 -06:00
exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
2017-10-23 02:06:08 -05:00
echo "building backend with install to cache pkgs"
exit_if_fail time go install ./pkg/cmd/grafana-server
echo "running go test"
2018-04-12 03:44:04 -05:00
go test ./pkg/...