pgsql: Move contrib/spi testing from core regression tests to contrib/s

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Move contrib/spi testing from core regression tests to contrib/s
Date: 2025-04-08 23:12:22
Message-ID: E1u2I7C-003MO8-0C@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Move contrib/spi testing from core regression tests to contrib/spi.

It's weird to have the core regression tests depending on contrib
code, and coverage testing shows that those test queries add nothing
to the core-code coverage of the core tests. So pull those test bits
out and put them into ordinary test scripts inside contrib/spi/,
making that more like other contrib modules.

Aside from being structurally nicer, anything we can take out of the
core tests (which are executed multiple times per check-world run)
and put into tests executed only once should be a win. It doesn't
look like this change will buy a whole lot of milliseconds, but a
cycle saved is a cycle earned.

Also, there is some discussion around possibly removing refint and/or
autoinc altogether. I don't know if that will happen, but we'd
certainly need to decouple them from the core tests to do so.

The tests for autoinc were quite intertwined with the undocumented
"ttdummy" trigger in regress.c. That made the tests very hard to
understand and contributed nothing to autoinc's testing either.
So I just deleted ttdummy and rewrote the autoinc tests without it.

I realized while doing this that the description of autoinc in
the SGML docs is not a great description of what the function
actually does, so the patch includes some updates to those docs.

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Discussion: https://postgr.es/m/3872677.1744077559@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b1720fe63f344adeb8a75b22e8f31b127c814f35

Modified Files
--------------
contrib/spi/.gitignore | 4 +
contrib/spi/Makefile | 2 +
contrib/spi/expected/autoinc.out | 50 ++++++
contrib/spi/expected/refint.out | 113 ++++++++++++
contrib/spi/meson.build | 12 ++
contrib/spi/sql/autoinc.sql | 33 ++++
contrib/spi/sql/refint.sql | 97 +++++++++++
doc/src/sgml/contrib-spi.sgml | 10 +-
src/test/regress/GNUmakefile | 22 +--
src/test/regress/expected/alter_table.out | 2 +
src/test/regress/expected/test_setup.out | 4 -
src/test/regress/expected/triggers.out | 277 +-----------------------------
src/test/regress/meson.build | 17 --
src/test/regress/regress.c | 220 ------------------------
src/test/regress/sql/alter_table.sql | 2 +
src/test/regress/sql/test_setup.sql | 5 -
src/test/regress/sql/triggers.sql | 198 +--------------------
17 files changed, 332 insertions(+), 736 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-04-09 00:21:20 pgsql: Adjust AdjustUpgrade.pm for commit b1720fe63.
Previous Message Daniel Gustafsson 2025-04-08 21:22:04 pgsql: Rename argument in pg_get_process_memory_contexts().