Skip to content

Commit

Permalink
disable CGO (#318)
Browse files Browse the repository at this point in the history
* disable CGO

* selectively enable cgo on unit tests
  • Loading branch information
Mario Macias committed Oct 7, 2022
1 parent b8c0090 commit d377c5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export GO111MODULE=on
export CGO_ENABLED=0
export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=1

SHELL := /bin/bash
DOCKER_TAG ?= latest
Expand Down Expand Up @@ -100,15 +99,16 @@ clean: ## Clean
TEST_OPTS := -race -coverpkg=./... -covermode=atomic -coverprofile=/tmp/coverage.out
.PHONY: tests-unit
tests-unit: validate_go ## Unit tests
go test -p 1 $(TEST_OPTS) $$(go list ./... | grep -v /e2e)
# enabling CGO is required for -race flag
CGO_ENABLED=1 go test -p 1 $(TEST_OPTS) $$(go list ./... | grep -v /e2e)

.PHONY: tests-fast
tests-fast: TEST_OPTS=
tests-fast: tests-unit ## Fast unit tests (no race tests / coverage)

.PHONY: tests-e2e
tests-e2e: validate_go $(KIND) ## End-to-end tests
go test -p 1 -v -timeout 20m -race $$(go list ./... | grep /e2e)
go test -p 1 -v -timeout 20m $$(go list ./... | grep /e2e)

.PHONY: tests-all
tests-all: validate_go tests-unit tests-e2e ## All tests
Expand Down

0 comments on commit d377c5d

Please sign in to comment.