Re: TAP testing for psql's tab completion code

2019-12-30 Thread Fabien COELHO
Hello Tom, I do not think it is a good idea, because help output is quite large, there are many of them, and we should certainly not want it stored repeatedly in output files for diffs. Hm, I don't follow --- we are most certainly not going to exercise \help for every possible SQL keyword, t

Re: TAP testing for psql's tab completion code

2019-12-30 Thread Tom Lane
Fabien COELHO writes: >> Well, I think that where possible we ought to test using the existing >> test infrastructure -- help, for example, seems like it could perfectly >> well be tested in src/test/regress/sql/psql.sql, or we could move stuff >> out to a new set of SQL test scripts under src/

Re: TAP testing for psql's tab completion code

2019-12-30 Thread Fabien COELHO
That is what my patch does: it tests prompts, tab completion, help, command options… and I added tests till I covered most psql source. Well, I think that where possible we ought to test using the existing test infrastructure -- help, for example, seems like it could perfectly well be tested

Re: TAP testing for psql's tab completion code

2019-12-29 Thread Tom Lane
Fabien COELHO writes: >> No, I disagree with that. If configure thinks it built with readline, >> and then the actual binary acts like it doesn't have readline, that's >> a bug that we'd like the tests to detect. > Hmmm. Sure, that's a point. > What about running some tests on an installed vers

Re: TAP testing for psql's tab completion code

2019-12-29 Thread Fabien COELHO
I'm not fan of relying on the configure stuff ("with_readline"), in my Expect version I tested if history capabilities are available from psql itself. No, I disagree with that. If configure thinks it built with readline, and then the actual binary acts like it doesn't have readline, that's a

Re: TAP testing for psql's tab completion code

2019-12-29 Thread Tom Lane
Fabien COELHO writes: > I've looked at your PoC implementation: > I'm not fan of relying on the configure stuff ("with_readline"), in my > Expect version I tested if history capabilities are available from psql > itself. No, I disagree with that. If configure thinks it built with readline, an

Re: TAP testing for psql's tab completion code

2019-12-29 Thread Fabien COELHO
Hello Tom, If you have to install IO::Pty anyway, ISTM you can also install Expect. My point is precisely that buildfarm owners *won't* have to install IO::Pty; it comes in a default Perl install almost everywhere. I'm afraid that's not true of Expect. Hmmm. That is a good argument. Now

Re: TAP testing for psql's tab completion code

2019-12-29 Thread Tom Lane
Fabien COELHO writes: >> on the machines I have handy, the only one in which [Expect] appears in the >> default Perl installation is macOS. (Huh, what's Apple doing out ahead >> of the pack?) I'm pretty sure that Expect also relies on IO::Pty, > Indeed, it does. >> so it's a strictly worse d

Re: TAP testing for psql's tab completion code

2019-12-28 Thread Fabien COELHO
Hello Tom, We've often talked about the problem that we have no regression test coverage for psql's tab completion code. I got interested in this issue while messing with the filename completion logic therein [1], so here is a draft patch that adds some testing for that code. After you rai

Re: TAP testing for psql's tab completion code

2019-12-28 Thread Tom Lane
Fabien COELHO writes: >> We've often talked about the problem that we have no regression test >> coverage for psql's tab completion code. I got interested in this >> issue while messing with the filename completion logic therein [1], >> so here is a draft patch that adds some testing for that cod

Re: TAP testing for psql's tab completion code

2019-12-28 Thread Fabien COELHO
Hello Tom, We've often talked about the problem that we have no regression test coverage for psql's tab completion code. I got interested in this issue while messing with the filename completion logic therein [1], so here is a draft patch that adds some testing for that code. This is just pr

TAP testing for psql's tab completion code

2019-12-28 Thread Tom Lane
We've often talked about the problem that we have no regression test coverage for psql's tab completion code. I got interested in this issue while messing with the filename completion logic therein [1], so here is a draft patch that adds some testing for that code. This is just preliminary invest