Re: psql - improve test coverage from 41% to 88%

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: psql - improve test coverage from 41% to 88%
Date: 2019-09-11 20:52:01
Message-ID: alpine.DEB.2.21.1909111606250.19964@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Bonjour Michaël,

> +=item $node->icommand_checks(cmd, ...)
> +
> +=cut
> +
> +sub icommand_checks
>
> Surely this can have a better description, like say
> PostgresNode::command_checks_all.

Ok.

> Is Expect compatible down to perl 5.8.0 which is the minimum required
> for the TAP tests (see src/test/perl/README)?

I think so. It looks like this has existed for a very long time (22
years?), but I cannot test it simply against a perl 5.8.

> There are cases where we don't support tab completion, aka no
> USE_READLINE. So tests would need to be skipped.

Good catch. I added a skip if it detects that history/readline is
disabled.

> - \a \C arg1 \c arg1 arg2 arg3 arg4 \cd arg1 \conninfo
> + \a
> + \C arg1
> Why are you changing that?

AFAICR this is because the coverage was not the same:-) Some backslash
commands just skip silently to the end of the line, so that intermediate
\commands on the same line are not recognized/processed the same, so I
moved everything on one line to avoid this.

> Your patch does not touch the logic of psql. Could it make sense as a
> separate patch to shape better the tests?

Nope, this is not just reshaping, it is really about improving coverage.

> --- a/src/bin/psql/describe.c
> +++ b/src/bin/psql/describe.c
> @@ -307,6 +307,7 @@ describeTablespaces(const char *pattern, bool
> verbose)
> * a for aggregates
> * n for normal
> + * p for procedure
> This is a separate issue, fixed.

Ok.

Attached v3 which fixes the outlined issues.

--
Fabien.

Attachment Content-Type Size
psql-tap-3.patch text/x-diff 53.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2019-09-11 21:04:59 Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.
Previous Message Alvaro Herrera 2019-09-11 19:52:33 Re: [PATCH] Race condition in logical walsender causes long postgresql shutdown delay