diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 022b1dfc96..b29da1f5a7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,10 +7,12 @@ # review a PR in an area. # # Rules are evaluated in this order, and the last match is used for auto-assignment. -* @azure/azure-sdn-members -/.github/ @azure/acn-admins -/cns/ @azure/acn-cns-reviewers -/cni/ @azure/acn-cni-reviewers -/dropgz/ @rbtr @camrynl @paulyufan2 @ashvindeodhar @thatmattlong -/npm/ @azure/acn-npm-reviewers -/zapai/ @rbtr @ZetaoZhuang +* @azure/azure-sdn-members +/.github/ @azure/acn-admins +/cns/ @azure/acn-cns-reviewers +/cni/ @azure/acn-cni-reviewers +/dropgz/ @rbtr @camrynl @paulyufan2 @ashvindeodhar @thatmattlong +/npm/ @azure/acn-npm-reviewers +/zapai/ @rbtr @ZetaoZhuang +/bpf-prog/ @camrynl +/azure-ip-masq-merger/ @QxBytes @santhoshmprabhu diff --git a/.pipelines/templates/run-unit-tests.yaml b/.pipelines/templates/run-unit-tests.yaml index 4de945ddc0..07ad30c9eb 100644 --- a/.pipelines/templates/run-unit-tests.yaml +++ b/.pipelines/templates/run-unit-tests.yaml @@ -25,8 +25,10 @@ stages: } 3>&1; } | { read xs; exit $xs; } } 4>&1 - - mv coverage-all.out linux-coverage.out + + # combine coverage from multiple modules + (echo "mode: atomic"; tail -q -n +2 coverage-*.out) > coverage.cover + mv coverage.cover linux-coverage.out retryCountOnTaskFailure: 3 name: "Test" displayName: "Run Tests" @@ -75,6 +77,9 @@ stages: artifact: 'linux-coverage' path: './' - bash: | + # use go work to include multiple modules or gocov will omit results from those modules + make workspace + make tools sudo ln -s $(pwd)/build/tools/bin/gocov /usr/local/bin/gocov sudo ln -s $(pwd)/build/tools/bin/gocov-xml /usr/local/bin/gocov-xml diff --git a/Makefile b/Makefile index b1367cc035..9c34200ccb 100644 --- a/Makefile +++ b/Makefile @@ -810,6 +810,7 @@ workspace: ## Set up the Go workspace. go work init go work use . go work use ./azure-ipam + go work use ./azure-ip-masq-merger go work use ./build/tools go work use ./dropgz go work use ./zapai @@ -822,9 +823,11 @@ RESTART_CASE ?= false # CNI type is a key to direct the types of state validation done on a cluster. CNI_TYPE ?= cilium -test-all: ## run all unit tests. - go test -mod=readonly -buildvcs=false -tags "unit" --skip 'TestE2E*' -race -covermode atomic -coverprofile=coverage-all.out $(COVER_PKG)/... - go tool cover -func=coverage-all.out +test-all: test-azure-ipam test-azure-ip-masq-merger test-main ## run all unit tests. + +test-main: + go test -mod=readonly -buildvcs=false -tags "unit" --skip 'TestE2E*' -race -covermode atomic -coverprofile=coverage-main.out $(COVER_PKG)/... + go tool cover -func=coverage-main.out test-integration: ## run all integration tests. AZURE_IPAM_VERSION=$(AZURE_IPAM_VERSION) \ @@ -855,10 +858,10 @@ test-extended-cyclonus: ## run the cyclonus test for npm. cd .. test-azure-ipam: ## run the unit test for azure-ipam - cd $(AZURE_IPAM_DIR) && go test + cd $(AZURE_IPAM_DIR) && go test -race -covermode atomic -coverprofile=../coverage-azure-ipam.out && go tool cover -func=../coverage-azure-ipam.out test-azure-ip-masq-merger: ## run the unit test for azure-ip-masq-merger - cd $(AZURE_IP_MASQ_MERGER_DIR) && go test + cd $(AZURE_IP_MASQ_MERGER_DIR) && go test -race -covermode atomic -coverprofile=../coverage-azure-ip-masq-merger.out && go tool cover -func=../coverage-azure-ip-masq-merger.out kind: kind create cluster --config ./test/kind/kind.yaml