From 7710d5e21cdfc08ff003e03dbe49f148c1f0d752 Mon Sep 17 00:00:00 2001 From: Yogesh Mahajan Date: Mon, 28 Nov 2022 17:23:43 +0530 Subject: [PATCH] Ensure the query tool is launched successfully for the servers registered with the PostgreSQL service. #5575 --- web/pgadmin/tools/sqleditor/static/js/show_query_tool.js | 3 +++ web/pgadmin/tools/sqleditor/static/js/show_view_data.js | 1 + web/regression/runtests.py | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js b/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js index 142c3bec45e..1406a36b0e6 100644 --- a/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js +++ b/web/pgadmin/tools/sqleditor/static/js/show_query_tool.js @@ -32,6 +32,9 @@ export function generateUrl(trans_id, parentData, sqlId) { if(parentData.database.label) { url_endpoint += `&database_name=${parentData.database.label}`; } + if(parentData.server.user.name){ + url_endpoint += `&user=${parentData.server.user.name}`; + } } if(sqlId) { diff --git a/web/pgadmin/tools/sqleditor/static/js/show_view_data.js b/web/pgadmin/tools/sqleditor/static/js/show_view_data.js index ef4c2a1b9dc..e3b3bf61219 100644 --- a/web/pgadmin/tools/sqleditor/static/js/show_view_data.js +++ b/web/pgadmin/tools/sqleditor/static/js/show_view_data.js @@ -134,6 +134,7 @@ function generateUrl(trans_id, connectionData, nodeData, parentData) { +`&sgid=${parentData.server_group._id}` +`&sid=${parentData.server._id}` +`&did=${parentData.database._id}` + +`&user=${parentData.server.user.name}` +`&server_type=${parentData.server.server_type}`; return url_endpoint; diff --git a/web/regression/runtests.py b/web/regression/runtests.py index 52c8efc1a8a..021ebdfecb1 100644 --- a/web/regression/runtests.py +++ b/web/regression/runtests.py @@ -531,7 +531,7 @@ def execute_test(test_module_list_passed, server_passed, driver_passed, # This is required when some tests are running parallel # & some sequential in case of parallel ui tests - if threading.current_thread().get_name() == "sequential_tests": + if threading.current_thread().getName() == "sequential_tests": try: if test_result[server_passed['name']][0] is not None: ran_tests = test_result[server_passed['name']][0] + \ @@ -565,14 +565,14 @@ def execute_test(test_module_list_passed, server_passed, driver_passed, print(str(exc)) print("Exception in {0} {1}".format( threading.current_thread().ident, - threading.current_thread().get_name())) + threading.current_thread().getName())) # Mark failure as true global failure failure = True finally: # Delete web-driver instance thread_name = "parallel_tests" + server_passed['name'] - if threading.current_thread().get_name() == thread_name: + if threading.current_thread().getName() == thread_name: test_utils.quit_webdriver(driver_passed) time.sleep(20)