Обсуждение: Limit eartdistance regression testcase to the public schema

Поиск
Список
Период
Сортировка

Limit eartdistance regression testcase to the public schema

От
Zsolt Parragi
Дата:
Hello hackers,

We try to run the entire postgres regression test suite with our
extensions loaded into custom schemas, to verify that we don't break
anything. This works quite well, except for one issue: the
earthdistance regression test case displays everything from every
schema, and because of this, we have to record an alternative output
for it. And we have to rerecord this every time we change something in
an extension.

I attached a simple patch to the test case that modifies it to only
list objects from the public schema. Part of the test case is already
limited to the public schema, this patch just aligns the rest to do
the same.

What do you think?

Вложения

Re: Limit eartdistance regression testcase to the public schema

От
Tom Lane
Дата:
Zsolt Parragi <zsolt.parragi@percona.com> writes:
> I attached a simple patch to the test case that modifies it to only
> list objects from the public schema. Part of the test case is already
> limited to the public schema, this patch just aligns the rest to do
> the same.

> What do you think?

I think this is breaking the test, because part of the point is
to check that there's not anything installed outside the public
schema (until we tell it to, further down).

Admittedly, this only checks schemas that are in the search_path,
but why do you have other stuff in the search_path?  That seems
to cause all kinds of risks of accidentally interfering with
assorted test cases.

            regards, tom lane



Re: Limit eartdistance regression testcase to the public schema

От
Zsolt Parragi
Дата:
> why do you have other stuff in the search_path?  That seems
> to cause all kinds of risks of accidentally interfering with
> assorted test cases.

That was a workaround that seemed to work with everything, except the
earthdistance testcase.

* If I create the extension in the public schema, that interferes with
multiple postgres tests
* If I create the extension in a specific schema, that doesn't change
any postgres test outputs, but then I can't run the existing tests of
the extension itself on the same installation, as it expects the
extension in the search path
* If I create the extension in a specific schema, and add it to the
search path, only the earthdistance testcase has failures

> I think this is breaking the test, because part of the point is
> to check that there's not anything installed outside the public
> schema (until we tell it to, further down).

I see. Further down the next checks specifically only test the
`public` and `c` schemas, but `c` doesn't exist at this point, it is
only created later. This seemed like an easy and safe fix based on
this, I assumed it is also okay to limit the earlier test to the same
schemas. Is there a reason why the later checks are more specific,
shouldn't we remove the `public.*` from the later tests then?

There are of course other solutions to my problem, I mainly chose this
approach because it looked logical to unify these checks.

On Fri, Sep 26, 2025 at 7:16 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Zsolt Parragi <zsolt.parragi@percona.com> writes:
> > I attached a simple patch to the test case that modifies it to only
> > list objects from the public schema. Part of the test case is already
> > limited to the public schema, this patch just aligns the rest to do
> > the same.
>
> > What do you think?
>
> I think this is breaking the test, because part of the point is
> to check that there's not anything installed outside the public
> schema (until we tell it to, further down).
>
> Admittedly, this only checks schemas that are in the search_path,
> but why do you have other stuff in the search_path?  That seems
> to cause all kinds of risks of accidentally interfering with
> assorted test cases.
>
>                         regards, tom lane