The contrib Dockerfiles run ./configure && make, so not only is there no need to do so here, but it was causing issues by running the commands in the parent directory of the unpacked extension directory:
Executing in container: "su postgres -c bash -c \"././postgis-3.4.0/configure && make -C ./postgis-3.4.0 check && echo done\""
configure: error: source directory already configured; run "make distclean" there first
Apparently ./configure won't re-run from a different directory unless make distclean is run. But it's not even necessary! So remove the check for the configure file in run_tests(), and then also remove the file_exists() function, as it's no longer uses.
Then refactor exec_in_container() and
exec_in_container_with_exit_code() to take a directory argument, and pass it to bollard's CreateExecOptions(), then pass the unpacked directory name in the appropriate places.
That includes especially make check and make installcheck. Also modify them so they no longe run as the postgres user --- which can cause permission issues, as the source is unpacked and owned by root in the Dockerfiles --- and instead set the PGUSER environment variable. This ensure that all tests are run as the root system user but connect to the postgres database as the postgres user.
The contrib
Dockerfile
s run./configure && make
, so not only is there no need to do so here, but it was causing issues by running the commands in the parent directory of the unpacked extension directory:Apparently
./configure
won't re-run from a different directory unlessmake distclean
is run. But it's not even necessary! So remove the check for theconfigure
file inrun_tests()
, and then also remove thefile_exists()
function, as it's no longer uses.Then refactor
exec_in_container()
andexec_in_container_with_exit_code()
to take a directory argument, and pass it to bollard'sCreateExecOptions()
, then pass the unpacked directory name in the appropriate places.That includes especially
make check
andmake installcheck
. Also modify them so they no longe run as thepostgres
user --- which can cause permission issues, as the source is unpacked and owned by root in theDockerfile
s --- and instead set thePGUSER
environment variable. This ensure that all tests are run as theroot
system user but connect to thepostgres
database as thepostgres
user.