pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Refactor background psql TAP functions
7+ messages / 3 participants
[nested] [flat]
Commits from this thread:
2023-04-26 a4c17c8617 Fix missing installation rules for BackgroundPsql.pm
* pgsql: Refactor background psql TAP functions
@ 2023-04-07 20:21 Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Re: pgsql: Refactor background psql TAP functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Gustafsson @ 2023-04-07 20:21 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Refactor background psql TAP functions
This breaks out the background and interactive psql functionality into a
new class, PostgreSQL::Test::BackgroundPsql. Sessions are still initiated
via PostgreSQL::Test::Cluster, but once started they can be manipulated by
the new helper functions which intend to make querying easier. A sample
session for a command which can be expected to finish at a later time can
be seen below.
my $session = $node->background_psql('postgres');
$bsession->query_until(qr/start/, q(
\echo start
CREATE INDEX CONCURRENTLY idx ON t(a);
));
$bsession->quit;
Patch by Andres Freund with some additional hacking by me.
Author: Andres Freund <andres@anarazel.de>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/20230130194350.zj5v467x4jgqt3d6@awork3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/664d757531e11ea5ef6971884ddb2a7af6fae69a
Modified Files
--------------
contrib/amcheck/t/003_cic_2pc.pl | 70 ++---
src/bin/psql/t/010_tab_completion.pl | 28 +-
src/test/perl/PostgreSQL/Test/BackgroundPsql.pm | 299 +++++++++++++++++++++
src/test/perl/PostgreSQL/Test/Cluster.pm | 79 ++----
.../recovery/t/010_logical_decoding_timelines.pl | 1 -
src/test/recovery/t/031_recovery_conflict.pl | 102 ++-----
src/test/subscription/t/015_stream.pl | 51 ++--
7 files changed, 388 insertions(+), 242 deletions(-)
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Refactor background psql TAP functions
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
@ 2023-04-26 06:28 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2023-04-26 08:05 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
0 siblings, 1 reply; 7+ messages in thread
From: Peter Eisentraut @ 2023-04-26 06:28 UTC (permalink / raw)
To: Daniel Gustafsson <dgustafsson@postgresql.org>; pgsql-committers@lists.postgresql.org
On 07.04.23 22:21, Daniel Gustafsson wrote:
> Refactor background psql TAP functions
>
> This breaks out the background and interactive psql functionality into a
> new class, PostgreSQL::Test::BackgroundPsql.
The new file also needs to be installed in
src/test/perl/{Makefile,meson.build}.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Refactor background psql TAP functions
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Re: pgsql: Refactor background psql TAP functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
@ 2023-04-26 08:05 ` Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-16 19:04 ` Re: pgsql: Refactor background psql TAP functions Damir Belyalov <dam.bel07@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Gustafsson @ 2023-04-26 08:05 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org
> On 26 Apr 2023, at 08:28, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>
> On 07.04.23 22:21, Daniel Gustafsson wrote:
>> Refactor background psql TAP functions
>> This breaks out the background and interactive psql functionality into a
>> new class, PostgreSQL::Test::BackgroundPsql.
>
> The new file also needs to be installed in src/test/perl/{Makefile,meson.build}.
Ugh, sorry about that. Fixing.
--
Daniel Gustafsson
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Refactor background psql TAP functions
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Re: pgsql: Refactor background psql TAP functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2023-04-26 08:05 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
@ 2023-05-16 19:04 ` Damir Belyalov <dam.bel07@gmail.com>
2023-05-16 19:43 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
0 siblings, 1 reply; 7+ messages in thread
From: Damir Belyalov @ 2023-05-16 19:04 UTC (permalink / raw)
To: Daniel Gustafsson <dgustafsson@postgresql.org>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-committers@lists.postgresql.org
Hello!
There is another perl module: AdjustUpgrade.pm that is not in Makefile. Do
we need it?
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/RecursiveCopy.pm
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/RecursiveCopy.pm'
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/Cluster.pm
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Cluster.pm'
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/BackgroundPsql.pm
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/BackgroundPsql.pm'
+ $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/BackgroundPsql.pm
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/AdjustUpgrade.pm'
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Version.pm
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Version.pm'
uninstall:
@@ -32,6 +33,7 @@ uninstall:
rm -f
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/RecursiveCopy.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Cluster.pm'
rm -f
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/BackgroundPsql.pm'
+ rm -f
'$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/AdjustUpgrade.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Version.pm'
Regards,
Damir Belyalov
Postgres Professional
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Refactor background psql TAP functions
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Re: pgsql: Refactor background psql TAP functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2023-04-26 08:05 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-16 19:04 ` Re: pgsql: Refactor background psql TAP functions Damir Belyalov <dam.bel07@gmail.com>
@ 2023-05-16 19:43 ` Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-17 12:38 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Gustafsson @ 2023-05-16 19:43 UTC (permalink / raw)
To: Damir Belyalov <dam.bel07@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-committers@lists.postgresql.org
> On 16 May 2023, at 21:04, Damir Belyalov <dam.bel07@gmail.com> wrote:
> There is another perl module: AdjustUpgrade.pm that is not in Makefile. Do we need it?
Yes, I think it should be installed too and skimming the linked thread I see no
mention of the omission being deliberate. I will take care of it.
> + $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/BackgroundPsql.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/AdjustUpgrade.pm'
This is wrong though, but no need to send a new version of this small thing.
--
Daniel Gustafsson
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Refactor background psql TAP functions
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Re: pgsql: Refactor background psql TAP functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2023-04-26 08:05 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-16 19:04 ` Re: pgsql: Refactor background psql TAP functions Damir Belyalov <dam.bel07@gmail.com>
2023-05-16 19:43 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
@ 2023-05-17 12:38 ` Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-19 21:33 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Gustafsson @ 2023-05-17 12:38 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; Damir Belyalov <dam.bel07@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-committers@lists.postgresql.org
> On 16 May 2023, at 21:43, Daniel Gustafsson <dgustafsson@postgresql.org> wrote:
>
>> On 16 May 2023, at 21:04, Damir Belyalov <dam.bel07@gmail.com> wrote:
>
>> There is another perl module: AdjustUpgrade.pm that is not in Makefile. Do we need it?
>
> Yes, I think it should be installed too and skimming the linked thread I see no
> mention of the omission being deliberate. I will take care of it.
The attached is the proposed fix, which will have to be backpatched to v11 to
match the original commit. Unless there are reasons to treat this module
differently from the others wrt installation I'll go ahead and fix it in time
for beta1.
--
Daniel Gustafsson
Attachments:
v1-0001-Add-installation-rules-for-AdjustUpgrade-test-mod.patch (application/octet-stream, 2.3K) download
From 118aa36deefbac4cf54871fa9be0f2e54f67e74f Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Wed, 17 May 2023 14:29:49 +0200
Subject: [PATCH v1] Add installation rules for AdjustUpgrade test module
Commit 52585f8f07 introduced a new Perl test module but didn't add
it as an installation target like the other modules are.
Backpatch into all supported versions.
Reported-by: Damir Belyalov <dam.bel07@gmail.com>
Discussion: https://postgr.es/m/CALH1Lgui397s_4AXWm1ZO_uCLOUVL1HAa0TO9CbdMy1kvokkzA@mail.gmail.com
Backpatch-through: v11
---
src/test/perl/Makefile | 2 ++
src/test/perl/meson.build | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/test/perl/Makefile b/src/test/perl/Makefile
index 435b45a6cc..716bec76be 100644
--- a/src/test/perl/Makefile
+++ b/src/test/perl/Makefile
@@ -24,6 +24,7 @@ install: all installdirs
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/RecursiveCopy.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/RecursiveCopy.pm'
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/Cluster.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Cluster.pm'
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/BackgroundPsql.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/BackgroundPsql.pm'
+ $(INSTALL_DATA) $(srcdir)/PostgreSQL/Test/AdjustUpgrade.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/AdjustUpgrade.pm'
$(INSTALL_DATA) $(srcdir)/PostgreSQL/Version.pm '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Version.pm'
uninstall:
@@ -32,6 +33,7 @@ uninstall:
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/RecursiveCopy.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/Cluster.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/BackgroundPsql.pm'
+ rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Test/AdjustUpgrade.pm'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/PostgreSQL/Version.pm'
endif
diff --git a/src/test/perl/meson.build b/src/test/perl/meson.build
index 101e8a2b8f..041e892029 100644
--- a/src/test/perl/meson.build
+++ b/src/test/perl/meson.build
@@ -12,4 +12,5 @@ install_data(
'PostgreSQL/Test/RecursiveCopy.pm',
'PostgreSQL/Test/Cluster.pm',
'PostgreSQL/Test/BackgroundPsql.pm',
+ 'PostgreSQL/Test/AdjustUpgrade.pm',
install_dir: dir_pgxs / 'src/test/perl/PostgreSQL/Test')
--
2.32.1 (Apple Git-133)
=
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Refactor background psql TAP functions
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Re: pgsql: Refactor background psql TAP functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2023-04-26 08:05 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-16 19:04 ` Re: pgsql: Refactor background psql TAP functions Damir Belyalov <dam.bel07@gmail.com>
2023-05-16 19:43 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-17 12:38 ` Re: pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
@ 2023-05-19 21:33 ` Daniel Gustafsson <dgustafsson@postgresql.org>
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Gustafsson @ 2023-05-19 21:33 UTC (permalink / raw)
To: Damir Belyalov <dam.bel07@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Peter Eisentraut <peter.eisentraut@enterprisedb.com>; pgsql-committers@lists.postgresql.org
> On 17 May 2023, at 14:38, Daniel Gustafsson <dgustafsson@postgresql.org> wrote:
>
>> On 16 May 2023, at 21:43, Daniel Gustafsson <dgustafsson@postgresql.org> wrote:
>>
>>> On 16 May 2023, at 21:04, Damir Belyalov <dam.bel07@gmail.com> wrote:
>>
>>> There is another perl module: AdjustUpgrade.pm that is not in Makefile. Do we need it?
>>
>> Yes, I think it should be installed too and skimming the linked thread I see no
>> mention of the omission being deliberate. I will take care of it.
>
> The attached is the proposed fix, which will have to be backpatched to v11 to
> match the original commit. Unless there are reasons to treat this module
> differently from the others wrt installation I'll go ahead and fix it in time
> for beta1.
After another round of thinking I opted out of pushing this, as the module is
so tied to pg_upgrade and the regress env it's use in installed pgxs is
questionable. While I would prefer a 1:1 between the modules in the source
tree and the installed tree, this module doesn't seem like a great fit for
installation.
--
Daniel Gustafsson
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-05-19 21:33 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-07 20:21 pgsql: Refactor background psql TAP functions Daniel Gustafsson <dgustafsson@postgresql.org>
2023-04-26 06:28 ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>
2023-04-26 08:05 ` Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-16 19:04 ` Damir Belyalov <dam.bel07@gmail.com>
2023-05-16 19:43 ` Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-17 12:38 ` Daniel Gustafsson <dgustafsson@postgresql.org>
2023-05-19 21:33 ` Daniel Gustafsson <dgustafsson@postgresql.org>
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