From 95028e28e84b106a526d10fdc37ac9b84f6a8789 Mon Sep 17 00:00:00 2001 From: Slach Date: Wed, 2 Aug 2023 21:02:08 +0400 Subject: [PATCH] fix Dockefile, remove go build -a, fix integration_test.go, skip TestFIPS if QA_AWS_ACCESS_KEY is empty in secrets --- Dockerfile | 3 ++- test/integration/integration_test.go | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1ad9676f..3229029f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 ARG CLICKHOUSE_VERSION=latest ARG CLICKHOUSE_IMAGE=clickhouse/clickhouse-server @@ -33,7 +34,7 @@ FROM builder-base AS builder-race ARG TARGETPLATFORM COPY ./ /src/ RUN mkdir -p ./clickhouse-backup/ -RUN --mount=type=cache,id=clickhouse-backup-gobuild,target=/root/ GOOS=$( echo ${TARGETPLATFORM} | cut -d "/" -f 1) GOARCH=$( echo ${TARGETPLATFORM} | cut -d "/" -f 2) CC=musl-gcc CGO_ENABLED=1 go build -a -cover -buildvcs=false -ldflags "-X 'main.version=race' -linkmode=external -extldflags '-static'" -race -o ./clickhouse-backup/clickhouse-backup-race ./cmd/clickhouse-backup +RUN --mount=type=cache,id=clickhouse-backup-gobuild,target=/root/ GOOS=$( echo ${TARGETPLATFORM} | cut -d "/" -f 1) GOARCH=$( echo ${TARGETPLATFORM} | cut -d "/" -f 2) CC=musl-gcc CGO_ENABLED=1 go build -cover -buildvcs=false -ldflags "-X 'main.version=race' -linkmode=external -extldflags '-static'" -race -o ./clickhouse-backup/clickhouse-backup-race ./cmd/clickhouse-backup RUN cp -l ./clickhouse-backup/clickhouse-backup-race /bin/clickhouse-backup && echo "$(ldd ./clickhouse-backup/clickhouse-backup-race 2>&1 || true)" | grep -c "not a dynamic executable" RUN --mount=type=cache,id=clickhouse-backup-gobuild,target=/root/ GOOS=$( echo ${TARGETPLATFORM} | cut -d "/" -f 1) GOARCH=$( echo ${TARGETPLATFORM} | cut -d "/" -f 2) GOEXPERIMENT=boringcrypto CC=musl-gcc CGO_ENABLED=1 go build -cover -buildvcs=false -ldflags "-X 'main.version=race-fips' -linkmode=external -extldflags '-static'" -race -o ./clickhouse-backup/clickhouse-backup-race-fips ./cmd/clickhouse-backup RUN cp -l ./clickhouse-backup/clickhouse-backup-race-fips /bin/clickhouse-backup-fips && echo "$(ldd ./clickhouse-backup/clickhouse-backup-race-fips 2>&1 || true)" | grep -c "not a dynamic executable" diff --git a/test/integration/integration_test.go b/test/integration/integration_test.go index 59642949..86562a69 100644 --- a/test/integration/integration_test.go +++ b/test/integration/integration_test.go @@ -924,6 +924,9 @@ func TestInnerTablesMaterializedView(t *testing.T) { ch.queryWithNoError(r, "DROP DATABASE test_mv") } func TestFIPS(t *testing.T) { + if os.Getenv("QA_AWS_ACCESS_KEY") == "" { + t.Skip("QA_AWS_ACCESS_KEY is empty, TestFIPS will skip") + } ch := &TestClickHouse{} r := require.New(t) ch.connectWithWait(r, 1*time.Second, 10*time.Second)