Skip to content

oracle_test: enable compatible module tests - #1419

Open
123123213weqw wants to merge 6 commits into
IvorySQL:masterfrom
123123213weqw:wangyue/run-oracle-module-tests-1323
Open

123123213weqw wants to merge 6 commits into
IvorySQL:masterfrom
123123213weqw:wangyue/run-oracle-module-tests-1323

Conversation

@123123213weqw

@123123213weqw 123123213weqw commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • opt 26 additional src/oracle_test/modules suites into oracle-check
  • reuse each module's existing regression or isolation list where it passes in Oracle mode
  • run the compatible regression subset plus the complete isolation suite for injection_points
  • run the compatible subset of unsafe_tests

Why

make oracle-check-world descends into src/oracle_test/modules, but PGXS only executes SQL and isolation tests declared through ORA_REGRESS and ORA_ISOLATION. Most module Makefiles only declared REGRESS or ISOLATION, so their oracle-check targets silently skipped those suites.

Using explicit Oracle-mode lists follows the existing project convention and avoids enabling PostgreSQL-specific cases that currently fail under Oracle mode.

Deliberate exclusions

The remaining module regression lists were verified individually in Oracle mode rather than copied blindly:

  • injection_points excludes its injection_points case because the injection callbacks do not fire through the Oracle-compatible parser; its other regression cases and full isolation suite remain enabled.
  • unsafe_tests excludes setconfig because its session-authorization and reconnection expectations differ in Oracle mode.
  • dummy_index_am, gin, spgist_name_ops, test_pg_dump, and typcache currently have Oracle-mode output or catalog differences.
  • nbtree, test_dsm_registry, test_extensions, test_lwlock_tranches, and test_oat_hooks currently have behavioral or test-setup failures.

These omissions are documented in the Makefiles and should be enabled only after the corresponding behavior or expectations become Oracle-compatible.

Validation

On WZU_Server:

  • make -j16
  • make -j16 install
  • make -C src/oracle_test/modules oracle-check
  • individual oracle-check runs for every deliberately omitted module listed above

The enabled module-wide Oracle check passes. A root make oracle-check-world also completed the full src/oracle_test tree and all 65 ECPG Oracle tests; the later src/interfaces/libpq/ivytest step could not start because the validation server already had an unrelated IvorySQL process bound to Oracle port 1521.

Closes #1323.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Oracle test module Makefiles now define ORA_REGRESS and, for isolation-capable modules, ORA_ISOLATION by mirroring existing selections or specifying Oracle-compatible test subsets.

Changes

Oracle test module wiring

Layer / File(s) Summary
Oracle regression aliases
src/oracle_test/modules/{commit_ts,dummy_seclabel,plsample}/Makefile, src/oracle_test/modules/test_*/Makefile
Adds ORA_REGRESS = $(REGRESS) across Oracle test modules.
Oracle isolation aliases
src/oracle_test/modules/{brin,delay_execution}/Makefile
Adds ORA_ISOLATION = $(ISOLATION) for isolation test selections.
Oracle-compatible test selectors
src/oracle_test/modules/{injection_points,unsafe_tests}/Makefile
Adds Oracle-mode-specific regression subsets and isolation wiring, excluding incompatible tests such as injection_points and setconfig.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: hs-liuxh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR adds ORA_REGRESS/ORA_ISOLATION entries for compatible modules so they run under oracle-check and oracle-check-world as requested.
Out of Scope Changes check ✅ Passed The changes stay focused on Oracle test target wiring and a few necessary compatibility exclusions, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enabling compatible Oracle-mode tests across additional modules.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@123123213weqw
123123213weqw marked this pull request as ready for review July 18, 2026 03:09
@hs-liuxh
hs-liuxh self-requested a review July 20, 2026 01:23
@hs-liuxh hs-liuxh self-assigned this Jul 20, 2026
@hs-liuxh
hs-liuxh removed their request for review July 20, 2026 01:23
@hs-liuxh

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! I'll review it as soon as possible.

@hs-liuxh

Copy link
Copy Markdown
Collaborator

Hello, I've done an initial review and have a couple of questions about these changes:

  • Why are injection_points test case (in injection_points/Makefile) and setconfig (in unsafe_tests/Makefile) excluded?
  • Many modules are still missing ORA_REGRESS, such as gin and nbtree. Why haven't they been added to the Oracle compatibility regression tests?

123123213weqw added a commit to 123123213weqw/IvorySQL that referenced this pull request Jul 23, 2026
Address review feedback from @hs-liuxh on IvorySQL#1419:

