Skip to content

Commit

Permalink
Improve test and build time by using -i flag (#4758)
Browse files Browse the repository at this point in the history
See #4755 for details.
  • Loading branch information
ruflin authored and tsg committed Jul 26, 2017
1 parent 18474a6 commit 30ee527
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}

#
Expand Down

0 comments on commit 30ee527

Please sign in to comment.