Skip to content

Skip the view msql tests that expect DROP VIEW on EPAS. - #10660

Open
kundansable wants to merge 1 commit into
pgadmin-org:masterfrom
kundansable:fix-regression-10310-statistics-nodes-sql
Open

kundansable wants to merge 1 commit into
pgadmin-org:masterfrom
kundansable:fix-regression-10310-statistics-nodes-sql

Conversation

@kundansable

@kundansable kundansable commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The "Run Python tests on EPAS" workflow fails on EPAS 15 (Windows) and EPAS 18 (Linux) with two failures in test_views_get_msql.py (run):

  • Get view msql: Changing the columns drops the view.
  • Get view msql: Removing a column after valid_from drops the view.

Both were added for #9838 and assert DROP VIEW in the generated SQL. EPAS gets CREATE OR REPLACE VIEW instead, because ViewNode._get_definition_data only flags a drop when server_type == 'pg'. That guard is deliberate (#5053): EPAS can change a view's columns with CREATE OR REPLACE VIEW, and the client-side warning in view.ui.js uses the same check.

I confirmed the server behaviour with temp views inside a rolled-back transaction:

CREATE OR REPLACE VIEW that… EPAS 15 / 17 PG 16 / 18
drops a trailing or middle column (both test scenarios) accepted cannot drop columns from view
changes a column's type, or renames one accepted error

So the product code is correct and only the tests are wrong. This change skips the two scenarios when the server is not PostgreSQL, using a server_type key in the test data that setUp checks before it creates anything.

Testing

  • PG 18: all 98 views tests pass. Both scenarios still run and pass.
  • Skip path: with server_type temporarily set to ppas, both scenarios report the skip message on PG.
  • I did not run the suite against EPAS itself.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • View-related checks now run only on the server type specified by each scenario, avoiding mismatched results across server types. Existing view definitions and expected outcomes remain unchanged.

EPAS can change a view's columns with CREATE OR REPLACE VIEW, so pgAdmin
only drops and re-creates the view on PostgreSQL (pgadmin-org#5053). The tests
added for pgadmin-org#9838 expected DROP VIEW on every server and failed on EPAS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between ea293b3 and a6c2048.

📒 Files selected for processing: 2
  • web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get_msql.py
  • web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The view-MSQL test setup now skips scenarios whose configured server type differs from the current server. Two scenarios specify PostgreSQL and an EPAS-specific skip message; their definitions and expected DROP VIEW assertions are unchanged.

Changes

View MSQL test constraints

Layer / File(s) Summary
Configure and apply scenario server-type constraints
web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get_msql.py, web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json
Two scenarios specify PostgreSQL and an EPAS skip message. The test setup skips a scenario when its configured server type does not match the current server type.

Priority: ⬇️ Low

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

Change: Other

Suggested reviewers: dpage

Merge Risk: ⚪ Minimal · up to a6c20

The test-only change correctly limits the DROP VIEW scenarios to PostgreSQL without affecting EPAS setup.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: skipping view MSQL tests that expect DROP VIEW on EPAS.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This branch has not been deployed

No deployments
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.

1 participant