Re: [PATCH] Add tests for src/backend/nodes/extensible.c - Mailing list pgsql-hackers

From Rafia Sabih
Subject Re: [PATCH] Add tests for src/backend/nodes/extensible.c
Date
Msg-id CA+FpmFc-OrvYwvdL9kcAsSeJzKGpyC7dBD9ZJ=bDCakSX-T8QA@mail.gmail.com
Whole thread
In response to [PATCH] Add tests for src/backend/nodes/extensible.c  (Aleksander Alekseev <aleksander@tigerdata.com>)
List pgsql-hackers


On Tue, 31 Mar 2026 at 20:48, Aleksander Alekseev <aleksander@tigerdata.com> wrote:
Hi,

Currently extensible.c is not covered by any tests. The proposed patch
fixes this. Also it can serve as an example of using CustomScan and
ExtensibleNode.

For the reviewers
-----------------------

Here is how to check the code coverage:

```
git clean -df
rm -r build
meson setup --buildtype debug -Db_coverage=true -Dcassert=true
-Dinjection_points=true -Dtap_tests=enabled -Dldap=disabled
-Dicu=disabled -DPG_TEST_EXTRA="kerberos ldap libpq_encryption
load_balance oauth regress_dump_restore ssl wal_consistency_checking
xid_wraparound" -Dprefix=/home/eax/pginstall build
ninja -C build
meson test -C build
ninja -C build coverage-html
open build/meson-logs/coveragereport/index.html
```

You are going to need `lcov` 1.16 in your $PATH because there are
certain problems with newer versions [1].

[1]: https://postgr.es/m/CAJ7c6TN%2BMCh99EZ8YGhXZAdnqvNQYir6E34B_mmcB5KsxCB00A%40mail.gmail.com

--
Best regards,
Aleksander Alekseev

I looked into this patch and have a few comments.
Firstly, in test_create_custom_scan_state() why hard coding  css.slotOps = &TTSOpsBufferHeapTuple and not using the table_slot_callbacks() for the purpose and getting the real AM.
Next, in test_plan_custom_path, the last two arguments are never used.
There are no tests for nodeCopy, nodeEqual, nodeOut, and nodeRead routines.

--
Regards,
Rafia Sabih
CYBERTEC PostgreSQL International GmbH

pgsql-hackers by date:

Previous
From: Jan Nidzwetzki
Date:
Subject: Re: pg_class.reltuples can become non-finite and never recovers
Next
From: Shlok Kyal
Date:
Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server