Skip to content

Commit

Permalink
[186049138] Postgresql is used in acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dark5un committed Nov 30, 2023
1 parent c95d8a7 commit c794e22
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
31 changes: 17 additions & 14 deletions cf-acceptance-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/
Expand Down
10 changes: 10 additions & 0 deletions cf-acceptance-tests/cf-acceptance-tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c794e22

Please sign in to comment.