diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 91e8a5480..4164ba8da 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -10,6 +10,7 @@ include: - key: $CI_COMMIT_REF_SLUG paths: - .go/pkg/mod/ + variables: GOVERSION: "1.16.10" @@ -220,6 +221,22 @@ clustertests: script: - make clustertests +external lookup tests: + stage: integration + image: golang:$GOVERSION + variables: + POSTGRES_DB: $POSTGRES_DB + POSTGRES_USER: $POSTGRES_USER + POSTGRES_PASSWORD: $POSTGRES_PASSWORD + POSTGRES_HOST_AUTH_METHOD: trust + services: + - postgres:13.5 + script: + - apt-get update --allow-releaseinfo-change -y + - apt-get install -y postgresql-client + - go test . -run "^TestExternalLookup" -externalLookupDSN postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres/$POSTGRES_DB?sslmode=disable + + smoke test: stage: integration image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest diff --git a/internal/clustertests/cluster_test.go b/internal/clustertests/cluster_test.go index 806d68101..79d067ad4 100644 --- a/internal/clustertests/cluster_test.go +++ b/internal/clustertests/cluster_test.go @@ -4,6 +4,7 @@ package clustertest import ( "context" "fmt" + "io" "net/http" "os" "os/exec" @@ -124,7 +125,11 @@ func TestClusterStuff(t *testing.T) { } else if resp, err := client.Do(req); err != nil { t.Fatalf("doing request: %v", err) } else if resp.StatusCode >= 400 { - t.Fatalf("bad response: %v", resp) + bod, readErr := io.ReadAll(resp.Body) + if readErr != nil { + t.Logf("reading error body: %v", readErr) + } + t.Fatalf("deleting index: code=%d, body=%s", resp.StatusCode, bod) } var restoreCmd *exec.Cmd