Re: Test code is worth the space - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Test code is worth the space
Date
Msg-id CANP8+jKe3t1PmTD-T_fOCpDeYGPCb9Zgm-SpgV6MNDBzXed0Pw@mail.gmail.com
Whole thread Raw
In response to Re: Test code is worth the space  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On 12 August 2015 at 03:10, Noah Misch <noah@leadboat.com> wrote:
 
> On another review I suggested we add a function to core to allow it to be
> used in regression tests. A long debate ensued, deciding that we must be
> consistent and put diagnostic functions in contrib. My understanding is
> that we are not allowed to write regression tests that use contrib modules,
> yet the consistent place to put diagnostic functions is contrib -
> therefore, we are never allowed to write tests utilizing diagnostic
> functions. We are allowed to put modules for testing in another directory,
> but these are not distributed to users so cannot be used for production
> diagnosis. Systemic fail, advice needed.

If you want a user-visible function for production diagnosis, set aside the
fact that you wish to use it in a test, and find the best place for it.  Then,
place the tests with the function.  (That is, if the function belongs in
contrib for other reasons, put tests calling it in the contrib module itself.)

Place non-user-visible test support functions in regress.c, or use one of the
options Robert described.

That helps, thanks. 

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL, RAISE and error context
Next
From: Andres Freund
Date:
Subject: Re: Raising our compiler requirements for 9.6