diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2022-06-15 07:10:16 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2022-06-15 07:10:16 +0300 |
commit | f0f709a80eb0cd1b27a0d998ee1fbd6b087cbfee (patch) | |
tree | d1858489e0af16066a60df315dd79678e6d825cc | |
parent | 912bcfae2e50f62e400dc3ac6feb4c59838e53cb (diff) | |
parent | 4707b9da8e78cdc83841b2771c6bb8a0ea876f47 (diff) |
Merge branch 'ci/unit-test-avoid-compile' into 'master'
ci: add unit-test task and avoid building the binary
See merge request gitlab-org/gitlab-pages!782
-rw-r--r-- | .gitlab/ci/test.yml | 2 | ||||
-rw-r--r-- | Makefile.util.mk | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/.gitlab/ci/test.yml b/.gitlab/ci/test.yml index 3c24321e..9a30f429 100644 --- a/.gitlab/ci/test.yml +++ b/.gitlab/ci/test.yml @@ -17,7 +17,7 @@ tests: extends: .tests-matrix script: - echo "Running all unit tests..." - - make test ARGS='-short' + - make unit-test tests-acceptance: extends: .tests-matrix diff --git a/Makefile.util.mk b/Makefile.util.mk index 5a196fe4..7287d260 100644 --- a/Makefile.util.mk +++ b/Makefile.util.mk @@ -1,4 +1,4 @@ -.PHONY: lint format test race acceptance bench cover deps-check mocks-check deps-download changelog zip +.PHONY: lint format test unit-test race acceptance bench cover deps-check mocks-check deps-download changelog zip OUT_FORMAT ?= colored-line-number LINT_FLAGS ?= $(if $V,-v) @@ -14,9 +14,11 @@ format: $Q go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION) run ./... --fix --out-format $(OUT_FORMAT) $(LINT_FLAGS) | tee ${REPORT_FILE} test: gitlab-pages - rm -f tests.out go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --junitfile junit-test-report.xml --format testname -- ./... ${ARGS} +unit-test: + go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --junitfile junit-test-report.xml --format testname -- -short ./... ${ARGS} + race: gitlab-pages go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --junitfile junit-test-report.xml --format testname -- -race $(if $V,-v) ./... ${ARGS} |