Skip to content

Commit 9d7b912

Browse files
committed
Merge pull request #318 from alphagov/186049138-postgresql-in-cf-acce…
…ptance-tests [186049138] Postgresql is used in acceptance tests
2 parents c95d8a7 + cae4481 commit 9d7b912

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

cf-acceptance-tests/Dockerfile

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
FROM ghcr.io/alphagov/paas/ubuntu:main
22

3-
RUN apt update \
4-
&& apt install -y \
5-
build-essential \
6-
openssh-client \
7-
unzip \
8-
python3-pip \
9-
jq \
10-
git \
11-
fossil \
12-
mercurial \
13-
bzr \
14-
subversion
3+
RUN wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc > /etc/apt/trusted.gpg.d/ACCC4CF8.asc \
4+
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list
5+
RUN apt update && apt install -y \
6+
build-essential \
7+
openssh-client \
8+
unzip \
9+
python3-pip \
10+
jq \
11+
git \
12+
fossil \
13+
mercurial \
14+
bzr \
15+
subversion \
16+
postgresql-12 \
17+
postgresql-client-12
1518

1619
ENV GOPATH /go
1720
ENV PATH /go/bin:/usr/local/go/bin:$PATH
@@ -30,8 +33,8 @@ RUN go install github.com/onsi/ginkgo/v2/ginkgo@latest
3033

3134
# Install the cf CLI
3235
RUN wget -q -O cf.deb "https://packages.cloudfoundry.org/stable?release=debian64&version=${CF_CLI_VERSION}&source=github-rel" && \
33-
dpkg -i cf.deb && \
34-
rm -f cf.deb
36+
dpkg -i cf.deb && \
37+
rm -f cf.deb
3538

3639
# Setup plugins
3740
ENV CF_PLUGIN_HOME /root/

cf-acceptance-tests/cf-acceptance-tests_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'spec_helper'
22
require 'docker'
33
require 'serverspec'
4+
require 'pathname'
45

56
GO_VERSION="1.21.1"
67
CF_CLI_VERSION="8.6.0"
@@ -58,6 +59,16 @@
5859
).to eq(0)
5960
end
6061

62+
it "has psql available" do
63+
expect(
64+
command("psql --version").exit_status
65+
).to eq(0)
66+
end
67+
68+
it "has postgresql startup script" do
69+
expect(Pathname.new('/usr/bin/pg_ctlcluster')).to exist
70+
end
71+
6172
it "has the CF_PLUGIN_HOME variable set" do
6273
expect(
6374
command("env").stdout

0 commit comments

Comments
 (0)