Thread: Re: Add some tests for pg_stat_statements compatibility verification under contrib

Re: Add some tests for pg_stat_statements compatibility verification under contrib

From
Michael Paquier
Date:
On Mon, Mar 15, 2021 at 03:05:24PM +0800, Erica Zhang wrote:
> This way the same query can be reused for both older versions and current
> version.
> Yep, it's neater to use the query as you suggested. Thanks!
>
> Also, can you register your patch for the next commitfest at
> https://commitfest.postgresql.org/33/, to make sure it won't be forgotten?

I was just looking at your patch, and I think that you should move all
the past compatibility tests into a separate test file, in a way
consistent to what we do in contrib/pageinspect/ for
oldextversions.sql.  I would suggest to use the same file names, while
on it.
--
Michael

Attachment

Re: Add some tests for pg_stat_statements compatibility verification under contrib

From
Michael Paquier
Date:
On Wed, Aug 25, 2021 at 04:16:08PM +0900, Michael Paquier wrote:
> I was just looking at your patch, and I think that you should move all
> the past compatibility tests into a separate test file, in a way
> consistent to what we do in contrib/pageinspect/ for
> oldextversions.sql.  I would suggest to use the same file names, while
> on it.

The current commit fest is ending, and it would be a waste to do
nothing here, so I have looked at what you proposed and reworked it.
The patch was blindly testing pg_stat_statements_reset() in all the
versions bumped with the same query on pg_stat_statements done each
time, which does not help in checking the actual parts of the code
that have changed, and there are two of them:
- pg_stat_statements_reset() execution got authorized for
pg_read_all_stats once in 1.6.
- pg_stat_statements() has been extended in 1.8, so we could just have
one query stressing this function in the tests for <= 1.7.

There is also no need for tests on 1.9, which is the latest version.
Tests for this one should be added once we bump the code to the next
version.  At the end I finish with the attached, counting for the
back-and-forth game with pg_read_all_stats.
--
Michael

Attachment

Re: Add some tests for pg_stat_statements compatibility verification under contrib

From
Michael Paquier
Date:
On Thu, Sep 30, 2021 at 11:12:21AM +0900, Michael Paquier wrote:
> There is also no need for tests on 1.9, which is the latest version.
> Tests for this one should be added once we bump the code to the next
> version.  At the end I finish with the attached, counting for the
> back-and-forth game with pg_read_all_stats.

Done as of 2b0da03.
--
Michael

Attachment