Re: vacuumlo: add test to vacuumlo for test coverage - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: vacuumlo: add test to vacuumlo for test coverage
Date
Msg-id DF9A0FD2-1EF1-4C17-A63F-6A8153BC4632@yesql.se
Whole thread Raw
In response to vacuumlo: add test to vacuumlo for test coverage  (Dong Wook Lee <sh95119@gmail.com>)
List pgsql-hackers
> On 3 Sep 2022, at 10:27, Dong Wook Lee <sh95119@gmail.com> wrote:

> I write a tiny patch about vacuumlo to improve test coverage.

If we are paying for setting up a cluster we might as well test more scenarios
than just the one.  Perhaps some other low-hanging fruit like calling vacuumlo
on a non-existing databsase, on one where no LO have been made etc?

One thing about the patch:

+IPC::Run::run [ 'vacuumlo', '-v', '-n', '-p', $port, 'postgres' ], '>', \$stdout;

This should use run_command() which provides facilities for running commands
and capturing STDOUT.  With this the test can be rewritten something like:

my ($out, $err) = run_command(['vacuumlo', .. ]);
like($out, ..);

run_command() is defined in PostgreSQL::Test::Utils.

--
Daniel Gustafsson        https://vmware.com/




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: proposal: possibility to read dumped table's name from file
Next
From: Ashutosh Bapat
Date:
Subject: Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.