Skip to content

Commit 96f04b9

Browse files
authored
Update NGINX Plus in Integration Tests (#1212)
* update nginx plus in workflow * update protoc version * fix docker registry login * fix plus version in container matrix * test plus version as variable * fix for setting plus version * use JWT for authentication * add jwt as env variable * cleanup * cleanup * fix jwt env name * add jwt license to container * properly pass variable from host to container * small change to run command * cleanup * added jwt variable to makefile command * add environment variable definition to workflow * add jwt to directory in container * add debug log * test other plus versions * test plus r34 * add debug log * cleanup * add jwt definition to makefile * cleanup * fix container matrix * Update ci.yml * Update ci.yml * Update ci.yml * Update ci.yml * update makefile * use jwt to login * revert login * cleanup * test working JWT * test with v3 * add debian image back to test * add prefix to image tags * test only debian images * change used registry * Update ci.yml
1 parent 5e9af72 commit 96f04b9

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,23 +262,23 @@ jobs:
262262
matrix:
263263
container:
264264
- image: "alpine"
265-
version: "3.20"
266-
plus: "r32"
265+
version: "3.22"
266+
plus: "r35"
267267
release: "alpine"
268268
path: "/nginx-plus/agent"
269269
- image: "alpine"
270-
version: "3.19"
271-
plus: "r31"
270+
version: "3.21"
271+
plus: "r34"
272272
release: "alpine"
273273
path: "/nginx-plus/agent"
274274
- image: "debian"
275275
version: "bookworm"
276-
plus: "r32"
276+
plus: "r35"
277277
release: "debian"
278278
path: "/nginx-plus/agent"
279279
- image: "debian"
280280
version: "bookworm"
281-
plus: "r31"
281+
plus: "r34"
282282
release: "debian"
283283
path: "/nginx-plus/agent"
284284
steps:
@@ -295,7 +295,7 @@ jobs:
295295
- name: Login to Docker Registry
296296
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
297297
with:
298-
registry: ${{ secrets.REGISTRY_URL }}
298+
registry: ${{ secrets.TEST_REGISTRY_URL }}
299299
username: ${{ secrets.REGISTRY_USERNAME }}
300300
password: ${{ secrets.REGISTRY_PASSWORD }}
301301

@@ -310,9 +310,10 @@ jobs:
310310
- name: Run Integration Tests
311311
run: |
312312
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
313-
CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" \
313+
CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.TEST_REGISTRY_URL }}" \
314314
TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \
315315
OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \
316+
NGINX_LICENSE_JWT='${{ secrets.TEST_JWT }}' \
316317
make official-image-integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
317318
exit "${PIPESTATUS[0]}"
318319

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ DOCKERFILE_PATH = "./test/docker/nginx-oss/$(CONTAINER_OS_TYPE)/Dockerfile"
3434
OFFICIAL_IMAGE_DOCKERFILE_PATH = "./test/docker/nginx-official-image/$(CONTAINER_OS_TYPE)/Dockerfile"
3535
IMAGE_PATH ?= "/nginx/agent"
3636
TAG ?= ""
37+
NGINX_LICENSE_JWT ?= ""
3738

3839
BUILD_DIR := build
3940
TEST_BUILD_DIR := build/test
@@ -177,6 +178,7 @@ official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane
177178
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \
178179
PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \
179180
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \
181+
NGINX_LICENSE_JWT=$(NGINX_LICENSE_JWT) \
180182
go test -v ./test/integration/managementplane ./test/integration/auxiliarycommandserver
181183

182184
performance-test:

test/helpers/test_containers_utils.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package helpers
88
import (
99
"context"
1010
"io"
11+
"os"
1112
"testing"
1213

1314
"github.com/docker/docker/api/types"
@@ -44,6 +45,14 @@ func StartContainer(
4445
tag := Env(tb, "TAG")
4546
imagePath := Env(tb, "IMAGE_PATH")
4647

48+
var env map[string]string
49+
if os.Getenv("NGINX_LICENSE_JWT") != "" {
50+
nginxLicenseJwt := os.Getenv("NGINX_LICENSE_JWT")
51+
env = map[string]string{
52+
"NGINX_LICENSE_JWT": nginxLicenseJwt,
53+
}
54+
}
55+
4756
req := testcontainers.ContainerRequest{
4857
FromDockerfile: testcontainers.FromDockerfile{
4958
Context: "../../../",
@@ -92,6 +101,7 @@ func StartContainer(
92101
FileMode: configFilePermissions,
93102
},
94103
},
104+
Env: env,
95105
}
96106

97107
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{

0 commit comments

Comments
 (0)