Skip to content

CI: run the TAP, PL and module test suites - #2263

Open
tuhaihe wants to merge 18 commits into
apache:REL_2_STABLEfrom
tuhaihe:ci-rel2-more-tests
Open

tuhaihe wants to merge 18 commits into
apache:REL_2_STABLEfrom
tuhaihe:ci-rel2-more-tests

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Nov 6, 2026

Copy link
Copy Markdown
Member

configure-cloudberry.sh builds with --enable-tap-tests, but CI runs TAP tests only in src/test/recovery. The other TAP suites, and the suites in src/pl and src/test/modules, do not run at all, so nobody sees when they break.

Add two test jobs:

  • ic-tap: the TAP suites in src/bin, libpq, src/test/authentication and src/test/postmaster.
  • ic-pl-modules: PL/Perl, PL/pgSQL, PL/Python and the suites in src/test/modules.

Some of these suites fail now: pg_basebackup, pg_dump, the postmaster, brin, delay_execution, plsample, spgist_name_ops, test_pg_dump, test_planner and test_predtest. We will fix them in separate changes.

This change does not add suites that do not test anything here: the kerberos and ldap suites need servers that the build image does not have, the ssl suite needs PG_TEST_EXTRA, and pg_amcheck, commit_ts, snapshot_too_old, test_rls_hooks, unsafe_tests and worker_spi do not run with installcheck.

The build does not install src/test/modules, so those entries run "install installcheck". The test steps joined make_configs with spaces and then split the result on spaces, so such an entry became two configurations. Join the entries with newlines and read one entry per line instead. All other entries give the same configurations as before.

Assisted-by: Claude Code

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


tuhaihe and others added 17 commits November 6, 2026 14:58
configure-cloudberry.sh builds with --enable-tap-tests, but CI runs TAP
tests only in src/test/recovery.  The other TAP suites, and the suites
in src/pl and src/test/modules, do not run at all, so nobody sees when
they break.

Add two test jobs:

- ic-tap: the TAP suites in src/bin, libpq, src/test/authentication
  and src/test/postmaster.
- ic-pl-modules: PL/Perl, PL/pgSQL, PL/Python and the suites in
  src/test/modules.

Some of these suites fail now: pg_basebackup, pg_dump, the postmaster,
brin, delay_execution, plsample, spgist_name_ops, test_pg_dump,
test_planner and test_predtest.  We will fix them in separate changes.

This change does not add suites that do not test anything here: the
kerberos and ldap suites need servers that the build image does not
have, the ssl suite needs PG_TEST_EXTRA, and pg_amcheck, commit_ts,
snapshot_too_old, test_rls_hooks, unsafe_tests and worker_spi do not
run with installcheck.

The build does not install src/test/modules, so those entries run
"install installcheck".  The test steps joined make_configs with spaces
and then split the result on spaces, so such an entry became two
configurations.  Join the entries with newlines and read one entry per
line instead.  All other entries give the same configurations as before.

Assisted-by: Claude Code
This reverts commit e9f15bc. Instead of a hacky solution that didn't
work on Windows, we avoid trying to move the directory possibly across
drives, and instead remove it and recreate it in the new location.

Discussion: https://postgr.es/m/20240707070243.sb77kp4ubowauctz@awork3.anarazel.de

Backpatch to release 14 like the previous patch.

(cherry picked from commit 4ac0825)

Cloudberry: REL_2_STABLE does not have e9f15bc, so this applies to the
older rename() code.  In the CI containers, the data directory and
/tmp are on different file systems, so rename() fails with EXDEV and
010_pg_basebackup.pl stops with "could not move pg_replslot".

Assisted-by: Claude Code
Commit a27ca0c, which took a set of changes from main, changed
MAX_TARABLE_SYMLINK_PATH_LENGTH from 100 to 200.  This limit is
Cloudberry code, not PostgreSQL code.  The tar format still keeps only
100 bytes of a link target.

So a tablespace location of 100 to 199 characters does not cause the
"too long for TAR" warning in CREATE TABLESPACE.  A base backup of the
server then fails with the general "symbolic link target too long for
tar format" error and not with the Cloudberry message that tells why.
Checks 113 and 116 in 010_pg_basebackup.pl fail because of this.

Restore the limit to 100.

Assisted-by: Claude Code
The postmaster test 004_negotiate.pl could fail due to IO::Socket::INET
gone missing, in environments that cannot use Unix sockets.

Oversight in the backport done in 6dffaeb8e54c, so like the other commit
this is applied across the v14~17 range.  Per buildfarm member drongo.

Security: CVE-2026-6479
Backpatch-through: 14
(cherry picked from commit 81c0c77f27bf3ea4ff1ee2e85d782d4c73ff9161)
Commit 4c15327 removed some redundant uses of 'use 5.008001;' in perl
scripts, including in plperl's plc_perlboot.pl. Because it made other
changes it wasn't backpatched. However, now this is causing a failure on
back branches when built with bleeding edge perl. Therefore, backpatch
just that part of it which removed those uses, from 15 all the way down
to 9.2, which is the earliest version currently built in the buildfarm.

per report from Alexander Lakhin

