[patch] PSQLDIR not passed to pg_regress in contrib/pg_upgrade/test.sh

Started by Christoph Bergover 12 years ago3 messages
#1Christoph Berg
cb@df7cb.de
1 attachment(s)

"make check-world" in 9.3beta1 fails if you don't actually have 9.3
installed. In contrib/pg_upgrade/test.sh, it will try pg_regress
--psqldir=/usr/lib/postgresql/9.3/bin which doesn't exist.

+ /tmp/buildd/postgresql-9.3-9.3~beta1/build/contrib/pg_upgrade/tmp_check/install//usr/lib/postgresql/9.3/bin/pg_ctl start -l /tmp/buildd/postgresql-9.3-9.3~beta1/build/contrib/pg_upgrade/log/postmaster1.log -o -F -c listen_addresses= -c unix_socket_directories=/tmp -w
waiting for server to start.... done
server started
+ make -C /tmp/buildd/postgresql-9.3-9.3~beta1/build installcheck
make[5]: Entering directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build'
make -C src/test/regress installcheck
make[6]: Entering directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/test/regress'
make -C ../../../src/port all
make[7]: Entering directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/port'
make -C ../backend submake-errcodes
make[8]: Entering directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/backend'
make[8]: Nothing to be done for `submake-errcodes'.
make[8]: Leaving directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/backend'
make[7]: Leaving directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/port'
make -C ../../../src/common all
make[7]: Entering directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/common'
make -C ../backend submake-errcodes
make[8]: Entering directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/backend'
make[8]: Nothing to be done for `submake-errcodes'.
make[8]: Leaving directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/backend'
make[7]: Leaving directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/common'
rm -rf ./testtablespace
mkdir ./testtablespace
../../../src/test/regress/pg_regress --inputdir=/tmp/buildd/postgresql-9.3-9.3~beta1/build/../src/test/regress --psqldir='/usr/lib/postgresql/9.3/bin'   --host=/tmp --dlpath=. --host=/tmp --schedule=/tmp/buildd/postgresql-9.3-9.3~beta1/build/../src/test/regress/serial_schedule 
(using postmaster on Unix socket /tmp, default port)
============== dropping database "regression"         ==============
sh: 1: /usr/lib/postgresql/9.3/bin/psql: not found
command failed: "/usr/lib/postgresql/9.3/bin/psql" -X -c "DROP DATABASE IF EXISTS \"regression\"" "postgres"
make[6]: *** [installcheck] Error 2
make[6]: Leaving directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build/src/test/regress'
make[5]: *** [installcheck] Error 2
make[5]: Leaving directory `/tmp/buildd/postgresql-9.3-9.3~beta1/build'
+ make_installcheck_status=2

Here's a patch to fix it.

Christoph
--
cb@df7cb.de | http://www.df7cb.de/

Attachments:

pg_upgrade-test-bindir.patchtext/x-diff; charset=us-asciiDownload
diff --git a/contrib/pg_upgrade/test.sh b/contrib/pg_upgrade/test.sh
new file mode 100644
index 9b4b132..7627e62
*** a/contrib/pg_upgrade/test.sh
--- b/contrib/pg_upgrade/test.sh
*************** set -x
*** 83,89 ****
  
  $oldbindir/initdb -N
  $oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w
! if "$MAKE" -C "$oldsrc" installcheck; then
  	pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
  	if [ "$newsrc" != "$oldsrc" ]; then
  		oldpgversion=`psql -A -t -d regression -c "SHOW server_version_num"`
--- 83,89 ----
  
  $oldbindir/initdb -N
  $oldbindir/pg_ctl start -l "$logdir/postmaster1.log" -o "$POSTMASTER_OPTS" -w
! if "$MAKE" -C "$oldsrc" installcheck PSQLDIR=$bindir; then
  	pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
  	if [ "$newsrc" != "$oldsrc" ]; then
  		oldpgversion=`psql -A -t -d regression -c "SHOW server_version_num"`
#2Robert Haas
robertmhaas@gmail.com
In reply to: Christoph Berg (#1)
Re: [patch] PSQLDIR not passed to pg_regress in contrib/pg_upgrade/test.sh

On Tue, May 7, 2013 at 2:40 AM, Christoph Berg <cb@df7cb.de> wrote:

"make check-world" in 9.3beta1 fails if you don't actually have 9.3
installed. In contrib/pg_upgrade/test.sh, it will try pg_regress
--psqldir=/usr/lib/postgresql/9.3/bin which doesn't exist.

I tried to reproduce this and couldn't. The following already-exstant
chunk of code seems to be trying to cover the same issue:

# We need to make it use psql from our temporary installation,
# because otherwise the installcheck run below would try to
# use psql from the proper installation directory, which might
# be outdated or missing. But don't override anything else that's
# already in EXTRA_REGRESS_OPTS.
EXTRA_REGRESS_OPTS="$EXTRA_REGRESS_OPTS --psqldir=$bindir"
export EXTRA_REGRESS_OPTS

If I comment out those last two lines, then I can reproduce the problem exactly.

I wonder why it's working differently for you.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Robert Haas (#2)
Re: [patch] PSQLDIR not passed to pg_regress in contrib/pg_upgrade/test.sh

On 05/10/2013 03:10 PM, Robert Haas wrote:

On Tue, May 7, 2013 at 2:40 AM, Christoph Berg <cb@df7cb.de> wrote:

"make check-world" in 9.3beta1 fails if you don't actually have 9.3
installed. In contrib/pg_upgrade/test.sh, it will try pg_regress
--psqldir=/usr/lib/postgresql/9.3/bin which doesn't exist.

I tried to reproduce this and couldn't.

I can confirm that it's working for me too.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers