pgsql: pg_regress: Don't use absolute paths for the diff

Started by Peter Eisentrautover 7 years ago6 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

pg_regress: Don't use absolute paths for the diff

Don't expand inputfile and outputfile to absolute paths globally, just
where needed. In particular, pass them as is to the file name
arguments of the diff command, so that we don't see the full absolute
path in the diff header, which makes the diff unnecessarily verbose
and harder to read.

Discussion: /messages/by-id/0cc82900-c457-1cee-3ab2-7b0f5d215061@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1995552deb5479a50ec9044f0179f906ff7772e0

Modified Files
--------------
src/test/regress/pg_regress.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

In reply to: Peter Eisentraut (#1)
Re: pgsql: pg_regress: Don't use absolute paths for the diff

On Thu, Feb 21, 2019 at 10:01 AM Peter Eisentraut <peter@eisentraut.org> wrote:

pg_regress: Don't use absolute paths for the diff

Don't expand inputfile and outputfile to absolute paths globally, just
where needed. In particular, pass them as is to the file name
arguments of the diff command, so that we don't see the full absolute
path in the diff header, which makes the diff unnecessarily verbose
and harder to read.

This broke some of my tooling for quickly reconciling expected and
actual test outputs from my text editor.

I don't think that this was a great idea.

--
Peter Geoghegan

#3Andres Freund
andres@anarazel.de
In reply to: Peter Geoghegan (#2)
Re: pgsql: pg_regress: Don't use absolute paths for the diff

On 2019-02-22 15:18:51 -0800, Peter Geoghegan wrote:

On Thu, Feb 21, 2019 at 10:01 AM Peter Eisentraut <peter@eisentraut.org> wrote:

pg_regress: Don't use absolute paths for the diff

Don't expand inputfile and outputfile to absolute paths globally, just
where needed. In particular, pass them as is to the file name
arguments of the diff command, so that we don't see the full absolute
path in the diff header, which makes the diff unnecessarily verbose
and harder to read.

This broke some of my tooling for quickly reconciling expected and
actual test outputs from my text editor.

I don't think that this was a great idea.

Same. The output in my local vpath build is now:

diff -du10 /home/andres/src/postgresql/src/test/regress/expected/strings.out ./results/strings.out
--- /home/andres/src/postgresql/src/test/regress/expected/strings.out   2019-02-08 23:47:42.975815837 -0800
+++ ./results/strings.out       2019-02-22 15:23:41.857719662 -0800

that's useless, because I can't trivially copy the result file into the
expected file anymore. I have to figure out where in the tree it
is. Which isn't exactly predictable, between the different tests we
have as they locate their test results in different places.

This is a bad idea.

Greetings,

Andres Freund

#4Michael Paquier
michael@paquier.xyz
In reply to: Andres Freund (#3)
Re: pgsql: pg_regress: Don't use absolute paths for the diff

On Fri, Feb 22, 2019 at 03:26:35PM -0800, Andres Freund wrote:

that's useless, because I can't trivially copy the result file into the
expected file anymore. I have to figure out where in the tree it
is. Which isn't exactly predictable, between the different tests we
have as they locate their test results in different places.

I haven't paid much attention to this commit, but the new behavior is
likely something which will become annoying in some not-so-far future
for me as well.

This is a bad idea.

+1.
--
Michael
#5Stephen Frost
sfrost@snowman.net
In reply to: Michael Paquier (#4)
Re: pgsql: pg_regress: Don't use absolute paths for the diff

Greetings,

* Michael Paquier (michael@paquier.xyz) wrote:

On Fri, Feb 22, 2019 at 03:26:35PM -0800, Andres Freund wrote:

that's useless, because I can't trivially copy the result file into the
expected file anymore. I have to figure out where in the tree it
is. Which isn't exactly predictable, between the different tests we
have as they locate their test results in different places.

I haven't paid much attention to this commit, but the new behavior is
likely something which will become annoying in some not-so-far future
for me as well.

This is a bad idea.

+1.

Yeah, same here, if I can't easily copy the result file into the
expected file, I'm going to be *most* annoyed...

Thanks!

Stephen

#6Peter Eisentraut
peter_e@gmx.net
In reply to: Stephen Frost (#5)
Re: pgsql: pg_regress: Don't use absolute paths for the diff

OK, reverted.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services