Discussion: https://postgr.es/m/4cc2ee93-e03c-8e13-61ed-412e7e6ff19d@gmail.com
(cherry picked from commit 20f22e6a67bcb90fbc4b40d7368ed309377c06b4)
raw_connect() and raw_connect_works() in PostgresNode.pm read
$PostgreSQL::Test::Utils::use_unix_sockets.  In REL_2_STABLE,
PostgreSQL::Test::Utils is an alias of TestLib that a test makes only
after PostgresNode.pm is compiled.  So these functions see a variable
that is never set, and raw_connect() always opens a TCP connection.
The test nodes listen only on a Unix socket, and
src/test/postmaster/t/004_negotiate.pl fails with "Cannot create
socket".

Use $TestLib::use_unix_sockets, as the rest of PostgresNode.pm does.

Assisted-by: Claude Code
For servers of version 11 and later, the getTriggers() query returns
t.tgisinternal with the name tgispartition, but the code reads the
column tgisinternal.  PQfnumber() returns -1, and pg_dump stops with
"column number -1 is out of range" for each database that has a
trigger on a table.  pg_dumpall stops too.

Do not rename the column, as in PostgreSQL 14.

Assisted-by: Claude Code
The dumpAgg() query has no comma after aggmfinalmodify, so the next
column, aggrepsafeexec, becomes an alias of aggmfinalmodify:

  aggmfinalmodify
  aggrepsafeexec
  FROM pg_catalog.pg_aggregate a, ...

PQfnumber(res, "aggmfinalmodify") then returns -1.  pg_dump stops with
"column number -1 is out of range" or crashes for each user-defined
aggregate that it dumps, for example with --binary-upgrade.

Add the comma.

Assisted-by: Claude Code
selectDumpableFunction() and selectDumpableAggregate() copy dobj.dump
of the parent schema.  For schema public, dobj.dump is only
DUMP_COMPONENT_ACL, because pg_dump does not create this schema.  So a
plain pg_dump leaves out all user functions and aggregates in schema
public, and it does not give an error.

Use dobj.dump_contains of the schema, as selectDumpableObject() does.
This came with 39cb750.

Assisted-by: Claude Code
- Disable 'CREATE DATABASE regression_invalid'.  It came with
  39c093b and tests c66a7d7, which REL_2_STABLE does not have.
  Without that change there are no invalid databases, and pg_dumpall
  dumps this one.  Also its UPDATE of pg_database fails, because
  Cloudberry refuses DML on a system catalog.  This error stopped the
  test before it ran any checks.
- The only_dump_measurement run dumps only dump_test.measurement and
  its partitions.  Do not expect it to dump ao_table, dynamic_table,
  matview_ivm, matview_compression, test_compression and the extended
  statistics objects.

Now the pg_dump TAP tests pass 8177 of 8177.

Assisted-by: Claude Code
pg_isolation_regress needs gpdiff.pl in its own directory, and stops
if it is not there.  Only the installcheck targets in
src/test/isolation make the links to gpdiff.pl and the files it uses.
The installcheck rule of a PGXS module runs only "make all" in
src/test/isolation, so isolation tests of modules such as brin and
delay_execution stop at once in a fresh build tree.

Make the links in "all".

Assisted-by: Claude Code
partition-removal-1 tests ALTER TABLE ... DETACH PARTITION ...
CONCURRENTLY, which Cloudberry does not support.  Each step gives
"cannot support detach partitions concurrently now", so the test
checks nothing.  src/test/isolation does not run the
detach-partition-concurrently tests for the same reason.

Assisted-by: Claude Code
Cloudberry removes trailing white space from each error message
(cdb_strip_trailing_whitespace() in elog.c).  So the NOTICE with the
source text of a function does not end with an empty line.

Assisted-by: Claude Code
The test was never adapted to Cloudberry:

- CREATE TABLE without DISTRIBUTED BY gives a NOTICE and a HINT.
- The plans have a Gather Motion.  GPORCA makes other plans, so add
  spgist_name_ops_optimizer.out.
- Cloudberry has more binary_upgrade functions, and some of them take
  more arguments.
- The block size is 32 kB, so the long index tuple fits and the INSERT
  does not fail with error 54000.

Assisted-by: Claude Code
10 of 868 checks fail on behavior that is different in Cloudberry:

- The default cache of a sequence is 20, not 1.
- So nextval() takes 20 values, and pg_dump writes setval(..., 20).
- pg_dump writes the SQL data access of a function, CONTAINS SQL.

Expect these, as on main.

Assisted-by: Claude Code
pg_parse_query() returns a list of RawStmt, and
pg_analyze_and_rewrite() takes a RawStmt.  planner_test_helpers.c kept
it in a Node pointer, and GCC 14 refuses this with
-Werror=incompatible-pointer-types, so the module does not build.

Assisted-by: Claude Code
test_predtest() plans the test query and examines the quals of the
plan that the Postgres planner makes.  With GPORCA, which CI enables,
the plans are different and 9 results do not agree with the expected
output.  Turn GPORCA off in the test.

Assisted-by: Claude Code

@leborchuk leborchuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but libpq tests should be also fixed, right now we see failing ic-tap

In REL_2_STABLE, "make -C src/interfaces/libpq installcheck" does not
run TAP tests.  It runs test/regress.pl, which writes only "All tests
passed".  parse-results.pl does not know this output, so it sets
parse_error for this configuration, and the ic-tap job fails although
all tests passed.

Remove the entry.  On main, libpq has TAP tests that CI can parse.

Assisted-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants