From c0064da9d7ed84c664f2aeb8edfde6652fd11cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E5=85=83?= Date: Sun, 25 Oct 2020 10:34:16 +0800 Subject: [PATCH] add race detect flag for tests fix #256 and fix makefile for legacy chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 天元 --- .github/workflows/ci.yml | 8 -------- Makefile | 7 +++++-- apis/generate.go | 2 +- build | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2651358b..0685bf5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,11 +75,6 @@ jobs: - name: Vendor Dependencies run: make vendor vendor.check - - - name: Build Legacy Helm Chart - run: make prepare-legacy-chart - - - name: Check Diff run: make check-diff @@ -164,7 +159,6 @@ jobs: - name: Build Legacy Helm Chart run: make prepare-legacy-chart - - name: Build Helm Chart run: make -j2 build env: @@ -224,11 +218,9 @@ jobs: - name: Vendor Dependencies run: make vendor vendor.check - - name: Build Legacy Helm Chart run: make prepare-legacy-chart - - name: Build Artifacts run: make -j2 build.all env: diff --git a/Makefile b/Makefile index 96e04ef3..d41c6974 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,9 @@ NPROCS ?= 1 # parallel can lead to high CPU utilization. by default we reduce the parallelism # to half the number of CPU cores. GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 ))) +GO_TEST_FLAGS += -race +GO_COVER_MODE = atomic +GO_CGO_ENABLED = 1 GO_INTEGRATION_TESTS_SUBDIRS = test @@ -88,7 +91,7 @@ cobertura: $(GOCOVER_COBERTURA) > $(GO_TEST_OUTPUT)/cobertura-coverage.xml # Ensure a PR is ready for review. -reviewable: generate lint +reviewable: prepare-legacy-chart generate lint @go mod tidy # Ensure branch is clean. @@ -165,5 +168,5 @@ e2e-cleanup: e2e: e2e-setup e2e-test go-integration prepare-legacy-chart: - rsync -r $(LEGACY_HELM_CHART_DIR)/$(LEGACY_HELM_CHART) $(HELM_CHARTS_DIR) + rm -r $(HELM_CHARTS_DIR)/$(LEGACY_HELM_CHART) && cp -r $(LEGACY_HELM_CHART_DIR)/$(LEGACY_HELM_CHART) $(HELM_CHARTS_DIR)/ rsync -r $(HELM_CHARTS_DIR)/$(HELM_CHART)/* $(HELM_CHARTS_DIR)/$(LEGACY_HELM_CHART) --exclude=Chart.yaml --exclude=crds diff --git a/apis/generate.go b/apis/generate.go index c9426825..8c418e7a 100644 --- a/apis/generate.go +++ b/apis/generate.go @@ -26,7 +26,7 @@ limitations under the License. //go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1 output:artifacts:config=../charts/oam-kubernetes-runtime/crds // Generate legacy_support for K8s 1.12~1.15 versions CRD manifests -//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:trivialVersions=true output:artifacts:config=../legacy/crds +//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:trivialVersions=true output:artifacts:config=../legacy/charts/oam-kubernetes-runtime-legacy/crds //go:generate go run ../legacy/convert/main.go ../legacy/charts/oam-kubernetes-runtime-legacy/crds package apis diff --git a/build b/build index 3c47eae1..55bc4c0e 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 3c47eae15fc8ae3c3f2f00f11b551cb6c467610a +Subproject commit 55bc4c0e2a46c66ce1ca21d87e9f6abf85daec06