Re: TestLib::command_fails_like enhancement - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: TestLib::command_fails_like enhancement
Date
Msg-id CAMsr+YEdLHVSPfnw1q0JPORUkyW=ywnb9LiwVAW+xdaQVDR9EQ@mail.gmail.com
Whole thread Raw
In response to Re: TestLib::command_fails_like enhancement  (Mark Dilger <hornschnorter@gmail.com>)
Responses Re: TestLib::command_fails_like enhancement  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
List pgsql-hackers
On Fri, 8 Nov 2019 at 06:28, Mark Dilger <hornschnorter@gmail.com> wrote:


On 10/31/19 10:02 AM, Andrew Dunstan wrote:
>
> This small patch authored by my colleague Craig Ringer enhances
> Testlib's command_fails_like by allowing the passing of extra keyword
> type arguments. The keyword initially recognized is 'extra_ipcrun_opts'.
> The value for this keyword needs to be an array, and is passed through
> to the call to IPC::Run.

Hi Andrew, a few code review comments:

The POD documentation for this function should be updated to include a
description of the %kwargs argument list.

Since command_fails_like is patterned on command_like, perhaps you
should make this change to both of them, even if you only originally
intend to use the new functionality in command_fails_like.  I'm not sure
of this, though, since I haven't seen any example usage yet.

I'm vaguely bothered by having %kwargs gobble up the remaining function
arguments, not because it isn't a perl-ish thing to do, but because none
of the other functions in this module do anything similar.  The function
check_mode_recursive takes an optional $ignore_list array reference as
its last argument.  Perhaps command_fails_like could follow that pattern
by taking an optional $kwargs hash reference.

Yeah, that's probably sensible. 


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 2ndQuadrant - PostgreSQL Solutions for the Enterprise

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [Patch proposal] libpq portal support
Next
From: Amit Kapila
Date:
Subject: Re: cost based vacuum (parallel)