mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix Debugger test cases.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
##########################################################################
|
||||
|
||||
import json
|
||||
|
||||
import sys
|
||||
from pgadmin.utils.route import BaseTestGenerator
|
||||
from regression.python_test_utils import test_utils as utils
|
||||
from . import utils as debugger_utils
|
||||
@@ -18,7 +18,8 @@ from pgadmin.browser.server_groups.servers.databases.schemas.functions \
|
||||
.tests import utils as funcs_utils
|
||||
from pgadmin.browser.server_groups.servers.databases.tests import \
|
||||
utils as db_utils
|
||||
import asyncio
|
||||
from config import PG_DEFAULT_DRIVER
|
||||
from pgadmin.utils.constants import PSYCOPG3
|
||||
|
||||
|
||||
class DebuggerClearAllBreakpoint(BaseTestGenerator):
|
||||
@@ -29,6 +30,13 @@ class DebuggerClearAllBreakpoint(BaseTestGenerator):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
if PG_DEFAULT_DRIVER == PSYCOPG3:
|
||||
self.skipTest('Skip for psycopg3.')
|
||||
|
||||
if sys.platform == 'win32':
|
||||
self.skipTest('PSQL disabled for windows')
|
||||
|
||||
self.schema_data = parent_node_dict['schema'][-1]
|
||||
self.server_id = self.schema_data['server_id']
|
||||
self.db_id = self.schema_data['db_id']
|
||||
@@ -52,23 +60,10 @@ class DebuggerClearAllBreakpoint(BaseTestGenerator):
|
||||
if self.init_target:
|
||||
debugger_utils.initialize_target(self, utils)
|
||||
|
||||
self._start_debugger()
|
||||
|
||||
def _start_debugger(self):
|
||||
asyncio.run(self.start_debugger())
|
||||
|
||||
async def messages_test(self):
|
||||
self.port_no = debugger_utils.messages(self, utils, db_utils)
|
||||
debugger_utils.start_execution(self, utils, db_utils)
|
||||
breakpoint = debugger_utils.set_breakpoint(self)
|
||||
|
||||
async def start_debugger(self):
|
||||
# Schedule three calls *concurrently*:
|
||||
await asyncio.gather(
|
||||
debugger_utils.start_listener(self, utils, db_utils),
|
||||
asyncio.sleep(15),
|
||||
self.messages_test()
|
||||
)
|
||||
debugger_utils.start_listener(self, utils, db_utils)
|
||||
self.port_no = debugger_utils.messages(self, utils, db_utils)
|
||||
debugger_utils.start_execution(self, utils, db_utils)
|
||||
breakpoint = debugger_utils.set_breakpoint(self)
|
||||
|
||||
def clear_all_breakpoint(self):
|
||||
if hasattr(self, 'no_breakpoint') and self.no_breakpoint:
|
||||
|
||||
@@ -18,6 +18,8 @@ from pgadmin.browser.server_groups.servers.databases.schemas.functions \
|
||||
.tests import utils as funcs_utils
|
||||
from pgadmin.browser.server_groups.servers.databases.tests import \
|
||||
utils as db_utils
|
||||
from config import PG_DEFAULT_DRIVER
|
||||
from pgadmin.utils.constants import PSYCOPG3
|
||||
|
||||
|
||||
class DebuggerStartListener(BaseTestGenerator):
|
||||
@@ -28,6 +30,9 @@ class DebuggerStartListener(BaseTestGenerator):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
if PG_DEFAULT_DRIVER == PSYCOPG3:
|
||||
self.skipTest('Skip for psycopg3.')
|
||||
|
||||
self.schema_data = parent_node_dict['schema'][-1]
|
||||
self.server_id = self.schema_data['server_id']
|
||||
self.db_id = self.schema_data['db_id']
|
||||
|
||||
@@ -125,7 +125,7 @@ def initialize_target(self, utils, close_debugger_instance=True):
|
||||
'for indirect debugging.')
|
||||
|
||||
|
||||
async def start_listener(self, utils, db_utils):
|
||||
def start_listener(self, utils, db_utils):
|
||||
response = self.tester.get(
|
||||
'debugger/start_listener/' + str(self.trans_id),
|
||||
content_type='application/json')
|
||||
|
||||
Reference in New Issue
Block a user