From c794e223edf9e97e8239805dba34679cbce3f444 Mon Sep 17 00:00:00 2001 From: Panos Xynos Date: Wed, 29 Nov 2023 10:47:13 +0000 Subject: [PATCH] [186049138] Postgresql is used in acceptance tests --- cf-acceptance-tests/Dockerfile | 31 ++++++++++--------- .../cf-acceptance-tests_spec.rb | 10 ++++++ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/cf-acceptance-tests/Dockerfile b/cf-acceptance-tests/Dockerfile index 388bea78..d0e4e708 100644 --- a/cf-acceptance-tests/Dockerfile +++ b/cf-acceptance-tests/Dockerfile @@ -1,17 +1,20 @@ FROM ghcr.io/alphagov/paas/ubuntu:main -RUN apt update \ - && apt install -y \ - build-essential \ - openssh-client \ - unzip \ - python3-pip \ - jq \ - git \ - fossil \ - mercurial \ - bzr \ - subversion +RUN wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc > /etc/apt/trusted.gpg.d/ACCC4CF8.asc \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list +RUN apt update && apt install -y \ + build-essential \ + openssh-client \ + unzip \ + python3-pip \ + jq \ + git \ + fossil \ + mercurial \ + bzr \ + subversion \ + postgresql-12 \ + postgresql-client-12 ENV GOPATH /go ENV PATH /go/bin:/usr/local/go/bin:$PATH @@ -30,8 +33,8 @@ RUN go install github.com/onsi/ginkgo/v2/ginkgo@latest # Install the cf CLI RUN wget -q -O cf.deb "https://packages.cloudfoundry.org/stable?release=debian64&version=${CF_CLI_VERSION}&source=github-rel" && \ - dpkg -i cf.deb && \ - rm -f cf.deb + dpkg -i cf.deb && \ + rm -f cf.deb # Setup plugins ENV CF_PLUGIN_HOME /root/ diff --git a/cf-acceptance-tests/cf-acceptance-tests_spec.rb b/cf-acceptance-tests/cf-acceptance-tests_spec.rb index ba187d5d..00702ba8 100644 --- a/cf-acceptance-tests/cf-acceptance-tests_spec.rb +++ b/cf-acceptance-tests/cf-acceptance-tests_spec.rb @@ -58,6 +58,16 @@ ).to eq(0) end + it "has psql available" do + expect( + command("psql --version").exit_status + ).to eq(0) + end + + it "can start postgresql" do + expect(Pathname.new('/usr/bin/pg_ctlcluster')).to exist + end + it "has the CF_PLUGIN_HOME variable set" do expect( command("env").stdout