Skip to content

Commit 6d035dc

Browse files
authored
Skip the view msql tests that expect DROP VIEW on EPAS. (#10660)
EPAS can change a view's columns with CREATE OR REPLACE VIEW, so pgAdmin only drops and re-creates the view on PostgreSQL (#5053). The tests added for #9838 expected DROP VIEW on every server and failed on EPAS.
1 parent ea17a4e commit 6d035dc

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/test_views_get_msql.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ def setUp(self):
3333
# Load test data
3434
self.data = self.test_data
3535

36+
# Check server type
37+
if "server_type" in self.data and \
38+
self.server['type'] != self.data["server_type"]:
39+
self.skipTest(self.data["skip_msg"])
40+
3641
# Create db connection
3742
self.db_name = parent_node_dict["database"][-1]["db_name"]
3843
schema_info = parent_node_dict["schema"][-1]

‎web/pgadmin/browser/server_groups/servers/databases/schemas/views/tests/view_test_data.json‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,9 @@
15581558
"query": "\"CREATE OR REPLACE VIEW %s.%s AS SELECT t.id, concat(t.a, ' x ', t.b) AS ab, (t.d)::text AS ds, u.n FROM (VALUES (1, 'a', 'b', now()::date)) t(id, a, b, d) CROSS JOIN (VALUES (2)) u(n); ALTER TABLE %s.%s OWNER TO %s\" % (schema_name, view_name, schema_name, view_name, server['username'])"
15591559
},
15601560
"test_data": {
1561-
"definition": "SELECT t.id, concat(t.a, ' x ', t.b) AS ab, u.n FROM (VALUES (1, 'a', 'b', now()::date)) t(id, a, b, d) CROSS JOIN (VALUES (2)) u(n)"
1561+
"definition": "SELECT t.id, concat(t.a, ' x ', t.b) AS ab, u.n FROM (VALUES (1, 'a', 'b', now()::date)) t(id, a, b, d) CROSS JOIN (VALUES (2)) u(n)",
1562+
"server_type": "pg",
1563+
"skip_msg": "EPAS can change a view's columns without dropping it."
15621564
},
15631565
"mocking_required": false,
15641566
"mock_data": {},
@@ -1578,7 +1580,9 @@
15781580
"query": "\"CREATE OR REPLACE VIEW %s.%s AS SELECT id, valid_from, name FROM (VALUES (1, now()::date, 'a')) t(id, valid_from, name); ALTER TABLE %s.%s OWNER TO %s\" % (schema_name, view_name, schema_name, view_name, server['username'])"
15791581
},
15801582
"test_data": {
1581-
"definition": "SELECT id, valid_from FROM (VALUES (1, now()::date, 'a')) t(id, valid_from, name)"
1583+
"definition": "SELECT id, valid_from FROM (VALUES (1, now()::date, 'a')) t(id, valid_from, name)",
1584+
"server_type": "pg",
1585+
"skip_msg": "EPAS can change a view's columns without dropping it."
15821586
},
15831587
"mocking_required": false,
15841588
"mock_data": {},

0 commit comments

Comments
 (0)