From b192640832be15a41c7990295914a6bc3f065308 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 2 Nov 2023 10:24:46 +0100 Subject: [PATCH 1/5] Build test container on CPaaS workflow Since the integration tests have been containerized, the CPaaS workflow needs to build the image in order for it to be able to run the tests. --- .github/workflows/cpaas.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/cpaas.yml b/.github/workflows/cpaas.yml index 35e77bed12..97a918417b 100644 --- a/.github/workflows/cpaas.yml +++ b/.github/workflows/cpaas.yml @@ -88,6 +88,16 @@ jobs: - build-collector-slim - sync-drivers-and-support-packages + build-test-containers: + uses: ./.github/workflows/integration-test-containers.yml + needs: + - init + with: + collector-tag: ${{ needs.init.outputs.collector-tag }}-cpaas + collector-qa-tag: ${{ needs.init.outputs.collector-qa-tag }} + rebuild-qa-containers: ${{ needs.init.outputs.rebuild-qa-containers == 'true' }} + secrets: inherit + integration-tests: uses: ./.github/workflows/integration-tests-vm-type.yml if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }} From 926ddbbbc1835310afc170fb954b7cb9a225948d Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 2 Nov 2023 11:12:25 +0100 Subject: [PATCH 2/5] Try setting os and arch for integration tests build --- integration-tests/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/Dockerfile b/integration-tests/Dockerfile index af783b43d4..23679a104d 100644 --- a/integration-tests/Dockerfile +++ b/integration-tests/Dockerfile @@ -13,7 +13,7 @@ COPY go.* "$TEST_ROOT" WORKDIR "$TEST_ROOT" -RUN CGO_ENABLED=0 go test -tags bench -c -o collector-tests +RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go test -tags bench -c -o collector-tests FROM --platform=$BUILDPLATFORM alpine:3.18 From ab4e889b55d3350bf387a14311a4c386f9742e5a Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 2 Nov 2023 11:24:22 +0100 Subject: [PATCH 3/5] Test removing BUILDPLATFORM --- integration-tests/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-tests/Dockerfile b/integration-tests/Dockerfile index 23679a104d..c9a92c740b 100644 --- a/integration-tests/Dockerfile +++ b/integration-tests/Dockerfile @@ -1,6 +1,6 @@ ARG TEST_ROOT="/tests" -FROM --platform=$BUILDPLATFORM golang:1.19 as builder +FROM golang:1.19 as builder ARG TEST_ROOT @@ -13,9 +13,9 @@ COPY go.* "$TEST_ROOT" WORKDIR "$TEST_ROOT" -RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go test -tags bench -c -o collector-tests +RUN CGO_ENABLED=0 go test -tags bench -c -o collector-tests -FROM --platform=$BUILDPLATFORM alpine:3.18 +FROM alpine:3.18 ARG TEST_ROOT From 1aa677914664865acbcceba496e9967ebbedb700 Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 2 Nov 2023 11:35:40 +0100 Subject: [PATCH 4/5] Add missing dependency --- .github/workflows/cpaas.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpaas.yml b/.github/workflows/cpaas.yml index 97a918417b..7be337848a 100644 --- a/.github/workflows/cpaas.yml +++ b/.github/workflows/cpaas.yml @@ -119,6 +119,7 @@ jobs: needs: - init - build-collector-full + - build-test-containers secrets: inherit # Isolating multi-arch testing temporarily while fixes are found for ppc64le From dbfe0e737eb4fc7c0a6740d5a8aadfaad678c52d Mon Sep 17 00:00:00 2001 From: Mauro Ezequiel Moltrasio Date: Thu, 2 Nov 2023 14:44:19 +0100 Subject: [PATCH 5/5] Empty commit for CI