public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikhil Mohite <[email protected]>
To: Akshay Joshi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin][RM-5343]: [Code Coverage] Improve API test cases for Debugger
Date: Thu, 17 Dec 2020 17:40:36 +0530
Message-ID: <CAOBg0ANq5r6v4rg+-v26Phv9ArciV30=p7aGXWbWAUtUqjsFsg@mail.gmail.com> (raw)
In-Reply-To: <CANxoLDfbg4XWbjo1jEokubKnaYzUEQu888XAqZWMua_LpkoZAA@mail.gmail.com>
References: <CAOBg0AOQhDiS5VQjG6ErGp=tmNj=_4T9rkL6cJeAmnGuWWtCCA@mail.gmail.com>
	<CANxoLDec48OnPneYTFdGHBzy_bDiPSWYtB8m0uh3SJEqpaSyOg@mail.gmail.com>
	<CAOBg0AMfXZgZLDRr6Vqv7BXf1+VxJDDB1J_qWqjbxYaMQD2HFw@mail.gmail.com>
	<CANxoLDeq+ZRmkOkW9rxss+vLe+3j3fTZ0VwmuQbdVh7o4Rds4Q@mail.gmail.com>
	<CAOBg0APOhPo3+VFM4-LH5CZE=Yu5Y-Zmw8RhnfkVGQPkxLYPXA@mail.gmail.com>
	<CAOBg0APyUYU=J1=pOXYkz_sHt4Wgjbk8iR5m_XCWSi8WoJkx6w@mail.gmail.com>
	<CANxoLDfpYj5vq-xdLsb6LSAWxrVu0CR2AqSH3dX5YkANNgbSfg@mail.gmail.com>
	<CAOBg0AOsPm7UsXY86BHtXy-5V36NU9=CO8tj2xZRFuZfc4Ojzg@mail.gmail.com>
	<CANxoLDfbg4XWbjo1jEokubKnaYzUEQu888XAqZWMua_LpkoZAA@mail.gmail.com>

Hi Akshay/ Team,

Please find attached an updated patch for debugger test cases.

Regards,
Nikhil Mohite.

On Wed, Dec 16, 2020 at 12:12 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, patch applied.
>
> On Tue, Dec 15, 2020 at 4:20 PM Nikhil Mohite <
> [email protected]> wrote:
>
>> Hi Team,
>>
>> Please find the updated patch for debugger test cases.
>> 1. Added check to skip debugger test case if the plugin is not installed.
>> 2. Added code to delete the existing "pldbgapi" extension and create a
>> new extension.
>> 3. Updated a few test cases that are falling on specific servers.
>>
>>
>> Regards,
>> Nikhil Mohite.
>>
>> On Wed, Dec 9, 2020 at 1:37 PM Akshay Joshi <
>> [email protected]> wrote:
>>
>>> Thanks, patch applied.
>>>
>>> On Wed, Dec 9, 2020 at 1:24 PM Nikhil Mohite <
>>> [email protected]> wrote:
>>>
>>>> Hi Akshay/Team,
>>>>
>>>> Please find the small patch for debugger test cases.
>>>> Added random function name generation for the debugger.
>>>>
>>>>
>>>> Regards,
>>>> Nikhil Mohite.
>>>>
>>>>
>>>> On Mon, Dec 7, 2020 at 3:32 PM Nikhil Mohite <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Akshay/Team,
>>>>>
>>>>> Please find the updated patch for debugger test cases.
>>>>> 1. Resolved the issues related to the database connection.
>>>>> 2. Updated the create "pldbgapi" extension for the debugger.
>>>>>
>>>>>
>>>>> Regards,
>>>>> Nikhil Mohite.
>>>>>
>>>>> On Thu, Dec 3, 2020 at 10:47 AM Akshay Joshi <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Thanks, patch applied.
>>>>>>
>>>>>> On Wed, Dec 2, 2020 at 11:25 AM Nikhil Mohite <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi Akshay,
>>>>>>>
>>>>>>> please find the updated patch, sorry for the inconvenience.
>>>>>>>
>>>>>>>
>>>>>>> Regards,
>>>>>>> Nikhil Mohite.
>>>>>>>
>>>>>>> On Wed, Dec 2, 2020 at 11:03 AM Akshay Joshi <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi Nikhil
>>>>>>>>
>>>>>>>> The patch is not applied, please rebase and send the patch again.
>>>>>>>>
>>>>>>>> On Tue, Dec 1, 2020 at 2:48 PM Nikhil Mohite <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi Team,
>>>>>>>>>
>>>>>>>>> Please find the attached patch for RM-5343
>>>>>>>>> <https://redmine.postgresql.org/issues/5343;: [Code Coverage]
>>>>>>>>> Improve API test cases for Debugger.
>>>>>>>>> also updated implementation to remove dead code and unhandled
>>>>>>>>> exceptions.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> *Thanks & Regards,*
>>>>>>>>> *Nikhil Mohite*
>>>>>>>>> *Software Engineer.*
>>>>>>>>> *EDB Postgres* <https://www.enterprisedb.com/;
>>>>>>>>> *Mob.No: +91-7798364578.*
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Thanks & Regards*
>>>>>>>> *Akshay Joshi*
>>>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>>>
>>>>>>>> *Mobile: +91 976-788-8246*
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Thanks & Regards*
>>>>>> *Akshay Joshi*
>>>>>> *pgAdmin Hacker | Principal Software Architect*
>>>>>> *EDB Postgres <http://edbpostgres.com>*
>>>>>>
>>>>>> *Mobile: +91 976-788-8246*
>>>>>>
>>>>>
>>>
>>> --
>>> *Thanks & Regards*
>>> *Akshay Joshi*
>>> *pgAdmin Hacker | Principal Software Architect*
>>> *EDB Postgres <http://edbpostgres.com>*
>>>
>>> *Mobile: +91 976-788-8246*
>>>
>>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


