pg_checksum: add test for coverage
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t46505psql -h localhost -U postgresBuilt from patchset v1 (message #1), September 20, 2026 at 05:45 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t46505_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t46505_1 && git checkout t46505_1Patchset v1 (message #1) is on t46505_1
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/
On Mon, Aug 29, 2022 at 01:46:25PM +0200, Daniel Gustafsson wrote:
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.
DongWook, if you are able to reply back to this feedback, please feel
free to send a new patch. For now, I have marked this CF entry as
returned with feedback.
--
Michael