mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed RE-SQL test cases failed due to the previous commit.
Introduces a new key - replace_regex_pattern to synchronize the expected SQL with the backend SQL based on the regex string
This commit is contained in:
parent
53a5410337
commit
28b637c99c
@ -81,7 +81,8 @@
|
||||
"expected_sql_file": "alter_role_options2.sql",
|
||||
"expected_msql_file": "alter_role_options2.msql",
|
||||
"convert_timestamp_columns": ["rolvaliduntil"],
|
||||
"replace_password": true
|
||||
"replace_password": true,
|
||||
"replace_regex_pattern": ["VALID UNTIL '[0-9\\-T:+ ]*'"]
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
@ -95,7 +96,8 @@
|
||||
"expected_sql_file": "alter_role_options3.sql",
|
||||
"expected_msql_file": "alter_role_options3.msql",
|
||||
"convert_timestamp_columns": ["rolvaliduntil"],
|
||||
"replace_password": true
|
||||
"replace_password": true,
|
||||
"replace_regex_pattern": ["VALID UNTIL '[0-9\\-T:+ ]*'"]
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
@ -112,7 +114,8 @@
|
||||
"expected_sql_file": "alter_role_options4.sql",
|
||||
"expected_msql_file": "alter_role_options4.msql",
|
||||
"convert_timestamp_columns": ["rolvaliduntil"],
|
||||
"replace_password": true
|
||||
"replace_password": true,
|
||||
"replace_regex_pattern": ["VALID UNTIL '[0-9\\-T:+ ]*'"]
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
|
@ -45,7 +45,7 @@
|
||||
z-index: 5;
|
||||
}
|
||||
}
|
||||
&.ajs-frameless,
|
||||
|
||||
&.ajs-frameless {
|
||||
& .ajs-body {
|
||||
& .ajs-content {
|
||||
|
@ -702,6 +702,12 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
|
||||
|
||||
sql = sql.replace(self.JSON_PLACEHOLDERS['password'], password)
|
||||
|
||||
if 'replace_regex_pattern' in scenario:
|
||||
for a_patten in scenario['replace_regex_pattern']:
|
||||
found = re.findall(a_patten, resp_sql)
|
||||
if len(found) > 0:
|
||||
sql = re.sub(a_patten, found[0], sql)
|
||||
|
||||
# Replace place holder <owner> with the current username
|
||||
# used to connect to the database
|
||||
if 'pga_job_id' in scenario:
|
||||
|
Loading…
Reference in New Issue
Block a user