From f9394b2ed17acefdddb8ebaa56d202e458890a28 Mon Sep 17 00:00:00 2001 From: Jintao Zhang Date: Wed, 15 Nov 2023 01:11:59 +0800 Subject: [PATCH 1/3] chore(ci): easy to bump ginkgo's version Signed-off-by: Jintao Zhang --- Makefile | 2 +- build/run-in-docker.sh | 4 ---- images/test-runner/rootfs/Dockerfile | 4 +--- test/e2e/run-chart-test.sh | 3 --- test/e2e/run-kind-e2e.sh | 4 ---- tools/ginkgo.go | 7 +++++++ 6 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 tools/ginkgo.go diff --git a/Makefile b/Makefile index cbda4dafb0..f140453964 100644 --- a/Makefile +++ b/Makefile @@ -172,7 +172,7 @@ kind-e2e-chart-tests: ## Run helm chart e2e tests e2e-test-binary: ## Build binary for e2e tests. @build/run-in-docker.sh \ MAC_OS=$(MAC_OS) \ - ginkgo build ./test/e2e + GOBIN=/tmp/bin go generate tools/ginkgo.go && /tmp/bin/ginkgo build ./test/e2e .PHONY: print-e2e-suite print-e2e-suite: e2e-test-binary ## Prints information about the suite of e2e tests. diff --git a/build/run-in-docker.sh b/build/run-in-docker.sh index bec8252916..453e9e8ad1 100755 --- a/build/run-in-docker.sh +++ b/build/run-in-docker.sh @@ -86,10 +86,6 @@ USER=${USER:-nobody} if [[ "$DOCKER_IN_DOCKER_ENABLED" == "true" ]]; then echo "..reached DIND check TRUE block, inside run-in-docker.sh" echo "FLAGS=$FLAGS" - #go env - go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@v2.13.0 - find / -type f -name ginkgo 2>/dev/null - which ginkgo /bin/bash -c "${FLAGS}" else echo "Reached DIND check ELSE block, inside run-in-docker.sh" diff --git a/images/test-runner/rootfs/Dockerfile b/images/test-runner/rootfs/Dockerfile index 161b6caf46..536ed51b5e 100644 --- a/images/test-runner/rootfs/Dockerfile +++ b/images/test-runner/rootfs/Dockerfile @@ -30,7 +30,6 @@ ARG CHART_TESTING_VERSION ARG HELM_VERSION ARG YAMALE_VERSION ARG YAML_LINT_VERSION -ARG GINKGO_VERSION ARG GOLINT_VERSION @@ -68,8 +67,7 @@ RUN apk update && apk upgrade && apk add --no-cache \ tzdata \ libc6-compat -RUN go install -v github.com/onsi/ginkgo/v2/ginkgo@v${GINKGO_VERSION} \ - && go install golang.org/x/lint/golint@${GOLINT_VERSION} +RUN go install golang.org/x/lint/golint@${GOLINT_VERSION} RUN wget -qO /tmp/resty_cli.tgz \ https://github.com/openresty/resty-cli/archive/v${RESTY_CLI_VERSION}.tar.gz \ diff --git a/test/e2e/run-chart-test.sh b/test/e2e/run-chart-test.sh index 425d043e92..910d74103c 100755 --- a/test/e2e/run-chart-test.sh +++ b/test/e2e/run-chart-test.sh @@ -77,9 +77,6 @@ if [ "${SKIP_CLUSTER_CREATION:-false}" = "false" ]; then fi if [ "${SKIP_IMAGE_CREATION:-false}" = "false" ]; then - if ! command -v ginkgo &> /dev/null; then - go install github.com/onsi/ginkgo/v2/ginkgo@v2.13.0 - fi echo "[dev-env] building image" make -C ${DIR}/../../ clean-image build image fi diff --git a/test/e2e/run-kind-e2e.sh b/test/e2e/run-kind-e2e.sh index 5c4ba5c1ea..2d1c3a6a49 100755 --- a/test/e2e/run-kind-e2e.sh +++ b/test/e2e/run-kind-e2e.sh @@ -95,10 +95,6 @@ if [ "${SKIP_INGRESS_IMAGE_CREATION}" = "false" ]; then fi if [ "${SKIP_E2E_IMAGE_CREATION}" = "false" ]; then - if ! command -v ginkgo &> /dev/null; then - go install github.com/onsi/ginkgo/v2/ginkgo@v2.13.0 - fi - echo "[dev-env] .. done building controller images" echo "[dev-env] now building e2e-image.." make -C "${DIR}"/../e2e-image image diff --git a/tools/ginkgo.go b/tools/ginkgo.go new file mode 100644 index 0000000000..98b0f9f680 --- /dev/null +++ b/tools/ginkgo.go @@ -0,0 +1,7 @@ +package tools + +import ( + _ "github.com/onsi/ginkgo/v2/ginkgo" +) + +//go:generate go install github.com/onsi/ginkgo/v2/ginkgo From f540cd9b0a9602cfd85981bf1552e8c92e46ff0d Mon Sep 17 00:00:00 2001 From: Jintao Zhang Date: Wed, 15 Nov 2023 01:36:38 +0800 Subject: [PATCH 2/3] fix template header Signed-off-by: Jintao Zhang --- go.work.sum | 2 ++ tools/ginkgo.go | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/go.work.sum b/go.work.sum index 91bbfc14a4..f1f07229eb 100644 --- a/go.work.sum +++ b/go.work.sum @@ -255,6 +255,7 @@ golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= @@ -267,6 +268,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/tools/ginkgo.go b/tools/ginkgo.go index 98b0f9f680..f09552d7f8 100644 --- a/tools/ginkgo.go +++ b/tools/ginkgo.go @@ -1,3 +1,21 @@ +//go:build ignore + +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package tools import ( From 6ed826f743cd2ba28444a162179d5ecf8e9bbf75 Mon Sep 17 00:00:00 2001 From: Jintao Zhang Date: Wed, 15 Nov 2023 10:35:21 +0800 Subject: [PATCH 3/3] add debug log Signed-off-by: Jintao Zhang --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f140453964..c7322706a6 100644 --- a/Makefile +++ b/Makefile @@ -172,7 +172,7 @@ kind-e2e-chart-tests: ## Run helm chart e2e tests e2e-test-binary: ## Build binary for e2e tests. @build/run-in-docker.sh \ MAC_OS=$(MAC_OS) \ - GOBIN=/tmp/bin go generate tools/ginkgo.go && /tmp/bin/ginkgo build ./test/e2e + GOBIN=/tmp/bin go generate tools/ginkgo.go && ls /tmp/bin/ginkgo && /tmp/bin/ginkgo build ./test/e2e .PHONY: print-e2e-suite print-e2e-suite: e2e-test-binary ## Prints information about the suite of e2e tests.