Re: pg_checksum: add test for coverage - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: pg_checksum: add test for coverage
Date
Msg-id 2EFDD8CB-025E-48E0-8E69-E0D31FDF2025@yesql.se
Whole thread Raw
In response to pg_checksum: add test for coverage  (Dong Wook Lee <sh95119@gmail.com>)
Responses Re: pg_checksum: add test for coverage
List pgsql-hackers
> On 29 Aug 2022, at 13:26, Dong Wook Lee <sh95119@gmail.com> wrote:

> I add a tiny test to pg_checksum for coverage.
> I checked it improve test coverage 77.9% -> 87.7%.

+# Checksums are verified if --progress arguments are specified
+command_ok(
+    [ 'pg_checksums', '--progress', '-D', $pgdata ],
+    "verifies checksums as default action with --progress option");
+
+# Checksums are verified if --verbose arguments are specified
+command_ok(
+    [ 'pg_checksums', '--verbose', '-D', $pgdata ],
+    "verifies checksums as default action with --verbose option");

This isn't really true, --progress or --verbose doesn't enable checksum
verification, it just happens to be the default and thus is invoked when called
without a mode parameter.

As written these tests aren't providing more coverage, they run more code but
they don't ensure that the produced output is correct.  If you write these
tests with validation on the output they will be a lot more interesting.

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




pgsql-hackers by date:

Previous
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Perform streaming logical transactions by background workers and parallel apply
Next
From: Peter Eisentraut
Date:
Subject: Re: Make #else/#endif comments more consistent