Skip to content
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3a61b40
Parallel tests running
craigell Jun 3, 2026
a760cb2
Changes after linting
craigell Jun 3, 2026
4cce5dc
Adding retry logic to upgrade tests
craigell Jun 4, 2026
2a27744
Merge branch 'main' into integration-timings
craigell Jun 4, 2026
3a0cc0f
Re-enable upgrade test
craigell Jun 4, 2026
877124c
Fix unit test
craigell Jun 5, 2026
ce255f6
PR feedback
craigell Jun 5, 2026
41be4e2
Add reliability to tests
craigell Jun 5, 2026
bd0551f
Restoring test
craigell Jun 5, 2026
2057d59
Merge branch 'main' into integration-timings
craigell Jun 9, 2026
494c4bc
Add assert eventually to test
craigell Jun 9, 2026
5b0d37f
Clean up errors
craigell Jun 9, 2026
1496045
Increase timeout
craigell Jun 9, 2026
74bdbc5
Update expected yaml
craigell Jun 9, 2026
02490be
Update dockerfiles to imprve build times
craigell Jun 11, 2026
2a62c9f
Merge branch 'main' into integration-timings
craigell Jun 11, 2026
a0e5d7d
Update dockerfiles
craigell Jun 12, 2026
d078f89
Fix dockerfiles
craigell Jun 12, 2026
7f9bd6b
Fix upgrade tests
craigell Jun 12, 2026
3ee9c04
Remove redundant commands
craigell Jun 15, 2026
f2aeaea
Breaking out the integration tests runs.
craigell Jun 15, 2026
52ffaa5
Revert "Breaking out the integration tests runs."
craigell Jun 15, 2026
15419a4
Merge branch 'main' into integration-timings
craigell Jun 19, 2026
78064a9
Merge changes
craigell Jun 19, 2026
558778c
Merge branch 'main' into integration-timings
craigell Jun 23, 2026
8d72f56
Merging main
craigell Jun 23, 2026
fea28e8
Merge branch 'main' into integration-timings
craigell Jun 25, 2026
9fa8bcf
Merging after main
craigell Jun 25, 2026
3ee345d
Merge branch 'main' into integration-timings
craigell Jun 26, 2026
f9e1f5f
Cleaning up Makefile
craigell Jun 26, 2026
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
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ jobs:

- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
OS_RELEASE="${{ matrix.container.image }}" OS_VERSION="${{ matrix.container.version }}" \
make integration-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
exit "${PIPESTATUS[0]}"
Expand Down Expand Up @@ -347,7 +346,6 @@ jobs:

- name: Run Upgrade Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
OS_RELEASE="${{ matrix.container.image }}" OS_VERSION="${{ matrix.container.version }}" \
make upgrade-test | tee ${{github.workspace}}/test/dashboard/logs/${{github.job}}/${{matrix.container.image}}-${{matrix.container.version}}/raw_logs.log
exit "${PIPESTATUS[0]}"
Expand Down Expand Up @@ -417,7 +415,6 @@ jobs:

- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
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 }}" \
Expand Down Expand Up @@ -516,7 +513,6 @@ jobs:

- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
CONTAINER_NGINX_IMAGE_REGISTRY="${{ env.nginx-private-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 }}" \
Expand Down Expand Up @@ -589,7 +585,6 @@ jobs:

- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
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 }}" \
Expand Down Expand Up @@ -685,7 +680,6 @@ jobs:

- name: Run Integration Tests
run: |
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }}
CONTAINER_NGINX_IMAGE_REGISTRY="${{ env.nginx-private-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 }}" \
Expand Down
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,17 @@ integration-test: $(SELECTED_PACKAGE) build-mock-management-plane-grpc
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) BUILD_TARGET="install-agent-local" CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} \
PACKAGES_REPO=$(OSS_PACKAGES_REPO) PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(DOCKERFILE_PATH) IMAGE_PATH=$(IMAGE_PATH) TAG=${IMAGE_TAG} \
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) \
go test -v ./test/integration/installuninstall ./test/integration/managementplane ./test/integration/auxiliarycommandserver ./test/integration/nginxless
go test -v -parallel 2 ./test/integration/installuninstall ./test/integration/nginxless

TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) BUILD_TARGET="install-agent-local" CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} \
PACKAGES_REPO=$(OSS_PACKAGES_REPO) PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(DOCKERFILE_PATH) IMAGE_PATH=$(IMAGE_PATH) TAG=${IMAGE_TAG} \
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) \
go test -v ./test/integration/managementplane

TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) BUILD_TARGET="install-agent-local" CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} \
PACKAGES_REPO=$(OSS_PACKAGES_REPO) PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(DOCKERFILE_PATH) IMAGE_PATH=$(IMAGE_PATH) TAG=${IMAGE_TAG} \
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) \
go test -v ./test/integration/auxiliarycommandserver

upgrade-test: $(SELECTED_PACKAGE) build-mock-management-plane-grpc
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) BUILD_TARGET="install-agent-repo" CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} \
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260415201107-50325440f8f2.1
buf.build/go/protovalidate v1.2.0
github.com/cenkalti/backoff/v4 v4.3.0
github.com/cenkalti/backoff/v6 v6.0.1
github.com/fsnotify/fsnotify v1.10.1
github.com/gabriel-vasile/mimetype v1.4.13
github.com/go-resty/resty/v2 v2.17.2
Expand Down
11 changes: 0 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK3
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cenkalti/backoff/v6 v6.0.1/go.mod h1:5WCmPelT2zwAaNETjGJVKHDnZvjQdPsGeHHwm5lIPPI=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
Expand Down Expand Up @@ -762,8 +761,6 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/testcontainers/testcontainers-go v0.42.0 h1:He3IhTzTZOygSXLJPMX7n44XtK+qhjat1nI9cneBbUY=
github.com/testcontainers/testcontainers-go v0.42.0/go.mod h1:vZjdY1YmUA1qEForxOIOazfsrdyORJAbhi0bp8plN30=
github.com/testcontainers/testcontainers-go v0.43.0 h1:oEQx5MW2DGd9z3AeEQfB2lPM0eLs7ztyaGRu75bFo5A=
github.com/testcontainers/testcontainers-go v0.43.0/go.mod h1:+VxkT2NQnKOZPKi6praMuMKYHYyOGXr0XSBSlSMCzFo=
github.com/tilinna/clock v1.1.0 h1:6IQQQCo6KoBxVudv6gwtY8o4eDfhHo8ojA5dP0MfhSs=
Expand Down Expand Up @@ -1082,8 +1079,6 @@ golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4=
golang.org/x/mod v0.36.0/go.mod h1:moc6ELqsWcOw5Ef3xVprK5ul/MvtVvkIXLziUOICjUQ=
golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ=
golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1120,8 +1115,6 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -1154,8 +1147,6 @@ golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa h1:efT73AJZfAAUV7SOip6pWGkwJDzIGiKBZGVzHYa+ve4=
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE=
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 h1:HjU6IWBiAgRIdAJ9/y1rwCn+UELEmwV+VsTLzj/W4sE=
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6/go.mod h1:Eqhaxk/wZsWEH8CRxLwj6xzEJbz7k1EFGqx7nyCoabE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down Expand Up @@ -1195,8 +1186,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
golang.org/x/tools v0.45.0 h1:18qN3FAooORvApf5XjCXgsuayZOEtXf6JK18I3+ONa8=
golang.org/x/tools v0.45.0/go.mod h1:LuUGqqaXcXMEFEruIVJVm5mgDD8vww/z/SR1gQ4uE/0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
13 changes: 7 additions & 6 deletions test/docker/nginx-oss/apk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ ARG ENTRY_POINT

WORKDIR /agent
COPY ./build /agent/build
COPY $ENTRY_POINT /agent/entrypoint.sh

RUN set -x \
&& addgroup -g 101 -S nginx \
&& adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx \
&& apk add ca-certificates \
curl \
openssl \
bash \
nginx
&& apk add --no-cache ca-certificates \
curl \
openssl \
bash \
procps \
nginx

COPY $ENTRY_POINT /agent/entrypoint.sh
RUN chmod +x /agent/entrypoint.sh
STOPSIGNAL SIGTERM

Expand Down
18 changes: 10 additions & 8 deletions test/docker/nginx-oss/deb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,27 @@ ARG PACKAGE_NAME
ARG PACKAGES_REPO

WORKDIR /agent
COPY ./build /agent/build
COPY $ENTRY_POINT /agent/entrypoint.sh

