Skip to content

Commit

Permalink
remove -i from go build (#14556)
Browse files Browse the repository at this point in the history
  • Loading branch information
graphaelli authored and jalvz committed Nov 20, 2019
1 parent b9481d3 commit 360bd93
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ COVERAGE_TOOL?=${BEAT_GOPATH}/bin/gotestcover
COVERAGE_TOOL_REPO?=github.com/elastic/beats/vendor/github.com/pierrre/gotestcover
TESTIFY_TOOL_REPO?=github.com/elastic/beats/vendor/github.com/stretchr/testify/assert
NOW=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
GOBUILD_FLAGS?=-i -ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=$(NOW) -X github.com/elastic/beats/libbeat/version.commit=$(COMMIT_ID)"
GOBUILD_FLAGS?=-ldflags "-X github.com/elastic/beats/libbeat/version.buildTime=$(NOW) -X github.com/elastic/beats/libbeat/version.commit=$(COMMIT_ID)"
GOIMPORTS=goimports
GOIMPORTS_REPO?=github.com/elastic/beats/vendor/golang.org/x/tools/cmd/goimports
GOIMPORTS_LOCAL_PREFIX?=github.com/elastic
Expand Down Expand Up @@ -108,7 +108,7 @@ ${BEAT_NAME}: $(GOFILES_ALL) ## @build build the beat application

# Create test coverage binary
${BEAT_NAME}.test: $(GOFILES_ALL)
@go build -i -o /dev/null
@go build -o /dev/null
@go test $(RACE) -c -coverpkg ${GOPACKAGES_COMMA_SEP}

.PHONY: crosscompile
Expand Down Expand Up @@ -173,19 +173,16 @@ 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
rm -f docker-compose.yml.lock
go test -i ${GOPACKAGES}
$(COVERAGE_TOOL) -tags=integration $(RACE) -coverprofile=${COVERAGE_DIR}/integration.cov ${GOPACKAGES}

#
Expand Down

0 comments on commit 360bd93

Please sign in to comment.