Re: Small TAP improvements - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Small TAP improvements
Date
Msg-id 78241.1655223656@sss.pgh.pa.us
Whole thread Raw
In response to Small TAP improvements  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Small TAP improvements
Re: Small TAP improvements
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> The first makes the argument for $node->config_data() optional. If it's
> not supplied, pg_config is called without an argument and the whole
> result is returned. Currently, if you try that you get back a nasty and
> cryptic error.

No opinion about whether that's useful.

> The second changes the new GUCs TAP test to check against the installed
> postgresql.conf.sample rather than the one in the original source
> location. There are probably arguments both ways, but if we ever decided
> to postprocess the file before installation, this would do the right thing.

Seems like a good idea, especially since it also makes the test code
shorter and more robust(-looking).

Looking at the patch itself,

+my $share_dir = $node->config_data('--sharedir');
+chomp $share_dir;
+$share_dir =~ s/^SHAREDIR = //;
+my $sample_file = "$share_dir/postgresql.conf.sample";

I kind of wonder why config_data() isn't doing the chomp itself;
what caller would not want that?  Pulling off the variable name
might be helpful too, since it's hard to conceive of a use-case
where you don't also need that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: better page-level checksums
Next
From: Tom Lane
Date:
Subject: Re: better page-level checksums