Skip to content

Commit

Permalink
add unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasferrandiz committed Sep 4, 2024
1 parent 2bfbd1d commit d5ab99a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 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

0 comments on commit d5ab99a

Please sign in to comment.