Re: Getting rid of regression test input/ and output/ files - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Getting rid of regression test input/ and output/ files
Date
Msg-id CADkLM=f=eKERdpA1YBZjd38u5=JQyUkcHYj2dX7ZJCZkec-_sQ@mail.gmail.com
Whole thread Raw
In response to Re: Getting rid of regression test input/ and output/ files  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Getting rid of regression test input/ and output/ files  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: sqlsmith: ERROR: XX000: bogus varno: 2
Next
From: Tom Lane
Date:
Subject: Re: Getting rid of regression test input/ and output/ files