Skip to content

Commit

Permalink
Update Makefile to:
Browse files Browse the repository at this point in the history
- fix command order in make deps (go mod vendor can fail if go mod tidy
  needs to run)
- add unit-test target to run only the unit tests
  • Loading branch information
thomasferrandiz committed Sep 5, 2024
1 parent 046ae2e commit 104b0b6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: test e2e-test deps cover gofmt gofmt-fix license-check clean tar.gz release buildx-create-builder build-multi-arch
.PHONY: test unit-test e2e-test deps cover gofmt gofmt-fix license-check clean tar.gz release buildx-create-builder build-multi-arch

# Registry used for publishing images
REGISTRY?=quay.io/coreos/flannel
Expand Down Expand Up @@ -71,6 +71,15 @@ endif

### TESTING
test: license-check gofmt deps verify-modules
make unit-test

# Test the docker-opts script
cd dist; ./mk-docker-opts_tests.sh

# Run the functional tests
make e2e-test

unit-test:
# Run the unit tests
# NET_ADMIN capacity is required to do some network operation
# SYS_ADMIN capacity is required to create network namespace
Expand All @@ -80,12 +89,6 @@ test: license-check gofmt deps verify-modules
golang:$(GO_VERSION) \
/bin/bash -c 'cd /go/src/github.com/flannel-io/flannel && go test -v -cover -timeout 5m $(TEST_PACKAGES_EXPANDED)'

# Test the docker-opts script
cd dist; ./mk-docker-opts_tests.sh

# Run the functional tests
make e2e-test

e2e-test: bash_unit dist/flanneld-e2e-$(TAG)-$(ARCH).docker
$(MAKE) -C images/iperf3 ARCH=$(ARCH)
FLANNEL_DOCKER_IMAGE=$(REGISTRY):$(TAG)-$(ARCH) ./bash_unit dist/functional-test.sh
Expand Down Expand Up @@ -214,8 +217,8 @@ install:
CGO_ENABLED=$(CGO_ENABLED) go install -v github.com/flannel-io/flannel

deps:
go mod vendor
go mod tidy
go mod vendor

buildx-create-builder:
docker buildx create --name mybuilder --use --bootstrap
Expand Down

0 comments on commit 104b0b6

Please sign in to comment.