Re: Using Test::More test functions for pg_rewind

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Using Test::More test functions for pg_rewind
Date: 2022-02-21 15:17:32
Message-ID: d1c7c45f-9c66-e991-383a-d308e86d75b5@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2/21/22 09:10, Daniel Gustafsson wrote:
> check_query() in RewindTest.pm currently has this comment before handrolling
> tests for return code and stderr:
>
> # We don't use ok() for the exit code and stderr, because we want this
> # check to be just a single test.
>
> The code came with the initial import of pg_rewind, and there is no further
> explanation but I guess it was to make test planning easier since each
> check_query would count as 1 test. (inspecting old pre-import pg_rewind repos
> on Github didn't given any other insights). Does anymore remember the
> rationale for this?
>
> Since we moved to done_testing() with 549ec201d we no longer need be concerned
> with test counts, so we can replace this with normal is() tests, as per the
> attached, making the output in the errorpath consistent with other tests.
> Unless I'm missing something important here.

Looks OK. Now we require a sufficiently modern Test::More we could have
made it a subtest if necessary.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zheng Li 2022-02-21 15:53:43 Support logical replication of DDLs
Previous Message Daniel Gustafsson 2022-02-21 14:29:09 Re: pg_upgrade verbosity when redirecting output to log file