diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile index ed8c45603242..d7163eed4cb3 100755 --- a/libbeat/scripts/Makefile +++ b/libbeat/scripts/Makefile @@ -83,10 +83,11 @@ endif ${BEAT_NAME}: $(GOFILES_ALL) ## @build build the beat application - go build + go build -i # Create test coverage binary ${BEAT_NAME}.test: $(GOFILES_ALL) + @go build -i -o /dev/null @go test $(RACE) -c -coverpkg ${GOPACKAGES_COMMA_SEP} .PHONY: crosscompile @@ -142,15 +143,18 @@ prepare-tests: .PHONY: unit-tests unit-tests: ## @testing Runs the unit tests with coverage. Race is not enabled for unit tests because tests run much slower. unit-tests: prepare-tests + go test -i ${GOPACKAGES} $(COVERAGE_TOOL) $(RACE) -coverprofile=${COVERAGE_DIR}/unit.cov ${GOPACKAGES} .PHONY: unit unit: ## @testing Runs the unit tests without coverage reports. + go test -i ${GOPACKAGES} go test $(RACE) ${GOPACKAGES} .PHONY: integration-tests integration-tests: ## @testing Run integration tests. Unit tests are run as part of the integration tests. integration-tests: prepare-tests + go test -i ${GOPACKAGES} $(COVERAGE_TOOL) -tags=integration $(RACE) -coverprofile=${COVERAGE_DIR}/integration.cov ${GOPACKAGES} #