Skip to content

[stable13] Fix integration tests with Docker image for PostgreSQL 10.5#1212

Merged
nickvergessen merged 1 commit intostable13from
stable13-1205-fix-integration-tests-with-docker-image-for-postgresql-10.5
Sep 25, 2018
Merged

[stable13] Fix integration tests with Docker image for PostgreSQL 10.5#1212
nickvergessen merged 1 commit intostable13from
stable13-1205-fix-integration-tests-with-docker-image-for-postgresql-10.5

Conversation

@danxuliu
Copy link
Member

Backport of #1205

The `postgres:10` tag is not fixed, but updated every time a new
`postgres:10.X` image is released. Thus, the integration tests run in
Drone always use the latest Docker image for PostgreSQL 10.

The parameters used for the Docker container of PostgreSQL relied on a
bug in both the Nextcloud installer and in the Docker image for
PostgreSQL; the bug in the image was fixed in "postgres:10.5", so the
tests started to fail due to not being able to install Nextcloud.

The database user created in the image did not have "create role"
privileges, so that user was the one used by the Nextcloud installer.
After the fix it does, so the Nextcloud installer creates and uses a new
user instead. However, if an existing database name is given to the
installer the installer does not grant privileges to that new user on
the existing database.

By default the container creates a new database with the same name as
the database user ("oc_autotest"), and that database was passed to the
installer. Thus, as the new user was not granted privileges on the
existing database it could not connect to it and the installation failed.

Now the container creates a dummy database with a different name to the
one passed to the installer, so now the "oc_autotest" database is
created by the installer and the new user is made owner of that new
database.

Note that this fix is backwards compatible with PostgreSQL images prior
to the fix, so no special handling is needed in `run-docker.sh` when
older images are used.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@nickvergessen nickvergessen added this to the 💜 Next Minor (13) milestone Sep 25, 2018
@nickvergessen nickvergessen merged commit a4f6be6 into stable13 Sep 25, 2018
@nickvergessen nickvergessen deleted the stable13-1205-fix-integration-tests-with-docker-image-for-postgresql-10.5 branch September 25, 2018 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants