makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. SHELL := /bin/bash
  2. # Number of linting Go routines to use in integration tests
  3. PARALLELISM := 5
  4. # Additional integration test flags. Example usage:
  5. # make integration PARALLELISM=99 INT_FLAGS="-fingerprintSummary -forceDownload"
  6. # make integration INT_FLAGS="-overwriteExpected -config custom.config.json"
  7. # make integration INT_FLAGS="-fingerprintSummary -lintSummary -fingerprintFilter='^[ea]' -lintFilter='^w_ext_cert_policy_explicit_text_not_utf8' -config small.config.json"
  8. # make integration INT_FLAGS="-lintSummary -fingerprintSummary -lintFilter='^e_' -config small.config.json"
  9. # make integration INT_FLAGS="-lintSummary -fingerprintSummary -excludeSources='Mozilla,ETSI_ESI' -config small.config.json"
  10. # make integration INT_FLAGS="-includeSources='Mozilla,ETSI_ESI' -config small.config.json"
  11. INT_FLAGS :=
  12. GIT_VERSION := "$(shell git describe --abbrev=8)"
  13. CMDS = zlint zlint-gtld-update
  14. CMD_PREFIX = ./cmd/
  15. BUILD = $(GO_ENV) go build --ldflags="-X 'main.version=$(GIT_VERSION)'"
  16. TEST = $(GO_ENV) GORACE=halt_on_error=1 go test -race
  17. INT_TEST = $(GO_ENV) go test -v -tags integration -timeout 20m ./integration/. -parallelism $(PARALLELISM) $(INT_FLAGS)
  18. all: $(CMDS)
  19. zlint:
  20. $(BUILD) $(CMD_PREFIX)$(@)
  21. zlint-gtld-update:
  22. $(BUILD) $(CMD_PREFIX)$(@)
  23. clean:
  24. rm -f $(CMDS)
  25. test:
  26. $(TEST) ./...
  27. integration:
  28. $(INT_TEST)
  29. code-lint:
  30. # Skip these two directories as they contain Go files that are tests for custom
  31. # code linting framework and there is no expectation of those files conforming to anything.
  32. golangci-lint run --skip-dirs lints/lints/testdata/,lints/testdata
  33. custom-code-lint:
  34. (cd integration/lints/ && go run main.go ../../lints)
  35. (cd integration/lints/ && go run main.go ../../cmd/genTestCerts)
  36. testdata-lint:
  37. ./test/prepend_testcerts_openssl.sh && git diff --exit-code testdata/
  38. .PHONY: clean zlint zlint-gtld-update test integration code-lint testdata-lint custom-code-lint