Remove GPDB support completely. Fixes #6692

This commit is contained in:
Akshay Joshi
2021-09-02 12:23:10 +05:30
parent f7b8969c72
commit eeff75ba20
297 changed files with 13 additions and 4881 deletions

View File

@@ -19,10 +19,8 @@ def compile_template_name(
def compile_template_path(template_prefix, server_type, version):
if server_type == 'gpdb':
version_path = '#{0}#{1}#'.format(server_type, version)
else:
version_path = '#{0}#'.format(version)
version_path = '#{0}#'.format(version)
# Template path concatenation should be same as
# Ref: ../pgadmin4/web/pgadmin/utils/versioned_template_loader.py +54

View File

@@ -21,15 +21,6 @@ class TestCompileTemplateName(BaseTestGenerator):
expected_return_value='some/prefix/#100000#/some_file.sql'
)
),
(
'When server is GreenPlum and version is 5, it returns the path '
'to the GreenPlum template',
dict(
server_type='gpdb',
version=80323,
expected_return_value='some/prefix/#gpdb#80323#/some_file.sql'
)
),
]
def runTest(self):

View File

@@ -40,18 +40,6 @@ class TestVersionedTemplateLoader(BaseTestGenerator):
"Raise error when version is smaller than available templates",
dict(scenario=5)
),
(
"Render a version GPDB 5.0 template when it is present",
dict(scenario=6)
),
(
"Render a version GPDB 5.0 template when it is in default",
dict(scenario=7)
),
(
"Raise error when version is gpdb but template does not exist",
dict(scenario=8)
)
]
def setUp(self):
@@ -75,18 +63,6 @@ class TestVersionedTemplateLoader(BaseTestGenerator):
# test_raise_not_found_exception_when_postgres_version_less_than_
# all_available_sql_templates
self.test_raise_not_found_exception()
if self.scenario == 6:
# test_get_source_when_the_version_is_gpdb_5_0_returns_gpdb_5_0_
# template
self.test_get_source_when_the_version_is_gpdb_5_0()
if self.scenario == 7:
# test_get_source_when_the_version_is_gpdb_5_0_returns_default_
# template
self.test_get_source_when_the_version_is_gpdb_5_0_returns_default()
if self.scenario == 8:
# test_raise_not_found_exception_when_the_version_is_gpdb_template
# _not_exist
self.test_raise_not_found_exception_when_the_version_is_gpdb()
def test_get_source_returns_a_template(self):
expected_content = "Some SQL" \
@@ -163,52 +139,6 @@ class TestVersionedTemplateLoader(BaseTestGenerator):
except TemplateNotFound:
return
def test_get_source_when_the_version_is_gpdb_5_0(self):
"""Render a version GPDB 5.0 template when it is present"""
expected_content = "Some default SQL for GPDB\n"
# For cross platform we join the SQL path
# (This solves the slashes issue)
sql_path = os.path.join(
"some_feature", "sql", "gpdb_5.0_plus",
"some_action_with_gpdb_5_0.sql"
)
content, filename, up_to_dateness = self.loader.get_source(
None,
"some_feature/sql/#gpdb#80323#/some_action_with_gpdb_5_0.sql"
)
self.assertEqual(
expected_content, str(content).replace("\r", "")
)
self.assertIn(sql_path, filename)
def test_get_source_when_the_version_is_gpdb_5_0_returns_default(self):
"""Render a version GPDB 5.0 template when it is in default"""
expected_content = "Some default SQL"
# For cross platform we join the SQL path
# (This solves the slashes issue)
sql_path = os.path.join(
"some_feature", "sql", "default", "some_action_with_default.sql"
)
content, filename, up_to_dateness = self.loader.get_source(
None, "some_feature/sql/#gpdb#80323#/some_action_with_default.sql"
)
self.assertEqual(
expected_content, str(content).replace("\r", "")
)
self.assertIn(sql_path, filename)
def test_raise_not_found_exception_when_the_version_is_gpdb(self):
""""Raise error when version is gpdb but template does not exist"""
try:
self.loader.get_source(
None, "some_feature/sql/#gpdb#50100#/some_action.sql"
)
self.fail("No exception raised")
except TemplateNotFound:
return
class FakeApp(Flask):
def __init__(self):

View File

@@ -77,13 +77,6 @@ def get_version_mapping_directories(server_type):
:param server_type:
:return:
"""
if server_type == 'gpdb':
return (
{'name': "gpdb_5.0_plus", 'number': 80323},
{'name': "5_plus", 'number': 80323},
{'name': "default", 'number': 0}
)
return ({'name': "13_plus", 'number': 130000},
{'name': "12_plus", 'number': 120000},
{'name': "11_plus", 'number': 110000},