Skip to content

Commit

Permalink
ci: add make cmd for output go tests in junit format (#293)
Browse files Browse the repository at this point in the history
* ci: add make cmd for output go tests in junit format

Signed-off-by: Darren Murray <darren.murray@lacework.net>
  • Loading branch information
dmurray-lacework authored Apr 1, 2022
1 parent 4db5abe commit eec76b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=lacework
DIR=~/.terraform.d/plugins
CIARTIFACTS?=ci-artifacts
GOJUNITOUT?=tf-provider-go-junit.xml
GO_CLIENT_VERSION=master
COVERAGEOUT?=coverage.out
GOFLAGS=-mod=vendor
Expand Down Expand Up @@ -76,6 +78,11 @@ uninstall: ## Removes installed provider package from BINARY_PATH
integration-test: clean-test install ## Runs clean-test and install, then runs all integration tests
gotestsum -f testname -- -v ./integration

.PHONY: test-go-junit-ci
test-go-junit-ci: clean-test install ## Runs clean-test and install, then runs all integration tests and output as junit xml format
mkdir -p $(CIARTIFACTS)
go test -v ./integration 2>&1 | go-junit-report > "$(CIARTIFACTS)/$(GOJUNITOUT)"

.PHONY: test
test: fmtcheck ## Runs fmtcheck then runs all unit tests
gotestsum -f testname -- -v -cover -coverprofile=$(COVERAGEOUT) $(TEST)
Expand Down

0 comments on commit eec76b2

Please sign in to comment.