mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add Reverse Engineered SQL tests for FTS Parsers. Fixes #4471
This commit is contained in:
parent
1831c9e70a
commit
809e0682bd
@ -26,6 +26,8 @@ Housekeeping
|
||||
| `Issue #4463 <https://redmine.postgresql.org/issues/4463>`_ - Add Reverse Engineered SQL tests for Domains.
|
||||
| `Issue #4464 <https://redmine.postgresql.org/issues/4464>`_ - Add Reverse Engineered SQL tests for Collations.
|
||||
| `Issue #4468 <https://redmine.postgresql.org/issues/4468>`_ - Add Reverse Engineered SQL tests for Types.
|
||||
| `Issue #4471 <https://redmine.postgresql.org/issues/4471>`_ - Add Reverse Engineered SQL tests for FTS Parsers.
|
||||
|
||||
|
||||
Bug fixes
|
||||
*********
|
||||
|
@ -0,0 +1,13 @@
|
||||
-- Text Search Parser: public."test_fts_parser_updated_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP TEXT SEARCH PARSER public."test_fts_parser_updated_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TEXT SEARCH PARSER public."test_fts_parser_updated_$%{}[]()&*^!@""'`\/#" (
|
||||
START = prsd_start,
|
||||
GETTOKEN = prsd_nexttoken,
|
||||
END = void_recv,
|
||||
LEXTYPES = dispell_init,
|
||||
HEADLINE = prsd_headline
|
||||
);
|
||||
|
||||
COMMENT ON TEXT SEARCH PARSER public."test_fts_parser_updated_$%{}[]()&*^!@""'`\/#" IS 'Updating test fts parser';
|
@ -0,0 +1,13 @@
|
||||
-- Text Search Parser: public."test_fts_parser_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
-- DROP TEXT SEARCH PARSER public."test_fts_parser_$%{}[]()&*^!@""'`\/#"
|
||||
|
||||
CREATE TEXT SEARCH PARSER public."test_fts_parser_$%{}[]()&*^!@""'`\/#" (
|
||||
START = prsd_start,
|
||||
GETTOKEN = prsd_nexttoken,
|
||||
END = void_recv,
|
||||
LEXTYPES = dispell_init,
|
||||
HEADLINE = prsd_headline
|
||||
);
|
||||
|
||||
COMMENT ON TEXT SEARCH PARSER public."test_fts_parser_$%{}[]()&*^!@""'`\/#" IS 'Creating test fts parser';
|
@ -0,0 +1,40 @@
|
||||
{
|
||||
"scenarios": [
|
||||
{
|
||||
"type": "create",
|
||||
"name": "Create FTS parser",
|
||||
"endpoint": "NODE-fts_parser.obj",
|
||||
"sql_endpoint": "NODE-fts_parser.sql_id",
|
||||
"data": {
|
||||
"name": "test_fts_parser_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description": "Creating test fts parser",
|
||||
"schema": "public",
|
||||
"schema_id": "<SCHEMA_ID>",
|
||||
"prsstart": "prsd_start",
|
||||
"prstoken": "prsd_nexttoken",
|
||||
"prsend": "void_recv",
|
||||
"prslextype": "dispell_init",
|
||||
"prsheadline": "prsd_headline"
|
||||
},
|
||||
"expected_sql_file": "create_fts_parser.sql"
|
||||
},
|
||||
{
|
||||
"type": "alter",
|
||||
"name": "Alter FTS parser",
|
||||
"endpoint": "NODE-fts_parser.obj_id",
|
||||
"sql_endpoint": "NODE-fts_parser.sql_id",
|
||||
"data":{
|
||||
"name": "test_fts_parser_updated_$%{}[]()&*^!@\"'`\\/#",
|
||||
"description":"Updating test fts parser"},
|
||||
"expected_sql_file": "alter_fts_parser.sql"
|
||||
},
|
||||
{
|
||||
"type": "delete",
|
||||
"name": "Drop FTS Parser",
|
||||
"endpoint": "NODE-fts_parser.delete_id",
|
||||
"data": {
|
||||
"name": "test_fts_configuration_def2"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -337,9 +337,15 @@ class ReverseEngineeredSQLTestCases(BaseTestGenerator):
|
||||
self.final_test_status = False
|
||||
print(scenario['name'] + "... FAIL")
|
||||
traceback.print_exc()
|
||||
|
||||
try:
|
||||
if type(response.data) == bytes:
|
||||
response_data = response.data.decode('utf8')
|
||||
resp = json.loads(response_data)
|
||||
else:
|
||||
resp = json.loads(response.data)
|
||||
resp_sql = resp['data']
|
||||
except Exception:
|
||||
print("Unable to decode the response data from url: ", url)
|
||||
|
||||
# Remove first and last double quotes
|
||||
if resp_sql.startswith('"') and resp_sql.endswith('"'):
|
||||
|
Loading…
Reference in New Issue
Block a user