Re: Using LibPq in TAP tests via FFI - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Using LibPq in TAP tests via FFI
Date
Msg-id 202406171345.7k3rpapg67xr@alvherre.pgsql
Whole thread Raw
In response to Re: Using LibPq in TAP tests via FFI  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 2024-Jun-17, Andrew Dunstan wrote:

> On 2024-06-17 Mo 5:07 AM, Alvaro Herrera wrote:

> > You made this function join the tuples from multiple queries together,
> > but the output format doesn't show anything for queries that return
> > empty.  I think this strategy doesn't cater for the case of comparing
> > results from multiple queries very well, because it might lead to sets
> > of queries that return empty result for different queries reported as
> > identical when they aren't.  Maybe add a separator line between the
> > results from each query, when there's more than one?  (Perhaps just
> > "join('--\n', @results)" in that last line does the trick?)
> 
> psql doesn't do that, and this is designed to mimic psql's behaviour. We
> could change that of course. I suspect none of the uses expect empty
> resultsets, so it's probably somewhat moot.

True -- I guess my comment should really be directed to the original
coding of the test in test_index_replay.  I think adding the separator
line makes it more trustworthy.

Probably you're right that the current code of in-core tests don't care
about this, but if we export this technique to the world, I'm sure
somebody somewhere is going to care.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"The Gord often wonders why people threaten never to come back after they've
been told never to return" (www.actsofgord.com)



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: RFC: adding pytest as a supported test framework
Next
From: Pavel Stehule
Date:
Subject: Re: ON ERROR in json_query and the like