Attachments:

  [application/octet-stream] RM_5343_v6.patch (6.2K, 3-RM_5343_v6.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/debugger/tests/test_debugger_clear_all_breakpoint.py b/web/pgadmin/tools/debugger/tests/test_debugger_clear_all_breakpoint.py
index 56db948..4c8fcaf 100644
--- a/web/pgadmin/tools/debugger/tests/test_debugger_clear_all_breakpoint.py
+++ b/web/pgadmin/tools/debugger/tests/test_debugger_clear_all_breakpoint.py
@@ -51,9 +51,9 @@ class DebuggerClearAllBreakpoint(BaseTestGenerator):
         if self.init_target:
             debugger_utils.initialize_target(self, utils)
 
-            debugger_utils.start_listener(self)
+            debugger_utils.start_listener(self, utils, db_utils)
             self.port_no = debugger_utils.messages(self, utils, db_utils)
-            debugger_utils.start_execution(self)
+            debugger_utils.start_execution(self, utils, db_utils)
             breakpoint = debugger_utils.set_breakpoint(self)
 
     def clear_all_breakpoint(self):
diff --git a/web/pgadmin/tools/debugger/tests/test_debugger_execute_query.py b/web/pgadmin/tools/debugger/tests/test_debugger_execute_query.py
index a6ff8ef..0259936 100644
--- a/web/pgadmin/tools/debugger/tests/test_debugger_execute_query.py
+++ b/web/pgadmin/tools/debugger/tests/test_debugger_execute_query.py
@@ -49,10 +49,10 @@ class DebuggerExecuteQuery(BaseTestGenerator):
 
         if self.init_target:
             debugger_utils.initialize_target(self, utils)
-            debugger_utils.start_listener(self)
+            debugger_utils.start_listener(self, utils, db_utils)
 
             self.port_no = debugger_utils.messages(self, utils, db_utils)
-            debugger_utils.start_execution(self)
+            debugger_utils.start_execution(self, utils, db_utils)
 
     def execute_query(self):
         return self.tester.get(
diff --git a/web/pgadmin/tools/debugger/tests/test_debugger_poll_execution_result.py b/web/pgadmin/tools/debugger/tests/test_debugger_poll_execution_result.py
index 376d1e4..cf66fa4 100644
--- a/web/pgadmin/tools/debugger/tests/test_debugger_poll_execution_result.py
+++ b/web/pgadmin/tools/debugger/tests/test_debugger_poll_execution_result.py
@@ -51,9 +51,9 @@ class DebuggerPollExecutionResult(BaseTestGenerator):
         if self.init_target:
             debugger_utils.initialize_target(self, utils)
 
-            debugger_utils.start_listener(self)
+            debugger_utils.start_listener(self, utils, db_utils)
             self.port_no = debugger_utils.messages(self, utils, db_utils)
-            debugger_utils.start_execution(self)
+            debugger_utils.start_execution(self, utils, db_utils)
 
     def poll_execution_result(self):
         return self.tester.get(
diff --git a/web/pgadmin/tools/debugger/tests/test_debugger_poll_result.py b/web/pgadmin/tools/debugger/tests/test_debugger_poll_result.py
index d465d52..e92e9b2 100644
--- a/web/pgadmin/tools/debugger/tests/test_debugger_poll_result.py
+++ b/web/pgadmin/tools/debugger/tests/test_debugger_poll_result.py
@@ -51,7 +51,7 @@ class DebuggerPollResult(BaseTestGenerator):
         if self.init_target:
             debugger_utils.initialize_target(self, utils)
 
-            debugger_utils.start_listener(self)
+            debugger_utils.start_listener(self, utils, db_utils)
 
     def execute_query(self):
         return self.tester.get(
diff --git a/web/pgadmin/tools/debugger/tests/test_debugger_set_breakpoint.py b/web/pgadmin/tools/debugger/tests/test_debugger_set_breakpoint.py
index 82b6b0a..af4a6da 100644
--- a/web/pgadmin/tools/debugger/tests/test_debugger_set_breakpoint.py
+++ b/web/pgadmin/tools/debugger/tests/test_debugger_set_breakpoint.py
@@ -51,9 +51,9 @@ class DebuggerSetBreakpoint(BaseTestGenerator):
         if self.init_target:
             debugger_utils.initialize_target(self, utils)
 
-            debugger_utils.start_listener(self)
+            debugger_utils.start_listener(self, utils, db_utils)
             self.port_no = debugger_utils.messages(self, utils, db_utils)
-            debugger_utils.start_execution(self)
+            debugger_utils.start_execution(self, utils, db_utils)
 
         if self.query_type == 2:
             debugger_utils.set_breakpoint(self)
diff --git a/web/pgadmin/tools/debugger/tests/test_start_execution_debugger.py b/web/pgadmin/tools/debugger/tests/test_start_execution_debugger.py
index e35a031..f416c32 100644
--- a/web/pgadmin/tools/debugger/tests/test_start_execution_debugger.py
+++ b/web/pgadmin/tools/debugger/tests/test_start_execution_debugger.py
@@ -51,7 +51,7 @@ class DebuggerStartExecution(BaseTestGenerator):
         if self.init_target:
             debugger_utils.initialize_target(self, utils)
 
-        debugger_utils.start_listener(self)
+        debugger_utils.start_listener(self, utils, db_utils)
         self.port_no = debugger_utils.messages(self, utils, db_utils)
 
     def start_execution(self):
diff --git a/web/pgadmin/tools/debugger/tests/utils.py b/web/pgadmin/tools/debugger/tests/utils.py
index e4acc65..a56f366 100644
--- a/web/pgadmin/tools/debugger/tests/utils.py
+++ b/web/pgadmin/tools/debugger/tests/utils.py
@@ -126,11 +126,16 @@ def initialize_target(self, utils, close_debugger_instance=True):
                       'for indirect debugging.')
 
 
-def start_listener(self):
+def start_listener(self, utils, db_utils):
     response = self.tester.get(
         'debugger/start_listener/' + str(self.trans_id),
         content_type='application/json')
-
+    if response.status_code != 200:
+        close_debugger(self)
+        delete_function(self, utils)
+        db_utils.disconnect_database(
+            self, self.server_id, self.db_id)
+        self.skipTest('Debugger is in Busy state.')
     self.assertEqual(response.status_code, 200)
 
 
@@ -163,11 +168,18 @@ def messages(self, utils, db_utils):
         return port
 
 
-def start_execution(self):
+def start_execution(self, utils, db_utils):
     response = self.tester.get(
         'debugger/start_execution/' + str(self.trans_id) + '/' + str(
             self.port_no), content_type='application/json')
 
+    if response.status_code != 200:
+        close_debugger(self)
+        delete_function(self, utils)
+        db_utils.disconnect_database(
+            self, self.server_id, self.db_id)
+        self.skipTest('Debugger is in Busy state.')
+
     self.assertEqual(response.status_code, 200)
 
 


view thread (15+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [pgAdmin][RM-5343]: [Code Coverage] Improve API test cases for Debugger
  In-Reply-To: <CAOBg0ANq5r6v4rg+-v26Phv9ArciV30=p7aGXWbWAUtUqjsFsg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox