pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add a regression test script dedicated to exercising system view
Date: Mon, 30 Jan 2017 22:15:52 +0000
Message-ID: <E1cYKEq-0004b3-Ln@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Add a regression test script dedicated to exercising system views.

Quite a few of our built-in system views were not exercised anywhere
in the regression tests.  This is perhaps not so exciting for the ones
that are simple projections/joins of system catalogs, but for the ones
that are wrappers for set-returning C functions, the omission translates
directly to lack of test coverage for those functions.

In many cases, the reason for the omission is that the view doesn't have
much to do with any specific SQL feature, so there's no natural place to
test it.  To remedy that, invent a new script sysviews.sql that's dedicated
to testing SRF-based views.  Move a couple of tests that did fit this
charter into the new script, and add simple "count(*)" based tests of
other views within the charter.  That's enough to ensure we at least
exercise the main code path through the SRF, although it does little to
prove that the output is sane.

More could be done here, no doubt, and I hope someone will think about
how we can test these views more thoroughly.  But this is a starting
point.

Discussion: https://postgr.es/m/19359.1485723741@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d002f16c6ec38f76d1ee97367ba6af3000d441d0

Modified Files
--------------
src/test/regress/expected/rangefuncs.out  |  16 -----
src/test/regress/expected/sysviews.out    | 113 ++++++++++++++++++++++++++++++
src/test/regress/expected/timestamptz.out |  35 ---------
src/test/regress/parallel_schedule        |   2 +-
src/test/regress/serial_schedule          |   1 +
src/test/regress/sql/rangefuncs.sql       |   2 -
src/test/regress/sql/sysviews.sql         |  48 +++++++++++++
src/test/regress/sql/timestamptz.sql      |  16 -----
8 files changed, 163 insertions(+), 70 deletions(-)


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


Message-ID: <E1cYKEq-0004b3-Ln@gemulon.postgresql.org>
Permalink:  ../E1cYKEq-0004b3-Ln@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cYKEq-0004b3-Ln@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Add a regression test script dedicated to exercising system view
  In-Reply-To: <E1cYKEq-0004b3-Ln@gemulon.postgresql.org>
  References: <E1cYKEq-0004b3-Ln@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox