From 59613e6475590350a20daa50b88a68a2ceb35230 Mon Sep 17 00:00:00 2001 From: Marvin Preuss Date: Wed, 23 Mar 2022 13:44:46 +0100 Subject: [PATCH] build: uses gotestsum for testing --- .gitignore | 4 ++++ Makefile | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fa5eb67..949648d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ dist/* .envrc +coverage.out +report.xml +.gobin/* +.cache/* diff --git a/Makefile b/Makefile index b4cd93f..fa8bced 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,28 @@ GO := go -GORELEASER := $(GO) run github.com/goreleaser/goreleaser@v1.3.1 -GOLANGCI_LINT := $(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2 +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +CACHE_DIR := $(ROOT_DIR)/.cache + +export GOBIN := $(ROOT_DIR)/.gobin +export PATH := $(GOBIN):$(PATH) + +GORELEASER := $(GO) run github.com/goreleaser/goreleaser@v1.7.0 +GOLANGCI_LINT := $(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.0 + +GOTESTSUM_URL := gotest.tools/gotestsum@v1.7.0 +GOTESTSUM := $(GO) run $(GOTESTSUM_URL) .PHONY: test test: - $(GO) test -count=1 -v ./... + $(GOTESTSUM) \ + --junitfile report.xml \ + -- \ + -race \ + -cover \ + -coverprofile=coverage.out \ + -tags=integration \ + ./... \ + -timeout=120m .PHONY: lint lint: