|
@@ -12,36 +12,22 @@ function exit_if_fail {
|
|
|
|
|
|
|
|
cd /home/ubuntu/.go_workspace/src/github.com/grafana/grafana
|
|
cd /home/ubuntu/.go_workspace/src/github.com/grafana/grafana
|
|
|
|
|
|
|
|
-rm -rf node_modules
|
|
|
|
|
-npm install -g yarn --quiet
|
|
|
|
|
-yarn install --pure-lockfile --no-progress
|
|
|
|
|
-
|
|
|
|
|
-exit_if_fail npm run test:coverage
|
|
|
|
|
-exit_if_fail npm run build
|
|
|
|
|
-
|
|
|
|
|
-# publish code coverage
|
|
|
|
|
-echo "Publishing javascript code coverage"
|
|
|
|
|
-bash <(curl -s https://codecov.io/bash) -cF javascript
|
|
|
|
|
-rm -rf coverage
|
|
|
|
|
-# npm install -g codecov
|
|
|
|
|
-# codecov
|
|
|
|
|
-# cat ./coverage/lcov.info | node ./node_modules/coveralls/bin/coveralls.js
|
|
|
|
|
-
|
|
|
|
|
echo "running go fmt"
|
|
echo "running go fmt"
|
|
|
exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
|
|
exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
|
|
|
|
|
|
|
|
echo "running go vet"
|
|
echo "running go vet"
|
|
|
exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
|
|
exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
|
|
|
|
|
|
|
|
-echo "building binaries"
|
|
|
|
|
-exit_if_fail go run build.go build
|
|
|
|
|
|
|
+cd ~/dev/go/src/github.com/grafana/grafana
|
|
|
|
|
+echo "building backend with install to cache pkgs"
|
|
|
|
|
+exit_if_fail time go install ./pkg/cmd/grafana-server
|
|
|
|
|
|
|
|
echo "running go test"
|
|
echo "running go test"
|
|
|
|
|
|
|
|
set -e
|
|
set -e
|
|
|
echo "" > coverage.txt
|
|
echo "" > coverage.txt
|
|
|
|
|
|
|
|
-for d in $(go list ./pkg/...); do
|
|
|
|
|
|
|
+time for d in $(go list ./pkg/...); do
|
|
|
exit_if_fail go test -coverprofile=profile.out -covermode=atomic $d
|
|
exit_if_fail go test -coverprofile=profile.out -covermode=atomic $d
|
|
|
if [ -f profile.out ]; then
|
|
if [ -f profile.out ]; then
|
|
|
cat profile.out >> coverage.txt
|
|
cat profile.out >> coverage.txt
|