Re: pgsql: Clean up role created in new subscription test.
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-05-15T08:59:20Z
Lists: pgsql-hackers
Attachments
- v1-0002-pg_regress-Fix-reported-runtime-for-failed-single.patch (application/octet-stream) patch v1-0002
- v1-0001-pg_regress-Add-database-verification-test.patch (application/octet-stream) patch v1-0001
> On 30 Mar 2023, at 22:29, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Well, we could do "select rolname from pg_roles order by 1" and > actually compare the results of the two selects. That might be > advisable anyway, in order to produce a complaint with useful > detail when there is something wrong. I took a look at this and came up with the attached. This adds a new parameter to pg_regress for specifying a test which will be executed before and after the suite, where the first invocation creates the expectfile for the second. For storing the expecfile the temp dir creation is somewhat refactored. I've added a sample test in the patch (to regress, not ECPG), but I'm sure it can be expanded to be a bit more interesting. The comment which is now incorrectly formatted was left like that to make review easier, if this gets committed it will be fixed then. I opted for this to use the machinery that pg_regress already has rather than add a new mechanism (and dependency) for running and verifying queries. This also avoids hardcoding the test making it easier to have custom queries during hacking etc. Looking at this I also found a bug introduced in the TAP format patch, which made failed single run tests report as 0ms due to the parameters being mixed up in the report function call. This is in 0002, which I'll apply to HEAD regardless of 0001 as they are unrelated. -- Daniel Gustafsson
Commits
-
Drop global objects after completed test
- 8ec99d0b79b2 12.21 landed
- e43e71b6cd2f 13.17 landed
- 988ddbef978b 14.14 landed
- 2eecaf4b8cfb 15.9 landed
- 4dd17490faa3 16.5 landed
- 936e3fa3787a 17.0 landed
-
Fix reported runtime for single tests in pg_regress
- 8cb94344c3c7 16.0 landed
-
Clean up role created in new subscription test.
- e9d202a1499d 16.0 cited