Re: [PATCH] Improve code coverage of network address functions

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Keisuke Kuroda <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com>
Subject: Re: [PATCH] Improve code coverage of network address functions
Date: 2025-01-28 23:53:17
Message-ID: Z5lt7bNaa2qVFpWi@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 28, 2025 at 01:33:58PM +0300, Aleksander Alekseev wrote:
> Thanks for your feedback!

set_masklen(inet) could be covered for the -1 case, and it was missing
in the patch submitted. For consistency with the other queries,
moving the call of abbrev(inet) with the existing abbrev(cidr) makes
more sense, I guess, and we could expand a bit the use of aliases in
the attributes even for the existing queries with broadcast() and
abbrev() to make the output nicer.

> So to clarify, you propose creating a new file for the test (still in
> the ssl/ suite) or keep it as is?
>
> I agree that this is not exactly the best place for the test. However
> I'm not sure whether creating a new one, e.g.
> ssl/t/004_code_coverage.pl will be much better considering the fact
> that the test still has little (nothing) to do with SSL.
>
> Personally I'm fine with either option though.

To be honest, I don't what's the best course of action here :)

Sticking that into the SSL tests looks incorrect to me. If we care
only about the execution without the output, a SQL test is the most
common practice. People can also use pg_regress with custom
connection strings, but I agree that it limits the impact of these
additions in the default cases where the tests are run using a unix
domain socket and these return NULL.

The SQL tests don't fall into that category and they are nice
additions, so I have applied this part with the tweaks mentioned
above.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-01-29 00:09:32 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Sami Imseih 2025-01-28 23:41:39 Re: Logging parallel worker draught