Обсуждение: make installcheck on non-default ports

Поиск
Список
Период
Сортировка

make installcheck on non-default ports

От
Joe Conway
Дата:
I was trying to set up my dev box for multiple simultaneous Postgres
installs (7.3 stable, 7.4 stable, cvs head) and discovered that
`make installcheck` did not honor the default port assigned at configure
time. I view this as a bug.

The attached resolves the issue for all three versions.

Any objections to me applying this to cvs head? What about 7.3 and 7.4
stable branches?

Thanks,

Joe
Index: src/test/regress/GNUmakefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/test/regress/GNUmakefile,v
retrieving revision 1.43
diff -c -r1.43 GNUmakefile
*** src/test/regress/GNUmakefile    2 Nov 2003 21:56:15 -0000    1.43
--- src/test/regress/GNUmakefile    26 Nov 2003 04:00:38 -0000
***************
*** 122,128 ****
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) 

  installcheck: all
!     $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)


  # old interfaces follow...
--- 122,128 ----
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) 

  installcheck: all
!     $(SHELL) ./pg_regress --port=$(DEF_PGPORT) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)


  # old interfaces follow...
***************
*** 131,137 ****
  runtest: installcheck

  bigtest:
!     $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big

  bigcheck:
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) numeric_big 
--- 131,137 ----
  runtest: installcheck

  bigtest:
!     $(SHELL) ./pg_regress --port=$(DEF_PGPORT) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
numeric_big

  bigcheck:
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) numeric_big 

Re: make installcheck on non-default ports

От
Joe Conway
Дата:
Joe Conway wrote:
> I was trying to set up my dev box for multiple simultaneous Postgres
> installs (7.3 stable, 7.4 stable, cvs head) and discovered that
> `make installcheck` did not honor the default port assigned at configure
> time. I view this as a bug.
>
> The attached resolves the issue for all three versions.
>
> Any objections to me applying this to cvs head? What about 7.3 and 7.4
> stable branches?

BTW, a similar change is needed in contrib/contrib-global.mk so that
`make installcheck` will work for contrib. New patch attached.

Joe


Index: contrib/contrib-global.mk
===================================================================
RCS file: /cvsroot/pgsql-server/contrib/contrib-global.mk,v
retrieving revision 1.5
diff -c -r1.5 contrib-global.mk
*** contrib/contrib-global.mk   2 Nov 2002 00:16:21 -0000       1.5
--- contrib/contrib-global.mk   26 Nov 2003 04:42:55 -0000
***************
*** 209,215 ****

  # against installed postmaster
  installcheck: submake
!       $(top_builddir)/src/test/regress/pg_regress $(REGRESS)

  # in-tree test doesn't work yet (no way to install my shared library)
  #check: all submake
--- 209,215 ----

  # against installed postmaster
  installcheck: submake
!       $(top_builddir)/src/test/regress/pg_regress --port=$(DEF_PGPORT) $(REGRESS)

  # in-tree test doesn't work yet (no way to install my shared library)
  #check: all submake
Index: src/test/regress/GNUmakefile
===================================================================
RCS file: /cvsroot/pgsql-server/src/test/regress/GNUmakefile,v
retrieving revision 1.43
diff -c -r1.43 GNUmakefile
*** src/test/regress/GNUmakefile    2 Nov 2003 21:56:15 -0000    1.43
--- src/test/regress/GNUmakefile    26 Nov 2003 04:00:38 -0000
***************
*** 122,128 ****
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) 

  installcheck: all
!     $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)


  # old interfaces follow...
--- 122,128 ----
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) 

  installcheck: all
!     $(SHELL) ./pg_regress --port=$(DEF_PGPORT) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)


  # old interfaces follow...
***************
*** 131,137 ****
  runtest: installcheck

  bigtest:
!     $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big

  bigcheck:
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) numeric_big 
--- 131,137 ----
  runtest: installcheck

  bigtest:
!     $(SHELL) ./pg_regress --port=$(DEF_PGPORT) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
numeric_big

  bigcheck:
      $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule
--multibyte=$(MULTIBYTE)$(MAXCONNOPT) numeric_big 

Re: make installcheck on non-default ports

От
Tom Lane
Дата:
Joe Conway <mail@joeconway.com> writes:
> I was trying to set up my dev box for multiple simultaneous Postgres
> installs (7.3 stable, 7.4 stable, cvs head) and discovered that
> `make installcheck` did not honor the default port assigned at configure
> time. I view this as a bug.

I think there is something wrong with your setup procedures, because
I've never needed such.  (I've corresponded with Joe off-list about
this --- maybe we can produce a FAQ about the right way to do it once
the dust settles.)

> Any objections to me applying this to cvs head?

AFAICS this would defeat the documented behavior of being able to set
PGHOST/PGPORT in the environment to control which postmaster "make
installcheck" will speak to.  So, yeah, I think it's a bad idea.

            regards, tom lane

Re: make installcheck on non-default ports

От
Joe Conway
Дата:
Tom Lane wrote:
> I think there is something wrong with your setup procedures, because
> I've never needed such.  (I've corresponded with Joe off-list about
> this --- maybe we can produce a FAQ about the right way to do it once
> the dust settles.)

Yup, got it.

> AFAICS this would defeat the documented behavior of being able to set
> PGHOST/PGPORT in the environment to control which postmaster "make
> installcheck" will speak to.  So, yeah, I think it's a bad idea.

OK. I'll see about playing with the scripts you sent me.

Thanks,

Joe


Re: make installcheck on non-default ports

От
Joe Conway
Дата:
Tom Lane wrote:
> I think there is something wrong with your setup procedures, because
> I've never needed such.

The main problem seemed to be that I had --disable-rpath in my configure
script, left over from when I was playing with options used by the RPM
spec file. Once I got rid of that, and started using a derivative of
Tom's scripts, it all started to work just fine.

Now I can do:

   . pg73          (or pg74 or pg75)
   cvs up
   make clean
   pgconfig
   make all
   pgctl stop
   make install
   pgctl start
   make installcheck

I've attached the scripts in case anyone is interested.

Joe
# Source this, eg with ". bin/setvariables", to prepare for Postgres work.
# This version is for a debug install.

STDPATH=${STDPATH:-$PATH}
STDMANPATH=${STDMANPATH:-$MANPATH}

PGVER="7.5"
PGPORT=55435
PGUSER=postgres
PGTAGNAME="pgsql ${PGVER}"
PGSRCROOT=/opt/src/pgsql-cvs/pgsql-${PGVER}
PGINSTROOT=/usr/local/pgsql-${PGVER}
PATH=$PGINSTROOT/bin:$STDPATH
MANPATH=$PGINSTROOT/man:$STDMANPATH
PGLIB=$PGINSTROOT/lib
PGDATA=$PGINSTROOT/data
PMOPTIONS="-p ${PGPORT} -i -F"
PMLOGFILE=$PGINSTROOT/debugserver.log

export PGSRCROOT PGINSTROOT PATH MANPATH PGLIB PGDATA
export STDPATH STDMANPATH PGTAGNAME PGPORT PGUSER
export PMOPTIONS PMLOGFILE#!/bin/sh

. /opt/src/pgsql-cvs/setvariables.74
cd ${PGSRCROOT}


#!/bin/sh

. /opt/src/pgsql-cvs/setvariables.75
cd ${PGSRCROOT}


#! /bin/sh

./configure \
 --prefix=${PGINSTROOT} \
 --with-pgport=${PGPORT} \
 --with-perl \
 --with-tcl \
 --with-tclconfig=/usr/lib \
 --without-tk \
 --with-python \
 --enable-nls \
 --enable-debug \
 --enable-cassert \
 --enable-depend \
 --with-openssl \
 --with-pam \
 --enable-integer-datetimes \
 --with-krb5=/usr/kerberos

#! /bin/sh

PGCTL="${PGINSTROOT}/bin/pg_ctl"

start(){
    echo "Starting ${PGTAGNAME}"
        su -l postgres -s /bin/sh -c "${PGCTL} start -D ${PGDATA} -l ${PMLOGFILE} -o '${PMOPTIONS}'"
}

stop(){
    echo $"Stopping ${PGTAGNAME}"
    su -l postgres -s /bin/sh -c "${PGCTL} stop -D ${PGDATA} -s -m fast"
}

restart(){
    stop
    start
}

reload(){
    echo $"Reloading ${PGTAGNAME}"
    su -l postgres -s /bin/sh -c "${PGCTL} reload -D ${PGDATA} -s"
}


# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    restart
    ;;
  reload)
    reload
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart|reload}"
    exit 1
esac

exit 0

# Source this, eg with ". bin/setvariables", to prepare for Postgres work.
# This version is for a debug install.

STDPATH=${STDPATH:-$PATH}
STDMANPATH=${STDMANPATH:-$MANPATH}

PGVER="7.3"
PGPORT=55433
PGUSER=postgres
PGTAGNAME="pgsql ${PGVER}"
PGSRCROOT=/opt/src/pgsql-cvs/pgsql-${PGVER}
PGINSTROOT=/usr/local/pgsql-${PGVER}
PATH=$PGINSTROOT/bin:$STDPATH
MANPATH=$PGINSTROOT/man:$STDMANPATH
PGLIB=$PGINSTROOT/lib
PGDATA=$PGINSTROOT/data
PMOPTIONS="-p ${PGPORT} -i -F"
PMLOGFILE=$PGINSTROOT/debugserver.log

export PGSRCROOT PGINSTROOT PATH MANPATH PGLIB PGDATA
export STDPATH STDMANPATH PGTAGNAME PGPORT PGUSER
export PMOPTIONS PMLOGFILE
# Source this, eg with ". bin/setvariables", to prepare for Postgres work.
# This version is for a debug install.

STDPATH=${STDPATH:-$PATH}
STDMANPATH=${STDMANPATH:-$MANPATH}

PGVER="7.4"
PGPORT=55434
PGUSER=postgres
PGTAGNAME="pgsql ${PGVER}"
PGSRCROOT=/opt/src/pgsql-cvs/pgsql-${PGVER}
PGINSTROOT=/usr/local/pgsql-${PGVER}
PATH=$PGINSTROOT/bin:$STDPATH
MANPATH=$PGINSTROOT/man:$STDMANPATH
PGLIB=$PGINSTROOT/lib
PGDATA=$PGINSTROOT/data
PMOPTIONS="-p ${PGPORT} -i -F"
PMLOGFILE=$PGINSTROOT/debugserver.log

export PGSRCROOT PGINSTROOT PATH MANPATH PGLIB PGDATA
export STDPATH STDMANPATH PGTAGNAME PGPORT PGUSER
export PMOPTIONS PMLOGFILE#!/bin/sh

. /opt/src/pgsql-cvs/setvariables.73
cd ${PGSRCROOT}