RUN set -x \
&& ls /usr/sbin/ \
&& groupadd --system --gid 101 nginx \
&& useradd --system --gid nginx --no-create-home --home /nonexistent --comment "nginx user" --shell /bin/false --uid 101 nginx \
&& apt-get update \
&& (apt-get update || (sleep 30 && apt-get update) || (sleep 60 && apt-get update)) \
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates \
gnupg2 \
git \
make \
curl \
lsb-release \
procps \
nginx
nginx \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Setup nginx agent repository
RUN curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null \
&& printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://${PACKAGES_REPO}/nginx-agent/ubuntu/ `lsb_release -cs` agent\n" > /etc/apt/sources.list.d/nginx-agent.list

COPY $ENTRY_POINT /agent/entrypoint.sh
RUN chmod +x /agent/entrypoint.sh
COPY ./build /agent/build
STOPSIGNAL SIGTERM

EXPOSE 80 443
Expand All @@ -44,4 +43,7 @@ RUN apt install -y /agent/build/$PACKAGE_NAME.deb

FROM install-nginx as install-agent-repo

RUN apt-get update && apt-get install -y nginx-agent
RUN (apt-get update || (sleep 30 && apt-get update) || (sleep 60 && apt-get update)) \
&& apt-get install -y nginx-agent \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
35 changes: 12 additions & 23 deletions test/docker/nginx-oss/rpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,13 @@ ARG OS_VERSION
ARG OS_RELEASE

WORKDIR /agent
COPY ./ /agent
COPY $ENTRY_POINT /agent/entrypoint.sh

RUN if [ "$OS_VERSION" = "7" ] && [ "$OS_RELEASE" = "oraclelinux" ]; \
then yum install -y oracle-epel-release-el7; \
fi
COPY ./build /agent/build

RUN if [ "$OS_VERSION" = "2" ] && [ "$OS_RELEASE" = "amazonlinux" ]; \
then amazon-linux-extras enable epel && yum clean metadata \
&& yum install -y epel-release; \
fi

RUN if [ "$OS_RELEASE" = "amazonlinux" ]; \
then yum install -y shadow-utils; \
fi

RUN if [ "$OS_RELEASE" = "centos" ] && [ "$OS_VERSION" = "7" ]; \
then yum install -y epel-release; \
fi
RUN set -x \
&& if [ "$OS_VERSION" = "7" ] && [ "$OS_RELEASE" = "oraclelinux" ]; then yum install -y oracle-epel-release-el7; fi \
&& if [ "$OS_VERSION" = "2" ] && [ "$OS_RELEASE" = "amazonlinux" ]; then amazon-linux-extras enable epel && yum clean metadata && yum install -y epel-release; fi \
&& if [ "$OS_RELEASE" = "amazonlinux" ]; then yum install -y shadow-utils; fi \
&& if [ "$OS_RELEASE" = "centos" ] && [ "$OS_VERSION" = "7" ]; then yum install -y epel-release; fi

RUN if [ "$OS_RELEASE" = "redhatenterprise" ] && [ "$OS_VERSION" != "9" ]; \
then printf "[nginx] \n\
Expand All @@ -42,11 +30,10 @@ RUN set -x \
&& adduser -g nginx --system --no-create-home --home /nonexistent --shell /bin/false --uid 101 nginx 2>/dev/null || true \
&& usermod -s /sbin/nologin nginx 2>/dev/null || true \
&& usermod -L nginx 2>/dev/null || true \
&& yum install -y git \
wget \
procps \
make \
nginx
&& yum install -y procps-ng \
nginx \
&& yum clean all \
&& rm -rf /var/cache/yum

# Setup nginx agent repository
RUN if [ "$OS_VERSION" = "2023" ] && [ "$OS_RELEASE" = "amazonlinux" ]; \
Expand Down Expand Up @@ -74,6 +61,7 @@ gpgkey=https://nginx.org/keys/nginx_signing.key \n\
module_hotfixes=true" > /etc/yum.repos.d/nginx-agent.repo; \
fi

COPY $ENTRY_POINT /agent/entrypoint.sh
RUN chmod +x /agent/entrypoint.sh

STOPSIGNAL SIGTERM
Expand All @@ -87,6 +75,7 @@ FROM install-nginx as install-agent-local

ARG PACKAGE_NAME

COPY ./build /agent/build
RUN yum localinstall -y /agent/build/${PACKAGE_NAME}.rpm


Expand Down
11 changes: 8 additions & 3 deletions test/docker/nginx-plus/deb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ ARG PACKAGE_NAME
ARG PACKAGES_REPO

WORKDIR /agent
COPY ./build /agent/build
COPY $ENTRY_POINT /agent/entrypoint.sh

ENV PLUS_VERSION=R32

Expand Down Expand Up @@ -57,11 +55,18 @@ EXPOSE 80

STOPSIGNAL SIGQUIT

COPY $ENTRY_POINT /agent/entrypoint.sh
RUN chmod +x /agent/entrypoint.sh
RUN apt install -y /agent/build/${PACKAGE_NAME}.deb

STOPSIGNAL SIGTERM

EXPOSE 80 443

ENTRYPOINT ["/agent/entrypoint.sh"]

FROM install-nginx as install-agent-local

ARG PACKAGE_NAME

COPY ./build /agent/build
RUN apt install -y /agent/build/$PACKAGE_NAME.deb
26 changes: 24 additions & 2 deletions test/helpers/test_containers_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io"
"os"
"testing"
"time"

"github.com/moby/moby/client"
"github.com/stretchr/testify/assert"
Expand All @@ -34,6 +35,11 @@ const (
tagKey = "TAG"
)

const (
extractFileMaxAttempts = 10
extractFileRetryDelay = 200 * time.Millisecond
)

type Parameters struct {
NginxConfigPath string
NginxAgentConfigPath string
Expand Down Expand Up @@ -509,8 +515,24 @@ func ExtractFileFromContainer(
containerPath string,
) string {
tb.Helper()
fileContent, err := testContainer.CopyFileFromContainer(ctx, containerPath)
require.NoError(tb, err)

Comment thread
craigell marked this conversation as resolved.
var fileContent io.ReadCloser
totalTimeout := time.Duration(extractFileMaxAttempts) * extractFileRetryDelay

assert.Eventually(tb, func() bool {
var err error
fileContent, err = testContainer.CopyFileFromContainer(ctx, containerPath)

return err == nil
}, totalTimeout, extractFileRetryDelay, "Failed to extract file %s", containerPath)

if fileContent == nil {
tb.Fatalf("Unable to extract file %s", containerPath)
}

defer func() {
require.NoError(tb, fileContent.Close())
}()

content, err := io.ReadAll(fileContent)
require.NoError(tb, err)
Expand Down
11 changes: 9 additions & 2 deletions test/integration/auxiliarycommandserver/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ import (
"github.com/stretchr/testify/suite"
)

const (
eventuallyTimeout = 1 * time.Second
eventuallyInterval = 100 * time.Millisecond
)

type AuxiliaryTestSuite struct {
suite.Suite
teardownTest func(tb testing.TB)
Expand Down Expand Up @@ -125,8 +130,10 @@ func (s *AuxiliaryTestSuite) TestAuxiliary_Test3_DataplaneHealthRequest() {
s.False(s.T().Failed())

// Check auxiliary server still only has 1 ManagementPlaneResponses as it didn't send the request
utils.ManagementPlaneResponses(s.T(), 0, utils.AuxiliaryMockManagementPlaneAPIAddress)
s.False(s.T().Failed())
s.Eventually(func() bool {
responses := utils.ManagementPlaneResponses(s.T(), 0, utils.AuxiliaryMockManagementPlaneAPIAddress)
return len(responses) == 0
}, eventuallyTimeout, eventuallyInterval, "Expected no responses from auxiliary server, got some")
slog.Info("finished auxiliary command server data plane health request test")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func installUninstallSetup(tb testing.TB, expectNoErrorsInLogs bool) (testcontai
}

func TestInstallUninstall(t *testing.T) {
t.Parallel()
testContainer, teardownTest := installUninstallSetup(t, true)
defer teardownTest(t)
ctx := context.Background()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

// Verify that the agent sends a connection request to Management Plane even when Nginx is not present
func TestNginxLessGrpc_Connection(t *testing.T) {
t.Parallel()
slog.Info("starting nginxless connection test")
teardownTest := utils.SetupConnectionTest(t, false, true, false,
"../../config/agent/nginx-config-with-grpc-client.conf")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ service:
pipelines:
metrics/default:
receivers:
- container_metrics
- host_metrics
- container_metrics
processors:
- batch/default_metrics
exporters:
Expand Down
2 changes: 1 addition & 1 deletion test/integration/upgrade/configs/otel/otel-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ service:
pipelines:
metrics/default:
receivers:
- container_metrics
- host_metrics
- container_metrics
processors:
- batch/default_metrics
exporters:
Expand Down
Loading
Loading