From c32c53c58aac1431badfbb97a6fcc9228a435fb3 Mon Sep 17 00:00:00 2001 From: ruflin Date: Wed, 26 Jul 2017 08:55:09 +0200 Subject: [PATCH] Improve test and build time by using -i flag See https://github.com/elastic/beats/issues/4755 for details. --- libbeat/scripts/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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} #