Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2022-04-26 23:31:42 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-04-28 18:06:19 +0300
commit9857f7d70983e7af2f0702035c67743d9e1fa3c0 (patch)
tree39ca4fd39f4b12d6c8f1ebee1565c590d8e37c81 /Makefile.util.mk
parent7a166f3e432bc12ef4b22365aedfe120131b9e66 (diff)
Cleanup makefiles and remove outdated tasks
Diffstat (limited to 'Makefile.util.mk')
-rw-r--r--Makefile.util.mk26
1 files changed, 9 insertions, 17 deletions
diff --git a/Makefile.util.mk b/Makefile.util.mk
index e9abe846..c00cf08e 100644
--- a/Makefile.util.mk
+++ b/Makefile.util.mk
@@ -1,9 +1,9 @@
-.PHONY: lint test race acceptance bench cover list deps-check deps-download changelog
+.PHONY: lint format test race acceptance bench cover deps-check mocks-check deps-download changelog zip
OUT_FORMAT ?= colored-line-number
LINT_FLAGS ?= $(if $V,-v)
REPORT_FILE ?=
-COVERAGE_PACKAGES=$(shell (go list ./... | grep -v $(addprefix -e ,$(IGNORED_DIRS) "test/acceptance") | tr "\n", "," | sed 's/\(.*\),/\1 /'))
+COVERAGE_PACKAGES=$(shell (go list ./... | grep -v -e "test/acceptance" | tr "\n", "," | sed 's/\(.*\),/\1 /'))
lint: .GOPATH/.ok bin/golangci-lint
$Q ./bin/golangci-lint run ./... --out-format $(OUT_FORMAT) $(LINT_FLAGS) | tee ${REPORT_FILE}
@@ -11,34 +11,31 @@ lint: .GOPATH/.ok bin/golangci-lint
format: .GOPATH/.ok bin/golangci-lint
$Q ./bin/golangci-lint run ./... --fix --out-format $(OUT_FORMAT) $(LINT_FLAGS) | tee ${REPORT_FILE}
-test: .GOPATH/.ok .GOPATH/.ok bin/gotestsum gitlab-pages
+test: .GOPATH/.ok bin/gotestsum gitlab-pages
rm -f tests.out
./bin/gotestsum --junitfile junit-test-report.xml --format testname -- ./... ${ARGS}
-race: .GOPATH/.ok .GOPATH/.ok bin/gotestsum gitlab-pages
- CGO_ENABLED=1 ./bin/gotestsum --junitfile junit-test-report.xml --format testname -- -race $(if $V,-v) $(allpackages) ${ARGS}
+race: .GOPATH/.ok bin/gotestsum gitlab-pages
+ CGO_ENABLED=1 ./bin/gotestsum --junitfile junit-test-report.xml --format testname -- -race $(if $V,-v) ./... ${ARGS}
-acceptance: .GOPATH/.ok .GOPATH/.ok bin/gotestsum gitlab-pages
+acceptance: .GOPATH/.ok bin/gotestsum gitlab-pages
./bin/gotestsum --junitfile junit-test-report.xml --format testname -- $(if $V,-v) ./test/acceptance ${ARGS}
bench: .GOPATH/.ok gitlab-pages
- go test -bench=. -run=^$$ $(allpackages)
+ go test -bench=. -run=^$$ ./...
# The acceptance tests cannot count for coverage
-cover: gitlab-pages
+cover:
@echo "NOTE: make cover does not exit 1 on failure, don't use it to check for tests success!"
$Q rm -f .GOPATH/cover/test.coverage
$Q mkdir -p .GOPATH/cover
- $Q go test -short -cover -coverpkg=$(COVERAGE_PACKAGES) -coverprofile=.GOPATH/cover/test.coverage $(allpackages)
+ $Q go test -short -cover -coverpkg=$(COVERAGE_PACKAGES) -coverprofile=.GOPATH/cover/test.coverage ./...
$Q go tool cover -html .GOPATH/cover/test.coverage -o coverage.html
@echo ""
@echo "=====> Total test coverage: <====="
@echo ""
$Q go tool cover -func .GOPATH/cover/test.coverage
-list: .GOPATH/.ok
- @echo $(allpackages)
-
deps-check: .GOPATH/.ok
go mod tidy
@if git diff --color=always --exit-code -- go.mod go.sum; then \
@@ -61,17 +58,12 @@ mocks-check: .GOPATH/.ok generate-mocks
deps-download: .GOPATH/.ok
go mod download
-junit-report: .GOPATH/.ok bin/gotestsum
- ./bin/gotestsum --junitfile junit-test-report.xml --format testname
-
changelog:
TOKEN='$(GITLAB_PRIVATE_TOKEN)' VERSION='$(shell cat VERSION)' BRANCH='$(BRANCH)' bash ./.gitlab/scripts/changelog.sh
ifndef GITLAB_PRIVATE_TOKEN
$(error GITLAB_PRIVATE_TOKEN is undefined)
endif
-.PHONY: zip
-
zip:
cd $(PWD)/shared/pages/$(PROJECT_SUBDIR)/ && \
zip -r public.zip public/