Re: Getting rid of regression test input/ and output/ files

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Getting rid of regression test input/ and output/ files
Date: 2021-12-19 22:34:02
Message-ID: CADkLM=f=eKERdpA1YBZjd38u5=JQyUkcHYj2dX7ZJCZkec-_sQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> 0001 adds the \getenv command to psql; now with documentation
> and a simple regression test.
>

+1. Wish I had added this years ago when I had a need for it.

>
> 0002 tweaks pg_regress to export the needed values as environment
> variables, and modifies the test scripts to use those variables.
> (For ease of review, this patch modifies the scripts in-place,
> and then 0003 will move them.) A few comments on this:
>
> * I didn't see any value in exporting @testtablespace@ as a separate
> variable; we might as well let the test script know how to construct
> that path name.
>
> * I concluded that the right way to handle the concatenation issue
> is *not* to rely on SQL literal concatenation, but to use psql's
> \set command to concatenate parts of a string. In particular this
>

+1 to that, much better than the multi-line thing.

I have a nitpick about the \getenv FOO FOO lines.
It's a new function to everyone, and to anyone who hasn't seen the
documentation it won't be immediately obvious which one is the ENV var and
which one is the local var. Lowercasing the local var would be a way to
reinforce which is which to the reader. It would also be consistent with
var naming in the rest of the script.

>
> 0004 finally removes the no-longer-needed infrastructure in
>

+1
Deleted code is debugged code.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-12-19 22:48:02 Re: Getting rid of regression test input/ and output/ files
Previous Message Tom Lane 2021-12-19 21:17:16 Re: sqlsmith: ERROR: XX000: bogus varno: 2