verify.sh 853 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. set -eu
  3. # Run from the repository root. Browser execution is opt-in.
  4. mkdir -p bin test-results
  5. export GOFLAGS="${GOFLAGS:--buildvcs=false}"
  6. go list -f '{{.Dir}}' ./... | while IFS= read -r directory; do
  7. find "$directory" -maxdepth 1 -name '*.go' -exec gofmt -l {} +
  8. done > test-results/gofmt.txt
  9. if [ -s test-results/gofmt.txt ]; then
  10. cat test-results/gofmt.txt
  11. exit 1
  12. fi
  13. go vet ./...
  14. CFBROWSER_INTEGRATION=0 CGO_ENABLED=0 go test ./... -count=1 -coverprofile=test-results/unit.cover
  15. CGO_ENABLED=0 go build -o bin/cfbrowser ./cmd/cfbrowser
  16. CGO_ENABLED=0 go build -o bin/cfbrowser-worker ./cmd/cfbrowser-worker
  17. if [ "${CFBROWSER_INTEGRATION:-0}" = 1 ]; then
  18. go test ./integration -count=1 -v -timeout=120s
  19. fi
  20. if [ "${CFBROWSER_RACE:-0}" = 1 ]; then
  21. CFBROWSER_INTEGRATION=0 CGO_ENABLED=1 go test -race ./... -count=1 -timeout=120s
  22. fi