Re: psql - improve test coverage from 41% to 88% - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: psql - improve test coverage from 41% to 88%
Date
Msg-id alpine.DEB.2.21.1909111606250.19964@lancre
Whole thread Raw
In response to Re: psql - improve test coverage from 41% to 88%  (Michael Paquier <michael@paquier.xyz>)
Responses Re: psql - improve test coverage from 41% to 88%
List 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

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] Race condition in logical walsender causes longpostgresql shutdown delay
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.