diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-09-21 15:48:11 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-09-21 15:48:11 +0300 |
commit | ce32abe48b2ae350320fbb9631b42a09196a4b08 (patch) | |
tree | 138c3118f83b3932c25150859a5c2b7c38e6591b /.drone.yml | |
parent | b590daec094c8372c8ac86e70ea3d0aac72d23fe (diff) |
Fix integration tests with Docker image for PostgreSQL 10.5
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>
Diffstat (limited to '.drone.yml')
-rw-r--r-- | .drone.yml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.drone.yml b/.drone.yml index f182372a3..f82de7b6b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -227,6 +227,7 @@ services: image: postgres:10 environment: - POSTGRES_USER=oc_autotest + - POSTGRES_DB=oc_autotest_dummy - POSTGRES_PASSWORD= when: matrix: |