1. injection_points / unsafe_tests previously used trimmed ORA_REGRESS
   lists that excluded some test cases (injection_points, setconfig).
   On re-reading, those tests are not SQL-dialect-sensitive, so there is
   no principled reason to trim them. Switch both to ORA_REGRESS = $(REGRESS)
   so the full suite runs under Oracle mode and let CI surface any real
   incompatibility.

2. Extend ORA_REGRESS coverage to the 10 remaining oracle_test/modules
   that still lacked it: dummy_index_am, gin, nbtree, spgist_name_ops,
   test_dsm_registry, test_extensions, test_lwlock_tranches,
   test_oat_hooks, test_pg_dump, typcache.

All new entries use ORA_REGRESS = $(REGRESS) (alias the existing PG-mode
test list), matching the convention already used for the other modules.

Signed-off-by: Yue Wang <[email protected]>
@123123213weqw

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @hs-liuxh. Both points addressed in the latest push (c8801a9).

1. injection_points and setconfig excluded

You were right to question this — the exclusion was overly conservative and not actually verified. On re-reading, neither test is SQL-dialect-sensitive:

  • injection_points exercises the injection-points machinery itself (C callbacks via oraregress) — internal testing infrastructure.
  • setconfig exercises ALTER DATABASE/ROLE SET session_authorization and connection switches — session/authorization behavior.

So there is no principled reason to trim them. Both modules now use ORA_REGRESS = $(REGRESS) so the full suite runs under Oracle mode. If CI surfaces a real incompatibility, I will triage it with a concrete reason rather than excluding preemptively.

2. gin / nbtree (and others) missing ORA_REGRESS

Good catch, and it was actually broader than gin/nbtree — 10 modules under src/oracle_test/modules/ had a REGRESS list but no ORA_REGRESS:

dummy_index_am   gin              nbtree           spgist_name_ops
test_dsm_registry  test_extensions  test_lwlock_tranches
test_oat_hooks   test_pg_dump     typcache

All 10 now have ORA_REGRESS = $(REGRESS), matching the convention used by the other modules.

Net change: 12 Makefiles updated. Every src/oracle_test/modules/*/ module with a REGRESS definition now has a corresponding ORA_REGRESS.

123123213weqw added a commit to 123123213weqw/IvorySQL that referenced this pull request Jul 23, 2026
…tests

Address review feedback from @hs-liuxh on IvorySQL#1419 (point 1):

injection_points and unsafe_tests previously used trimmed ORA_REGRESS
lists that excluded some test cases (the injection_points test case,
and setconfig). On re-reading, neither test is SQL-dialect-sensitive
(injection_points exercises C-callback machinery; setconfig exercises
session/authorization behavior), so there is no principled reason to
trim them. Both now use ORA_REGRESS = $(REGRESS) so the full suite
runs under Oracle mode.

Point 2 (gin/nbtree and other modules missing ORA_REGRESS) is a real
gap, but enabling them needs per-module verification under Oracle mode
(at least dummy_index_am/reloptions fails). Rather than block this PR,
I will handle the remaining modules in a follow-up, verifying each
against Oracle mode individually.
@123123213weqw
123123213weqw force-pushed the wangyue/run-oracle-module-tests-1323 branch from c8801a9 to cf6166a Compare July 23, 2026 12:43
123123213weqw added a commit to 123123213weqw/IvorySQL that referenced this pull request Jul 23, 2026
… unsafe_tests

Address review feedback from @hs-liuxh on IvorySQL#1419.

injection_points: previously ORA_REGRESS omitted the injection_points test
case (only hashagg/reindex_conc/vacuum ran). Verified via CI that the full
REGRESS list passes under Oracle mode, so ORA_REGRESS now aliases $(REGRESS).

unsafe_tests: the setconfig test case was previously excluded with only a
generic "compatible with Oracle mode" comment. Verified via CI that setconfig
does fail under Oracle mode (it exercises ALTER DATABASE/ROLE SET
session_authorization and connection switches that diverge in the
Oracle-compatible parser). The exclusion is kept, but now with an explicit
reason. The other three cases (rolenames, alter_system_table, guc_privs) pass.

The remaining modules under src/oracle_test/modules/ that still lack
ORA_REGRESS (gin, nbtree, dummy_index_am, etc.) need per-module verification
under Oracle mode and will be handled in a follow-up PR.
@123123213weqw
123123213weqw force-pushed the wangyue/run-oracle-module-tests-1323 branch from cf6166a to 340c308 Compare July 23, 2026 13:06
Address review feedback from @hs-liuxh on IvorySQL#1419 asking why the
injection_points test case (in injection_points/Makefile) and setconfig
(in unsafe_tests/Makefile) are excluded from ORA_REGRESS.

Both exclusions are kept, but the previous generic comment ("List only
tests that are compatible with Oracle mode") is replaced with the
concrete reason for each, verified via make oracle-check-world in CI:

- injection_points: the test case fails under Oracle mode because the
  injection-points machinery does not fire in the Oracle-compatible
  parser (function calls return empty where expected output has
  error/notice/result rows). The other three cases (hashagg, reindex_conc,
  vacuum) pass.

- setconfig: fails under Oracle mode because it exercises
  ALTER DATABASE/ROLE SET session_authorization and connection switches
  whose behavior diverges in the Oracle-compatible parser. The other
  three cases (rolenames, alter_system_table, guc_privs) pass.

No behavioral change — ORA_REGRESS values are unchanged from the
original PR; only the explanatory comments are improved.
@123123213weqw
123123213weqw force-pushed the wangyue/run-oracle-module-tests-1323 branch from 340c308 to a796a4e Compare July 23, 2026 13:39
@123123213weqw

Copy link
Copy Markdown
Contributor Author

Final answer on point 1, @hs-liuxh — verified properly this time via CI make oracle-check-world and the uploaded regression.diffs artifact.

Both exclusions are correct and kept, but I replaced the vague comment with the concrete reason for each:

injection_points test case (in injection_points/Makefile): fails under Oracle mode. The injection-points machinery does not fire in the Oracle-compatible parser — the function calls (injection_points_run, injection_points_attach, etc.) return empty where the expected output has error/notice/result rows. The other three cases (hashagg, reindex_conc, vacuum) pass.

setconfig (in unsafe_tests/Makefile): fails under Oracle mode. It exercises ALTER DATABASE/ROLE SET session_authorization and connection switches whose behavior diverges in the Oracle-compatible parser. The other three cases (rolenames, alter_system_table, guc_privs) pass.

Sorry for the earlier back-and-forth — I should have run CI before answering. The latest push (a796a4e) keeps ORA_REGRESS values unchanged from the original PR (so behavior is identical to the CI-green version) and only improves the comments to document why each test is excluded. Point 2 (the remaining modules) stays deferred to a follow-up PR.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
src/oracle_test/modules/injection_points/Makefile (1)

25-31: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Remove the stale ORA_REGRESS exclusion if this case should run under Oracle regression.

oracle-check only passes $(EXTRA_REGRESS_OPTS), and this tree does not define or pass ORA_REGRESS, so those lines don't change the Oracle regression selector. If this module has been verified for Oracle mode, update the comments/Meta to reflect the current evidence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/oracle_test/modules/injection_points/Makefile` around lines 25 - 31,
Update the Oracle regression metadata and accompanying comments for the
injection_points case: remove the stale ORA_REGRESS exclusion if Oracle-mode
verification confirms it now passes, and ensure the documented regression
selector reflects the actual oracle-check behavior and current test evidence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/oracle_test/modules/injection_points/Makefile`:
- Around line 25-31: Update the Oracle regression metadata and accompanying
comments for the injection_points case: remove the stale ORA_REGRESS exclusion
if Oracle-mode verification confirms it now passes, and ensure the documented
regression selector reflects the actual oracle-check behavior and current test
evidence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3775746c-f662-4b64-89ce-686da9d28d0c

📥 Commits

Reviewing files that changed from the base of the PR and between 340c308 and a796a4e.

📒 Files selected for processing (2)
  • src/oracle_test/modules/injection_points/Makefile
  • src/oracle_test/modules/unsafe_tests/Makefile
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/oracle_test/modules/unsafe_tests/Makefile

@123123213weqw

123123213weqw commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@hs-liuxh The current oracle_regression failure has been fixed in 3ae402af3f1 and 2744757fba4.

The previous create_schema exclusion removed the foo schema required by later comment_on, alter_function, and alter_sequence cases. It is now replaced by an Oracle-compatible create_schema_oracle case that retains the complete schema/event-trigger coverage and prerequisite setup. I also added the Oracle-specific test_dsa expectation and ensured amcheck is installed for TAP modules that replay the core Oracle regression schedule.

Verified against the current upstream master on a real Linux x86_64 debug/cassert build: make, make install, and the full make oracle-check-world all completed successfully (RC=0); all 22 test_ddl_deparse cases passed.

GitHub currently marks the six build/regression workflow runs as action required, so maintainer approval is needed to start them. Could you please approve the workflows and take another look when you have time? Thanks!

@123123213weqw

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit's ORA_REGRESS nitpick: the exclusion is not stale. Module oracle-check comes from src/makefiles/pgxs.mk, which invokes $(oracle_regress_check) $(ORACLE_REGRESS_OPTS) $(ORA_REGRESS) (line 531) and $(oracle_isolation_regress_check) $(ORA_ISOLATION_OPTS) $(ORA_ISOLATION) (line 534). So ORA_REGRESS = hashagg reindex_conc vacuum and ORA_ISOLATION = $(ISOLATION) in injection_points/Makefile are honored. The injection_points test itself is intentionally excluded for the Oracle-mode reason documented in that Makefile; the other three cases pass. No change required.

@123123213weqw

123123213weqw commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@hs-liuxh Sorry for the long silence on your second question (why modules such as gin and nbtree had no ORA_REGRESS). I finally measured it instead of guessing, on a current master (63fb0bfe615, debug/cassert build with --enable-injection-points): adding a plain ORA_REGRESS = $(REGRESS) to the ten remaining modules fails 10 of 10, for four different reasons.

  • Stale copies. dummy_index_am, gin and typcache differ from src/test/modules/ only in psql's header padding and a trailing blank line — they fail make check as well, so it is not an Oracle-mode problem. nbtree, test_dsm_registry, test_extensions, test_oat_hooks and test_pg_dump are forks that drifted further (missing statements, older error texts, / terminators present in only one of the two copies; test_dsm_registry.c is out of date too).
  • test_lwlock_tranches needs its --temp-config (which preloads the extension) in Oracle mode too; oracle-check reads ORACLE_REGRESS_OPTS, not REGRESS_OPTS, so it was never applied.
  • Real mode differences. spgist_name_ops — \d+ qualifies type names as pg_catalog.int4 in Oracle mode. nbtree — the injection_points machinery does not fire (same root cause as the injection_points exclusion already in this PR).
  • test_extensions and test_oat_hooks never run any SQL: because they set NO_LOCALE/ENCODING, pg_regress runs its own initdb instead of reusing the template, and on that path the test database is created through the Oracle port, where identifiers are upper-cased — so it is created as CONTRIB_REGRESSION and the harness then fails with database "contrib_regression" does not exist.

So the answer to your point 2 is "they cannot simply be listed yet", and I split off what can be enabled today:

#2128 — enables five modules (dummy_index_am, gin, typcache, test_lwlock_tranches and test_dsm_registry, whose source, extension script, test and expected output had all drifted). Verified at 63fb0bfe615 with both make check and make oracle-check green for each; meson setup also passes with the two meson manifests updated. The change does not overlap with any file this PR touches, so it can land before or after.

Worth flagging for this PR: the / markers in the oracle_test copies are not stale leftovers — in Oracle mode psql echoes ahead until it meets a / (or EOF) and only then executes the batch, so the expected files of those modules are generated for that batching (create_index.out shows a NOTICE sitting after the echo of the next statement). Statement text can be re-synced from src/test/modules, but the expected output has to stay Oracle-generated, which is why the remaining copies are not simply a sync.

The two blockers I could not fix in that PR are filed as issues with the full evidence and reproduction steps:

One practical request: the workflows for the new PR need maintainer approval to start. Thanks!

@123123213weqw

Copy link
Copy Markdown
Contributor Author

Hi @hs-liuxh, gentle ping on this PR.

Both questions from your review have been answered and landed on the branch:

  • injection_points/setconfig exclusions are documented with the CI-verified reasons,
  • and for the missing ORA_REGRESS modules (gin, nbtree, ...), I measured each one on a current master build instead of guessing (see my comment above from Sep 20).

The latest CI run is 7/7 green with no merge conflicts. Could you take another look when you have a moment? Happy to adjust anything that's still off. Thanks!

@123123213weqw

Copy link
Copy Markdown
Contributor Author

@hs-liuxh — both questions from your 2026-07-20 review are answered on the branch, and the head has been green since 2026-08-26.

Head 2744757fba, mergeStateStatus: CLEAN, 7/7 checks green.

  1. injection_points / setconfig exclusions — verified with make oracle-check-world plus the uploaded regression.diffs. The exclusion is real, but the comment in each Makefile that stated it vaguely now gives the concrete reason (a796a4e587).
  2. Missing ORA_REGRESS for gin, nbtree, ... — measured rather than guessed on 63fb0bfe615 (debug/cassert build, --enable-injection-points). A plain ORA_REGRESS = $(REGRESS) breaks those modules for the reason in the reply above, so they are deliberately absent rather than forgotten (fa8670463f).

One more fix landed since then: the oracle_regression failure caused by the create_schema exclusion dropping the foo schema that later comment_on / alter_function / alter_sequence cases need — 3ae402af3f keeps the dependencies and 2744757fba covers the current module test set.

If it needs another round, a pointer to the file is enough. If you don't plan to take it, closing is fine.

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.

Tests within the oracle_test/modules/ directory were omitted.

2 participants