Re: pgsql: Clean up role created in new subscription test.

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: pgsql: Clean up role created in new subscription test.
Дата
Msg-id 0134C9EC-5F6B-4EAC-B2D5-BB4249BEBD4D@yesql.se
обсуждение исходный текст
Ответ на Re: pgsql: Clean up role created in new subscription test.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Clean up role created in new subscription test.  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
> 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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Ajin Cherian
Дата:
Сообщение: Re: running logical replication as the subscription owner
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Missing update of all_hasnulls in BRIN opclasses