Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Daniel Verite <daniel(at)manitou-mail(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Erik Rijkers <er(at)xs4all(dot)nl>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, PostgreSQL <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers-owner(at)postgresql(dot)org
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)
Date: 2017-03-29 04:18:13
Message-ID: alpine.DEB.2.20.1703290544010.3714@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

> psql_if_on_error_stop ... ok (test process exited with exit code 3)
>
> Don't think we can have that. Even if pg_regress considers it a success,
> every hacker is going to have to learn that that's a "pass",

Well, it says "ok"...

> and I don't think I want to be answering that question every week till
> kingdom come.

Hmmm.

What if the test is renamed, say "psql_if_exit_code_3"? Maybe the clue
would be clear enough to avoid questions? Or just remove the exit message
but check the exit code is as expected?

> I'm not really sure we need a test for this behavior.

My 0.02€:

I have learned the hard way over the years that what is not tested does
not really work, including error behaviors. These tests (well, the initial
TAP version at least) helped debug the feature, and would help keeping it
alive when the code is updated.

Now if you do not want this test, it can be removed. The feature is worthy
even without it.

> If we're sufficiently dead set on it, we could go back to the TAP-based
> approach,

Hmmm. You rejected it. I agree that TAP tests are not well suited for some
simple tests because of their initdb overhead.

> but I still doubt that this test is worth the amount of overhead that
> would add.

I think that there is an underlying issue with keeping on rejecting tests
which aim at having a reasonable code coverage of features by exercising
different paths.

Maybe there could be some "larger but still reasonable tests" activated on
demand so as to being able to keep tests and run them from time to time,
which would not interfere too much with committers' work, and that some
farm animals would run?

I thought that was one of the purpose of TAP tests, but obviously it is
not.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-03-29 04:42:18 Re: [POC] A better way to expand hash indexes.
Previous Message Rafia Sabih 2017-03-29 04:02:43 Re: [COMMITTERS] pgsql: Improve access to parallel query from procedural languages.