pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Remove dynamic translation of regression test scripts, step 1.
2+ messages / 1 participants
[nested] [flat]
* pgsql: Remove dynamic translation of regression test scripts, step 1.
@ 2021-12-20 19:16 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2021-12-20 19:16 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Remove dynamic translation of regression test scripts, step 1.
pg_regress has long had provisions for dynamically substituting path
names into regression test scripts and result files, but use of that
feature has always been a serious pain in the neck, mainly because
updating the result files requires tedious manual editing. Let's
get rid of that in favor of passing down the paths in environment
variables.
In addition to being easier to maintain, this way is capable of
dealing with path names that require escaping at runtime, for example
paths containing single-quote marks. (There are other stumbling
blocks in the way of actually building in a path that looks like
that, but removing this one seems like a good thing to do.) The key
coding rule that makes that possible is to concatenate pieces of a
dynamically-variable string using psql's \set command, and then use
the :'variable' notation to quote and escape the string for the next
level of interpretation.
In hopes of making this change more transparent to "git blame",
I've split it into two steps. This commit adds the necessary
pg_regress.c support and changes all the *.source files in-place
so that they no longer require any dynamic translation. The next
commit will just "git mv" them into the regular sql/ and expected/
directories.
Discussion: https://postgr.es/m/1655733.1639871614@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d1029bb5a26cb84b116b0dee4dde312291359f2a
Modified Files
--------------
contrib/dblink/input/paths.source | 15 +++-
contrib/dblink/output/paths.source | 13 +++-
contrib/file_fdw/input/file_fdw.source | 53 ++++++++++---
contrib/file_fdw/output/file_fdw.source | 55 ++++++++++----
src/pl/plpgsql/src/input/plpgsql_copy.source | 46 ++++++------
src/pl/plpgsql/src/output/plpgsql_copy.source | 43 +++++------
src/test/regress/input/constraints.source | 9 ++-
src/test/regress/input/copy.source | 96 +++++++++++++++---------
src/test/regress/input/create_function_0.source | 41 ++++++----
src/test/regress/input/create_function_1.source | 14 +++-
src/test/regress/input/create_function_2.source | 18 +++--
src/test/regress/input/largeobject.source | 35 +++++----
src/test/regress/input/misc.source | 16 ++--
src/test/regress/input/tablespace.source | 11 ++-
src/test/regress/output/constraints.source | 8 +-
src/test/regress/output/copy.source | 95 ++++++++++++++---------
src/test/regress/output/create_function_0.source | 46 ++++++++----
src/test/regress/output/create_function_1.source | 12 ++-
src/test/regress/output/create_function_2.source | 14 ++--
src/test/regress/output/largeobject.source | 34 +++++----
src/test/regress/output/largeobject_1.source | 34 +++++----
src/test/regress/output/misc.source | 15 ++--
src/test/regress/output/tablespace.source | 9 ++-
src/test/regress/pg_regress.c | 8 ++
24 files changed, 477 insertions(+), 263 deletions(-)
^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Remove dynamic translation of regression test scripts, step 2.
@ 2021-12-20 19:16 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2021-12-20 19:16 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Remove dynamic translation of regression test scripts, step 2.
"git mv" all the input/*.source and output/*.source files into
the corresponding sql/ and expected/ directories. Then remove
the pg_regress and Makefile infrastructure associated with
dynamic translation.
Discussion: https://postgr.es/m/1655733.1639871614@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/dc9c3b0ff21465fa89d71eecf5e6cc956d647eca
Modified Files
--------------
contrib/dblink/Makefile | 1 -
contrib/dblink/expected/.gitignore | 1 -
.../{output/paths.source => expected/paths.out} | 0
contrib/dblink/sql/.gitignore | 1 -
.../dblink/{input/paths.source => sql/paths.sql} | 0
contrib/file_fdw/Makefile | 2 -
contrib/file_fdw/expected/.gitignore | 1 -
.../file_fdw.source => expected/file_fdw.out} | 0
contrib/file_fdw/sql/.gitignore | 1 -
.../{input/file_fdw.source => sql/file_fdw.sql} | 0
src/interfaces/ecpg/test/pg_regress_ecpg.c | 7 +-
src/pl/plpgsql/src/Makefile | 6 -
src/pl/plpgsql/src/expected/.gitignore | 1 -
.../plpgsql_copy.out} | 0
src/pl/plpgsql/src/sql/.gitignore | 1 -
.../plpgsql_copy.source => sql/plpgsql_copy.sql} | 0
src/test/regress/GNUmakefile | 12 +-
src/test/regress/expected/.gitignore | 10 --
.../constraints.out} | 0
.../{output/copy.source => expected/copy.out} | 0
.../create_function_0.out} | 0
.../create_function_1.out} | 0
.../create_function_2.out} | 0
.../largeobject.out} | 0
.../largeobject_1.out} | 0
.../{output/misc.source => expected/misc.out} | 0
.../tablespace.source => expected/tablespace.out} | 0
src/test/regress/pg_regress.c | 150 ---------------------
src/test/regress/pg_regress.h | 2 -
src/test/regress/sql/.gitignore | 9 --
.../constraints.source => sql/constraints.sql} | 0
.../regress/{input/copy.source => sql/copy.sql} | 0
.../create_function_0.sql} | 0
.../create_function_1.sql} | 0
.../create_function_2.sql} | 0
.../largeobject.source => sql/largeobject.sql} | 0
.../regress/{input/misc.source => sql/misc.sql} | 0
.../tablespace.source => sql/tablespace.sql} | 0
38 files changed, 8 insertions(+), 197 deletions(-)
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2021-12-20 19:16 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20 19:16 pgsql: Remove dynamic translation of regression test scripts, step 1. Tom Lane <tgl@sss.pgh.pa.us>
2021-12-20 19:16 pgsql: Remove dynamic translation of regression test scripts, step 2. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox