Skip to content

Update NGINX Plus in Integration Tests #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bb872d2
update nginx plus in workflow
spencerugbo Aug 13, 2025
da8471c
update protoc version
spencerugbo Aug 13, 2025
67dae8e
fix docker registry login
spencerugbo Aug 13, 2025
cd249ff
fix plus version in container matrix
spencerugbo Aug 13, 2025
699e839
test plus version as variable
spencerugbo Aug 14, 2025
84a7f0f
fix for setting plus version
spencerugbo Aug 14, 2025
8a1a3c1
use JWT for authentication
spencerugbo Aug 15, 2025
d06ec39
add jwt as env variable
spencerugbo Aug 15, 2025
2bec6fc
cleanup
spencerugbo Aug 15, 2025
e4bc9b9
cleanup
spencerugbo Aug 15, 2025
b580981
fix jwt env name
spencerugbo Aug 15, 2025
ee1d346
add jwt license to container
spencerugbo Aug 15, 2025
147eb9d
properly pass variable from host to container
spencerugbo Aug 15, 2025
1973846
small change to run command
spencerugbo Aug 18, 2025
3ad88a5
cleanup
spencerugbo Aug 18, 2025
7e87c98
added jwt variable to makefile command
spencerugbo Aug 18, 2025
681116e
add environment variable definition to workflow
spencerugbo Aug 18, 2025
5c3749f
add jwt to directory in container
spencerugbo Aug 18, 2025
44dcb36
add debug log
spencerugbo Aug 18, 2025
bdc601c
test other plus versions
spencerugbo Aug 18, 2025
f8c0180
test plus r34
spencerugbo Aug 18, 2025
b4db722
add debug log
spencerugbo Aug 19, 2025
c4b6d77
cleanup
spencerugbo Aug 19, 2025
3c9d395
add jwt definition to makefile
spencerugbo Aug 19, 2025
ef08b53
cleanup
spencerugbo Aug 19, 2025
488cef2
fix container matrix
spencerugbo Aug 19, 2025
ece3333
Merge branch 'main' into update-nginx-plus-in-integration-tests
spencerugbo Aug 19, 2025
2e626e9
Update ci.yml
spencerugbo Aug 19, 2025
3ea6180
Update ci.yml
spencerugbo Aug 20, 2025
a493038
Update ci.yml
spencerugbo Aug 20, 2025
8118aaf
Update ci.yml
spencerugbo Aug 20, 2025
6aa549b
update makefile
spencerugbo Aug 20, 2025
eefabe5
use jwt to login
spencerugbo Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ jobs:
CONTAINER_NGINX_IMAGE_REGISTRY="docker-registry.nginx.com" \
TAG="${{ matrix.container.version }}-${{ matrix.container.image }}" \
OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" \
NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" \
make official-image-integration-test

official-plus-image-integration-tests:
Expand All @@ -190,25 +191,15 @@ jobs:
matrix:
container:
- image: "alpine"
version: "3.20"
plus: "r32"
version: "3.21"
plus: "r34"
release: "alpine"
path: "/nginx-plus/agent"
- image: "alpine"
version: "3.19"
plus: "r31"
version: "3.20"
plus: "r33"
release: "alpine"
path: "/nginx-plus/agent"
- image: "debian"
version: "bookworm"
plus: "r32"
release: "debian"
path: "/nginx-plus/agent"
- image: "debian"
version: "bookworm"
plus: "r31"
release: "debian"
path: "/nginx-plus/agent"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
Expand All @@ -224,14 +215,15 @@ jobs:
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
username: ${{ secrets.NGINX_LICENSE_JWT }}
password: "none"
- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" \
TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \
OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \
NGINX_LICENSE_JWT='${{ secrets.NGINX_LICENSE_JWT }}' \
make official-image-integration-test

performance-tests:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ DOCKERFILE_PATH = "./test/docker/nginx-oss/$(CONTAINER_OS_TYPE)/Dockerfile"
OFFICIAL_IMAGE_DOCKERFILE_PATH = "./test/docker/nginx-official-image/$(CONTAINER_OS_TYPE)/Dockerfile"
IMAGE_PATH ?= "/nginx/agent"
TAG ?= ""
NGINX_LICENSE_JWT ?= ""

BUILD_DIR := build
TEST_BUILD_DIR := build/test
Expand Down Expand Up @@ -170,6 +171,7 @@ official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \
PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \
NGINX_LICENSE_JWT=$(NGINX_LICENSE_JWT) \
go test -v ./test/integration/managementplane ./test/integration/auxiliarycommandserver

performance-test:
Expand Down
10 changes: 10 additions & 0 deletions test/helpers/test_containers_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package helpers
import (
"context"
"io"
"os"
"testing"

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

var env map[string]string
if os.Getenv("NGINX_LICENSE_JWT") != "" {
nginxLicenseJwt := os.Getenv("NGINX_LICENSE_JWT")
env = map[string]string{
"NGINX_LICENSE_JWT": nginxLicenseJwt,
}
}

req := testcontainers.ContainerRequest{
FromDockerfile: testcontainers.FromDockerfile{
Context: "../../../",
Expand Down Expand Up @@ -87,6 +96,7 @@ func StartContainer(
FileMode: configFilePermissions,
},
},
Env: env,
}

container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
Expand Down
Loading