diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-06-11 19:43:15 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2022-06-11 19:43:25 +0300 |
commit | 4707b9da8e78cdc83841b2771c6bb8a0ea876f47 (patch) | |
tree | e6f0c4b1decbffaac8b7225a35adc52058bf91ad | |
parent | 413d38fbd39fc3870ee5668ce69ee50d952deb73 (diff) |
Add unit-test task and avoid building the binary
-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 5c8e783b..3d188559 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 a2eea8bf..ce84d578 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} |