From c783081240ac29166b48e77ca6512314c8e14c27 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Fri, 31 May 2024 15:17:48 -0700 Subject: [PATCH 1/3] Run functional tests with LoadBalancer --- .github/workflows/functional.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index dadd05e0f6..e8e971c763 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -98,6 +98,14 @@ jobs: NGINX_CONF_DIR=internal/mode/static/nginx/conf BUILD_AGENT=gha + - name: Install cloud-provider-kind + run: | + curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.2.0/cloud-provider-kind_0.2.0_linux_amd64.tar.gz + tar -xvf cloud-provider-kind_0.2.0_linux_amd64.tar.gz + + - name: Run cloud-provider-kind + run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1 + - name: Deploy Kubernetes id: k8s run: | @@ -108,12 +116,12 @@ jobs: run: | ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric ngf_tag=${{ steps.ngf-meta.outputs.version }} - make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry + make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GINKGO_LABEL=telemetry GW_SERVICE_TYPE=LoadBalancer working-directory: ./tests - name: Run functional tests run: | ngf_prefix=ghcr.io/nginxinc/nginx-gateway-fabric ngf_tag=${{ steps.ngf-meta.outputs.version }} - make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} + make test${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag} GW_SERVICE_TYPE=LoadBalancer working-directory: ./tests From 6ce21742bac161b04889bd85d896fc4a05f7970d Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Fri, 31 May 2024 15:39:11 -0700 Subject: [PATCH 2/3] Only build binary for single target --- .github/workflows/conformance.yml | 2 +- .github/workflows/functional.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index d6d3c1a3a3..8dea722b3d 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -80,7 +80,7 @@ jobs: uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 with: version: latest - args: build --snapshot --clean + args: build --single-target --snapshot --clean env: TELEMETRY_ENDPOINT: "" # disables sending telemetry TELEMETRY_ENDPOINT_INSECURE: "false" diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index e8e971c763..6b9953415b 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -68,7 +68,7 @@ jobs: uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 with: version: latest - args: build --snapshot --clean + args: build --single-target --snapshot --clean env: TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317 TELEMETRY_ENDPOINT_INSECURE: "true" From c053630ac9a25f4bac2fd4fe43ea357d9f464b21 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Fri, 31 May 2024 18:19:28 -0700 Subject: [PATCH 3/3] remove unused variable --- tests/Makefile | 5 ++--- tests/framework/ngf.go | 2 +- tests/suite/system_suite_test.go | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index eacc490596..21d01dee4a 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -9,7 +9,6 @@ GW_API_VERSION ?= $(shell sed -n 's/.*ref=v\(.*\)/\1/p' ../config/crd/gateway-ap GW_API_PREV_VERSION ?= 1.0.0## Supported Gateway API version from previous NGF release GW_SERVICE_TYPE = NodePort## Service type to use for the gateway GW_SVC_GKE_INTERNAL = false -K8S_VERSION ?= latest## Kubernetes version to use. Expected format: 1.24 (major.minor) or latest NGF_VERSION ?= $(shell git describe --tags $(shell git rev-list --tags --max-count=1))## NGF version to be tested (defaults to latest tag) PULL_POLICY = Never## Pull policy for the images PROVISIONER_MANIFEST = conformance/provisioner/provisioner.yaml @@ -114,7 +113,7 @@ stop-longevity-test: nfr-test ## Stop the longevity test and collects results --label-filter "nfr" $(GINKGO_FLAGS) ./suite -- --gateway-api-version=$(GW_API_VERSION) \ --gateway-api-prev-version=$(GW_API_PREV_VERSION) --image-tag=$(TAG) --version-under-test=$(NGF_VERSION) \ --plus-enabled=$(PLUS_ENABLED) --ngf-image-repo=$(PREFIX) --nginx-image-repo=$(NGINX_PREFIX) --nginx-plus-image-repo=$(NGINX_PLUS_PREFIX) \ - --pull-policy=$(PULL_POLICY) --k8s-version=$(K8S_VERSION) --service-type=$(GW_SERVICE_TYPE) \ + --pull-policy=$(PULL_POLICY) --service-type=$(GW_SERVICE_TYPE) \ --is-gke-internal-lb=$(GW_SVC_GKE_INTERNAL) .PHONY: test @@ -124,7 +123,7 @@ test: ## Runs the functional tests on your default k8s cluster --gateway-api-version=$(GW_API_VERSION) --gateway-api-prev-version=$(GW_API_PREV_VERSION) \ --image-tag=$(TAG) --version-under-test=$(NGF_VERSION) \ --plus-enabled=$(PLUS_ENABLED) --ngf-image-repo=$(PREFIX) --nginx-image-repo=$(NGINX_PREFIX) --nginx-plus-image-repo=$(NGINX_PLUS_PREFIX) \ - --pull-policy=$(PULL_POLICY) --k8s-version=$(K8S_VERSION) --service-type=$(GW_SERVICE_TYPE) \ + --pull-policy=$(PULL_POLICY) --service-type=$(GW_SERVICE_TYPE) \ --is-gke-internal-lb=$(GW_SVC_GKE_INTERNAL) .PHONY: test-with-plus diff --git a/tests/framework/ngf.go b/tests/framework/ngf.go index 5c6695ee8c..e2f2eb97ab 100644 --- a/tests/framework/ngf.go +++ b/tests/framework/ngf.go @@ -43,7 +43,7 @@ func InstallGatewayAPI(apiVersion string) ([]byte, error) { } // UninstallGatewayAPI uninstalls the specified version of the Gateway API resources. -func UninstallGatewayAPI(apiVersion, k8sVersion string) ([]byte, error) { +func UninstallGatewayAPI(apiVersion string) ([]byte, error) { apiPath := fmt.Sprintf("%s/v%s/standard-install.yaml", gwInstallBasePath, apiVersion) output, err := exec.Command("kubectl", "delete", "-f", apiPath).CombinedOutput() diff --git a/tests/suite/system_suite_test.go b/tests/suite/system_suite_test.go index 3cb155a3b9..ab927649fd 100644 --- a/tests/suite/system_suite_test.go +++ b/tests/suite/system_suite_test.go @@ -48,7 +48,6 @@ var ( gatewayAPIPrevVersion = flag.String( "gateway-api-prev-version", "", "Supported Gateway API version for previous NGF release", ) - k8sVersion = flag.String("k8s-version", "latest", "Version of k8s being tested on") // Configurable NGF installation variables. Helm values will be used as defaults if not specified. ngfImageRepository = flag.String("ngf-image-repo", "", "Image repo for NGF control plane") nginxImageRepository = flag.String("nginx-image-repo", "", "Image repo for NGF data plane") @@ -214,7 +213,7 @@ func teardown(relName string) { output, err := framework.UninstallNGF(cfg, k8sClient) Expect(err).ToNot(HaveOccurred(), string(output)) - output, err = framework.UninstallGatewayAPI(*gatewayAPIVersion, *k8sVersion) + output, err = framework.UninstallGatewayAPI(*gatewayAPIVersion) Expect(err).ToNot(HaveOccurred(), string(output)) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)