Skip to content
This repository was archived by the owner on Oct 31, 2021. It is now read-only.

Commit c1a3eb7

Browse files
committed
sjakl
1 parent 34a2ccf commit c1a3eb7

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ tmp
1616
local
1717
values.local.yaml
1818
Notes.md
19-
*terraform*
19+
*terraform*
20+
rest-api.xml

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ build: $(GO) dependencies $(APP_GO_FILES)
7070
$(call infoMsg,Building rest-api binary)
7171
$(GO) build -o $(LOCAL_BIN)/monetr $(MONETR_CLI_PACKAGE)
7272

73-
test: $(GO) dependencies $(ALL_GO_FILES)
73+
test: $(GO) dependencies $(ALL_GO_FILES) $(GOTESTSUM)
7474
$(call infoMsg,Running go tests for monetr rest-api)
7575
ifndef CI
7676
$(GO) run $(MONETR_CLI_PACKAGE) database migrate -d $(POSTGRES_DB) -U $(POSTGRES_USER) -H $(POSTGRES_HOST)
7777
endif
78-
$(GO) test -race -v -coverprofile=$(COVERAGE_TXT) -covermode=atomic $(GO_SRC_DIR)/...
78+
$(GOTESTSUM) --junitfile $(PWD)/rest-api.xml -- -race -v -coverprofile=$(COVERAGE_TXT) -covermode=atomic $(GO_SRC_DIR)/...
7979
$(GO) tool cover -func=$(COVERAGE_TXT)
8080

8181
clean:
@@ -182,3 +182,4 @@ migrate: $(GO)
182182
beta-code: $(GO) migrate
183183
@$(GO) run $(MONETR_CLI_PACKAGE) beta new-code -d $(POSTGRES_DB) -U $(POSTGRES_USER) -H $(POSTGRES_HOST) -P $(POSTGRES_PORT) -W $(POSTGRES_PASSWORD)
184184

185+
all: build test generate lint

scripts/Dependencies.mk

+18
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,24 @@ install-$(GCLOUD): $(LOCAL_BIN) $(LOCAL_TMP) $(CURL)
159159
tar -xzf $(GCLOUD_TAR) -C $(LOCAL_BIN)
160160
rm -rf $(GCLOUD_TAR)
161161

162+
GOTESTSUM=$(LOCAL_BIN)/gotestsum
163+
$(GOTESTSUM):
164+
@if [ ! -f "$(GOTESTSUM)" ]; then $(MAKE) install-$(GOTESTSUM); fi
165+
166+
install-$(GOTESTSUM): GOTESTSUM_VERSION=1.7.0
167+
install-$(GOTESTSUM): GOTESTSUM_URL="https://github.com/gotestyourself/gotestsum/releases/download/v$(GOTESTSUM_VERSION)/gotestsum_$(GOTESTSUM_VERSION)_$(OS)_$(ARCH).tar.gz"
168+
install-$(GOTESTSUM): GOTESTSUM_DIR=$(LOCAL_TMP)/gotestsum
169+
install-$(GOTESTSUM): GOTESTSUM_TAR=$(GOTESTSUM_DIR).tar.gz
170+
install-$(GOTESTSUM): $(LOCAL_BIN) $(LOCAL_TMP) $(CURL)
171+
$(call infoMsg,Installing gotestsum to $(GOTESTSUM))
172+
-rm -rf $(GOTESTSUM_DIR)
173+
mkdir -p $(GOTESTSUM_DIR)
174+
curl -SsL $(GOTESTSUM_URL) --output $(GOTESTSUM_TAR)
175+
tar -xzf $(GOTESTSUM_TAR) -C $(GOTESTSUM_DIR)
176+
cp $(GOTESTSUM_DIR)/gotestsum $(GOTESTSUM)
177+
rm -rf $(GOTESTSUM_DIR)
178+
rm -rf $(GOTESTSUM_TAR)
179+
162180
ifneq ($(ENV_LOWER),local)
163181
KUBECTL=$(LOCAL_BIN)/kubectl
164182
$(KUBECTL):

0 commit comments

Comments
 (0)