diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f94c7468e..06484346b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -218,23 +218,23 @@ jobs: matrix: container: - image: "alpine" - version: "3.20" - plus: "r32" + version: "3.22" + plus: "r35" release: "alpine" path: "/nginx-plus/agent" - image: "alpine" - version: "3.19" - plus: "r31" + version: "3.21" + plus: "r34" release: "alpine" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r32" + plus: "r35" release: "debian" path: "/nginx-plus/agent" - image: "debian" version: "bookworm" - plus: "r31" + plus: "r34" release: "debian" path: "/nginx-plus/agent" steps: @@ -251,7 +251,7 @@ jobs: - name: Login to Docker Registry uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: - registry: ${{ secrets.REGISTRY_URL }} + registry: ${{ secrets.TEST_REGISTRY_URL }} username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} @@ -266,9 +266,10 @@ jobs: - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} - CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" \ + CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.TEST_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.TEST_JWT }}' \ make official-image-integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log exit "${PIPESTATUS[0]}" diff --git a/Makefile b/Makefile index d436d3582..180f43115 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: diff --git a/test/helpers/test_containers_utils.go b/test/helpers/test_containers_utils.go index f90ab3182..2df3c1275 100644 --- a/test/helpers/test_containers_utils.go +++ b/test/helpers/test_containers_utils.go @@ -8,6 +8,7 @@ package helpers import ( "context" "io" + "os" "testing" "github.com/docker/docker/api/types" @@ -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: "../../../", @@ -87,6 +96,7 @@ func StartContainer( FileMode: configFilePermissions, }, }, + Env: env, } container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{