Re: [PATCH] Add tests for src/backend/nodes/extensible.c

From: Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add tests for src/backend/nodes/extensible.c
Date: 2026-07-28 13:01:27
Message-ID: CA+FpmFc-OrvYwvdL9kcAsSeJzKGpyC7dBD9ZJ=bDCakSX-T8QA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 31 Mar 2026 at 20:48, Aleksander Alekseev <aleksander(at)tigerdata(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shlok Kyal 2026-07-28 13:03:08 Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server
Previous Message Jan Nidzwetzki 2026-07-28 12:47:26 Re: pg_class.reltuples can become non-finite and never recovers