Re: Test to dump and restore objects left behind by regression
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter@eisentraut.org>,
Daniel Gustafsson <daniel@yesql.se>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>
Date: 2024-07-08T10:29:30Z
Lists: pgsql-hackers
On Fri, Jul 5, 2024 at 10:59 AM Michael Paquier <michael@paquier.xyz> wrote: > On Fri, Jun 28, 2024 at 06:00:07PM +0530, Ashutosh Bapat wrote: > > Here's a description of patches and some notes > > 0001 > > ------- > > 1. Per your suggestion the logic to handle dump output differences is > > externalized in PostgreSQL::Test::AdjustDump. Instead of eliminating > those > > differences altogether from both the dump outputs, the corresponding DDL > in > > the original dump output is adjusted to look like that from the restored > > database. Thus we retain full knowledge of what differences to expect. > > 2. I have changed the name filter_dump to filter_dump_for_upgrade so as > to > > differentiate between two adjustments 1. for upgrade and 2. for > > dump/restore. Ideally the name should have been > adjust_dump_for_ugprade() . > > It's more of an adjustment than filtering as indicated by the function it > > calls. But I haven't changed that. The new function to adjust dumps for > > dump and restore tests is named adjust_dump_for_restore() however. > > 3. As suggested by Daniel upthread, the test for dump and restore happens > > before upgrade which might change the old cluster thus changing the state > > of objects left behind by regression. The test is not executed if > > regression is not used to create the old cluster. > > 4. The code to compare two dumps and report differences if any is moved > to > > its own function compare_dumps() which is used for both upgrade and > > dump/restore tests. > > The test uses the custom dump format for dumping and restoring the > > database. > > At quick glance, that seems to be going in the right direction. Note > that you have forgotten install and uninstall rules for the new .pm > file. > Before submitting the patch, I looked for all the places which mention AdjustUpgrade or AdjustUpgrade.pm to find places where the new module needs to be mentioned. But I didn't find any. AdjustUpgrade is not mentioned in src/test/perl/Makefile or src/test/perl/meson.build. Do we want to also add AdjustUpgrade.pm in those files? > > 0002 increases more the runtime of a test that's already one of the > longest ones in the tree is not really appealing, I am afraid. > We could forget 0002. I am fine with that. But I can change the code such that formats other than "plain" are tested when PG_TEST_EXTRAS contains "regress_dump_formats". Would that be acceptable? -- Best Wishes, Ashutosh Bapat
Commits
-
Hide expensive pg_upgrade test behind PG_TEST_EXTRA
- d185161e4739 18.0 landed
- 37fc1803cc12 19 (unreleased) landed
-
Set log_statement=none in t/002_pg_upgrade.pl
- 64fba9c61787 18.0 landed
-
002_pg_upgrade.pl: Move pg_dump test code for better stability
- 8806e4e8deb1 18.0 landed
-
002_pg_upgrade.pl: rename some variables for clarity
- abe56227b2e2 18.0 landed
-
Verify roundtrip dump/restore of regression database
- 172259afb563 18.0 landed
-
Refactor TAP test code for file comparisons into new routine in Utils.pm
- 169208092f5c 18.0 landed
-
Virtual generated columns
- 83ea6c54025b 18.0 cited
-
Put generated_stored test objects in a schema
- 894be11adfa6 18.0 cited
-
Introduce "builtin" collation provider.
- 2d819a08a1cb 17.0 cited
-
Revert "Improve compression and storage support with inheritance"
- 74563f6b9021 17.0 cited