From 104b0b66f74d3b0b65ad00673f46e520a99cfb70 Mon Sep 17 00:00:00 2001 From: Thomas Ferrandiz Date: Wed, 4 Sep 2024 12:45:32 +0000 Subject: [PATCH] Update Makefile to: - 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 --- Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 506b079c93..7d79294807 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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 @@ -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