Skip to content

Commit 558fff0

Browse files
pg_regress: Emit TAP compliant output
This converts pg_regress output format to emit TAP compliant output while keeping it as human readable as possible for use without TAP test harnesses. As verbose harness related information isn't really supported by TAP this also reduces the verbosity of pg_regress runs which makes scrolling through log output in buildfarm/CI runs a bit easier as well. As the meson TAP parser conumes whitespace, the leading indentation for differentiating parallel tests from sequential tests has been changed to a single character prefix. This patch has been around for an extended period of time, reviewers listed below may have been involved in reviewing a version quite different from the version in this commit. The original idea for this patch was a hacking session with Jinbao Chen. TAP format testing is also enabled in meson as of this. Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Nikolay Shaplov <dhyan@nataraj.su> Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com> Discussion: https://postgr.es/m/BD4B107D-7E53-4794-ACBA-275BEB4327C9@yesql.se Discussion: https://postgr.es/m/20220221164736.rq3ornzjdkmwk2wo@alap3.anarazel.de
1 parent 9b058f6 commit 558fff0

File tree

4 files changed

+325
-262
lines changed

4 files changed

+325
-262
lines changed

doc/src/sgml/regress.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
parallel method starts up multiple server processes to run groups
3131
of tests in parallel. Parallel testing adds confidence that
3232
interprocess communication and locking are working correctly.
33+
Some tests may run sequentially even in the <quote>parallel</quote>
34+
mode in case this is required by the test.
3335
</para>
3436

3537
<sect2 id="regress-run-temp-inst">
@@ -43,12 +45,12 @@ make check
4345
</screen>
4446
in the top-level directory. (Or you can change to
4547
<filename>src/test/regress</filename> and run the command there.)
48+
Tests which are run in parallel are prefixed with <quote>+</quote>, and
49+
tests which run sequentially are prefixed with <quote>-</quote>.
4650
At the end you should see something like:
4751
<screen>
4852
<computeroutput>
49-
=======================
50-
All 193 tests passed.
51-
=======================
53+
# All 213 tests passed.
5254
</computeroutput>
5355
</screen>
5456
or otherwise a note about which tests failed. See <xref

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,6 +3118,7 @@ foreach test_dir : tests
31183118
env.prepend('PATH', temp_install_bindir, test_dir['bd'])
31193119

31203120
test_kwargs = {
3121+
'protocol': 'tap',
31213122
'priority': 10,
31223123
'timeout': 1000,
31233124
'depends': test_deps + t.get('deps', []),

src/Makefile.global.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ ifeq ($(enable_tap_tests),yes)
444444

445445
ifndef PGXS
446446
define prove_installcheck
447-
echo "+++ tap install-check in $(subdir) +++" && \
447+
echo "# +++ tap install-check in $(subdir) +++" && \
448448
rm -rf '$(CURDIR)'/tmp_check && \
449449
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
450450
cd $(srcdir) && \
@@ -457,7 +457,7 @@ cd $(srcdir) && \
457457
endef
458458
else # PGXS case
459459
define prove_installcheck
460-
echo "+++ tap install-check in $(subdir) +++" && \
460+
echo "# +++ tap install-check in $(subdir) +++" && \
461461
rm -rf '$(CURDIR)'/tmp_check && \
462462
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
463463
cd $(srcdir) && \
@@ -471,7 +471,7 @@ endef
471471
endif # PGXS
472472

473473
define prove_check
474-
echo "+++ tap check in $(subdir) +++" && \
474+
echo "# +++ tap check in $(subdir) +++" && \
475475
rm -rf '$(CURDIR)'/tmp_check && \
476476
$(MKDIR_P) '$(CURDIR)'/tmp_check && \
477477
cd $(srcdir) && \
@@ -665,7 +665,7 @@ pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
665665
pg_regress_clean_files = results/ regression.diffs regression.out tmp_check/ tmp_check_iso/ log/ output_iso/
666666

667667
pg_regress_check = \
668-
echo "+++ regress check in $(subdir) +++" && \
668+
echo "\# +++ regress check in $(subdir) +++" && \
669669
$(with_temp_install) \
670670
$(top_builddir)/src/test/regress/pg_regress \
671671
--temp-instance=./tmp_check \
@@ -674,14 +674,14 @@ pg_regress_check = \
674674
$(TEMP_CONF) \
675675
$(pg_regress_locale_flags) $(EXTRA_REGRESS_OPTS)
676676
pg_regress_installcheck = \
677-
echo "+++ regress install-check in $(subdir) +++" && \
677+
echo "\# +++ regress install-check in $(subdir) +++" && \
678678
$(top_builddir)/src/test/regress/pg_regress \
679679
--inputdir=$(srcdir) \
680680
--bindir='$(bindir)' \
681681
$(pg_regress_locale_flags) $(EXTRA_REGRESS_OPTS)
682682

683683
pg_isolation_regress_check = \
684-
echo "+++ isolation check in $(subdir) +++" && \
684+
echo "\# +++ isolation check in $(subdir) +++" && \
685685
$(with_temp_install) \
686686
$(top_builddir)/src/test/isolation/pg_isolation_regress \
687687
--temp-instance=./tmp_check_iso \
@@ -690,7 +690,7 @@ pg_isolation_regress_check = \
690690
$(TEMP_CONF) \
691691
$(pg_regress_locale_flags) $(EXTRA_REGRESS_OPTS)
692692
pg_isolation_regress_installcheck = \
693-
echo "+++ isolation install-check in $(subdir) +++" && \
693+
echo "\# +++ isolation install-check in $(subdir) +++" && \
694694
$(top_builddir)/src/test/isolation/pg_isolation_regress \
695695
--inputdir=$(srcdir) --outputdir=output_iso \
696696
--bindir='$(bindir)' \

0 commit comments

Comments
 (0)