Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-28 Thread Harshal Dhumal
Hi,

Please find attached updated patch

On Fri, Aug 25, 2017 at 2:32 PM, Dave Page  wrote:

> Hi
>
> On Thu, Aug 24, 2017 at 11:51 AM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Last week Sarah, Matt and I had call regarding some issues with feature
>> test cases.
>> For example in auto commit disable test scenario from query tool test
>> cases by removing code line
>> *self.page.find_by_id("btn-auto-commit").click() *the test case scenario
>> was not falling.
>> This issue was due to previously on going database transaction. This
>> issue was also with test scenarios like
>> auto commit enable and auto rollback enabled. The attached patch fixes
>> this issue.
>>
>> @Sarah and Matt can you please give this patch a try to check if issues
>> we discussed last week are fixed.
>>
>
> I don't think Matt and Sarah are working on pgAdmin any more :-(
>
> I just tried this patch, and whilst the tests all passed, it spent quite
> some time typing "select * from hats" into random places in the query tool,
> such that it ended up running queries like
>
> select * select * select * from hats from hats from hats
>
> I don't remember it doing that before; I think it was a) clearing
> codemirror each time and b) entering the text much more quickly (in fact I
> just tried it, and it enters the text and executes the query so fast the
> screen basically strobes).
>
Fixed.


> Performance-wise, I got 266 seconds with the patch, and 378 without, so
> there's definitely some good improvement here, just a little funkyness with
> the query tool journey test.
>

Recently Wenlin Zhang has fixed this in this commit
.
Here is link

to email thread.


> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/feature_tests/connect_to_server_feature_test.py b/web/pgadmin/feature_tests/connect_to_server_feature_test.py
deleted file mode 100644
index 97e96f2..000
--- a/web/pgadmin/feature_tests/connect_to_server_feature_test.py
+++ /dev/null
@@ -1,84 +0,0 @@
-##
-#
-# pgAdmin 4 - PostgreSQL Tools
-#
-# Copyright (C) 2013 - 2017, The pgAdmin Development Team
-# This software is released under the PostgreSQL Licence
-#
-##
-
-import time
-from selenium.webdriver import ActionChains
-
-import config as app_config
-from regression.feature_utils.base_feature_test import BaseFeatureTest
-from regression.python_test_utils import test_utils
-
-
-class ConnectsToServerFeatureTest(BaseFeatureTest):
-"""
-Tests that a database connection can be created from the UI
-"""
-scenarios = [
-("Test database connection", dict())
-]
-
-def before(self):
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
-  self.server['port'],
-  self.server['sslmode'])
-test_utils.drop_database(connection, "acceptance_test_db")
-test_utils.create_database(self.server, "acceptance_test_db")
-test_utils.create_table(self.server, "acceptance_test_db", "test_table")
-
-def runTest(self):
-"""This function tests that a database connection can be created from
-the UI"""
-self.assertEqual(app_config.APP_NAME, self.page.driver.title)
-self.page.wait_for_spinner_to_disappear()
-
-self._connects_to_server()
-self._tables_node_expandable()
-
-def after(self):
-self.page.remove_server(self.server)
-
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
-  self.server['port'],
-  self.server['sslmode'])
-test_utils.drop_database(connection, "acceptance_test_db")
-
-def _connects_to_server(self):
-self.page.find_by_xpath("//*[@class='aciTreeText' and .='Servers']").click()
-time.sleep(2)
-self.page.driver.find_element_by_link_text("Object").click()
-   

Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-24 Thread Harshal Dhumal
Hi,

Last week Sarah, Matt and I had call regarding some issues with feature
test cases.
For example in auto commit disable test scenario from query tool test cases
by removing code line
*self.page.find_by_id("btn-auto-commit").click() *the test case scenario
was not falling.
This issue was due to previously on going database transaction. This issue
was also with test scenarios like
auto commit enable and auto rollback enabled. The attached patch fixes this
issue.

@Sarah and Matt can you please give this patch a try to check if issues we
discussed last week are fixed.

Thanks,
Harshal




-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Fri, Aug 11, 2017 at 11:55 AM, Sarah McAlear  wrote:

> Great job on cleaning up the whole feature test suite! This is really
> going to benefit all of the developers a lot.
>
> Thanks,
> Matt & Sarah
>
> On Fri, Aug 11, 2017 at 12:24 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find attached updated patch. In this patch I have removed unused
>> imports.
>> Regarding ajax calls on slow network/computer I have already taken care
>> of those.
>> Before sending first version of patch I tested this on Murtuza's machine
>> and also
>> tested on slow machine as well.
>>
>>
>> Thanks,
>> Harshal
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Mon, Aug 7, 2017 at 8:55 AM, Sarah McAlear 
>> wrote:
>>
>>> Hi Harshal!
>>>
>>> There are a few files in which there are leftover imports that are not
>>> needed anymore:
>>>
>>>- PGDataypeFeatureTest
>>>- PgadminPage
>>>- CheckForXssFeatureTest
>>>- CheckDebuggerForXssFeatureTest
>>>
>>>
>>> We also noticed that there were quite a few time.sleep functions that
>>> were removed. This seems great overall, but we think that some of them were
>>> in place because of varying network and computer speeds. So for example, in
>>> QueryToolFeatureTest, there is an ajax call that was followed by a
>>> time.sleep to ensure that it had finished executing before continuing
>>> to execute. Removing this may reintroduce some flakiness. If there are no
>>> issues with flakiness after this patch, it seems like a great idea. We ran
>>> the tests a few times and didn't notice any flakiness, but we're unsure if
>>> it will be a problem on a different system.
>>>
>>> Thanks!
>>> Wenlin & Sarah
>>>
>>>
>>> On Wed, Aug 2, 2017 at 9:32 PM, Harshal Dhumal <
>>> harshal.dhu...@enterprisedb.com> wrote:
>>>
 Hi,

 Please find attached patch to improve feature test execution time.
 Now on my machine overall execution time is cut down to 280 seconds
 from 400+ seconds

 Changes:

 1. Removed fixed python time.sleeps where ever possible.
 2. Removed connect to server test cases.
 3. Query tool test cases:
  i. Merged 3 test cases On demand result on scroll, grid select all
 and column select all.
  ii. Merged 3 test cases Explain query, Explain query with verbose
 and Explain query with cost.
  iii. Merged 3 test cases Explain analyze query, Explain
 analyze with buffers and Explain analyze with timing.
 4. Improved debugger XSS test case execution time.

 --
 *Harshal Dhumal*
 *Sr. Software Engineer*

 EnterpriseDB India: http://www.enterprisedb.com
 The Enterprise PostgreSQL Company

>>>
>>>
>>
>
diff --git a/web/pgadmin/feature_tests/connect_to_server_feature_test.py b/web/pgadmin/feature_tests/connect_to_server_feature_test.py
deleted file mode 100644
index 97e96f2..000
--- a/web/pgadmin/feature_tests/connect_to_server_feature_test.py
+++ /dev/null
@@ -1,84 +0,0 @@
-##
-#
-# pgAdmin 4 - PostgreSQL Tools
-#
-# Copyright (C) 2013 - 2017, The pgAdmin Development Team
-# This software is released under the PostgreSQL Licence
-#
-##
-
-import time
-from selenium.webdriver import ActionChains
-
-import config as app_config
-from regression.feature_utils.base_feature_test import BaseFeatureTest
-from regression.python_test_utils import test_utils
-
-
-class ConnectsToServerFeatureTest(BaseFeatureTest):
-"""
-Tests that a database connection can be created from the UI
-"""
-scenarios = [
-("Test database connection", dict())
-]
-
-def before(self):
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
- 

Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-11 Thread Sarah McAlear
Great job on cleaning up the whole feature test suite! This is really going
to benefit all of the developers a lot.

Thanks,
Matt & Sarah

On Fri, Aug 11, 2017 at 12:24 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached updated patch. In this patch I have removed unused
> imports.
> Regarding ajax calls on slow network/computer I have already taken care of
> those.
> Before sending first version of patch I tested this on Murtuza's machine
> and also
> tested on slow machine as well.
>
>
> Thanks,
> Harshal
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Mon, Aug 7, 2017 at 8:55 AM, Sarah McAlear  wrote:
>
>> Hi Harshal!
>>
>> There are a few files in which there are leftover imports that are not
>> needed anymore:
>>
>>- PGDataypeFeatureTest
>>- PgadminPage
>>- CheckForXssFeatureTest
>>- CheckDebuggerForXssFeatureTest
>>
>>
>> We also noticed that there were quite a few time.sleep functions that
>> were removed. This seems great overall, but we think that some of them were
>> in place because of varying network and computer speeds. So for example, in
>> QueryToolFeatureTest, there is an ajax call that was followed by a
>> time.sleep to ensure that it had finished executing before continuing to
>> execute. Removing this may reintroduce some flakiness. If there are no
>> issues with flakiness after this patch, it seems like a great idea. We ran
>> the tests a few times and didn't notice any flakiness, but we're unsure if
>> it will be a problem on a different system.
>>
>> Thanks!
>> Wenlin & Sarah
>>
>>
>> On Wed, Aug 2, 2017 at 9:32 PM, Harshal Dhumal <
>> harshal.dhu...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find attached patch to improve feature test execution time.
>>> Now on my machine overall execution time is cut down to 280 seconds from
>>> 400+ seconds
>>>
>>> Changes:
>>>
>>> 1. Removed fixed python time.sleeps where ever possible.
>>> 2. Removed connect to server test cases.
>>> 3. Query tool test cases:
>>>  i. Merged 3 test cases On demand result on scroll, grid select all
>>> and column select all.
>>>  ii. Merged 3 test cases Explain query, Explain query with verbose
>>> and Explain query with cost.
>>>  iii. Merged 3 test cases Explain analyze query, Explain
>>> analyze with buffers and Explain analyze with timing.
>>> 4. Improved debugger XSS test case execution time.
>>>
>>> --
>>> *Harshal Dhumal*
>>> *Sr. Software Engineer*
>>>
>>> EnterpriseDB India: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>


Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-10 Thread Harshal Dhumal
Hi,

Please find attached updated patch. In this patch I have removed unused
imports.
Regarding ajax calls on slow network/computer I have already taken care of
those.
Before sending first version of patch I tested this on Murtuza's machine
and also
tested on slow machine as well.


Thanks,
Harshal

-- 
*Harshal Dhumal*
*Sr. Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Mon, Aug 7, 2017 at 8:55 AM, Sarah McAlear  wrote:

> Hi Harshal!
>
> There are a few files in which there are leftover imports that are not
> needed anymore:
>
>- PGDataypeFeatureTest
>- PgadminPage
>- CheckForXssFeatureTest
>- CheckDebuggerForXssFeatureTest
>
>
> We also noticed that there were quite a few time.sleep functions that
> were removed. This seems great overall, but we think that some of them were
> in place because of varying network and computer speeds. So for example, in
> QueryToolFeatureTest, there is an ajax call that was followed by a
> time.sleep to ensure that it had finished executing before continuing to
> execute. Removing this may reintroduce some flakiness. If there are no
> issues with flakiness after this patch, it seems like a great idea. We ran
> the tests a few times and didn't notice any flakiness, but we're unsure if
> it will be a problem on a different system.
>
> Thanks!
> Wenlin & Sarah
>
>
> On Wed, Aug 2, 2017 at 9:32 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find attached patch to improve feature test execution time.
>> Now on my machine overall execution time is cut down to 280 seconds from
>> 400+ seconds
>>
>> Changes:
>>
>> 1. Removed fixed python time.sleeps where ever possible.
>> 2. Removed connect to server test cases.
>> 3. Query tool test cases:
>>  i. Merged 3 test cases On demand result on scroll, grid select all
>> and column select all.
>>  ii. Merged 3 test cases Explain query, Explain query with verbose
>> and Explain query with cost.
>>  iii. Merged 3 test cases Explain analyze query, Explain analyze with
>> buffers and Explain analyze with timing.
>> 4. Improved debugger XSS test case execution time.
>>
>> --
>> *Harshal Dhumal*
>> *Sr. Software Engineer*
>>
>> EnterpriseDB India: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>
diff --git a/web/pgadmin/feature_tests/connect_to_server_feature_test.py b/web/pgadmin/feature_tests/connect_to_server_feature_test.py
deleted file mode 100644
index 97e96f2..000
--- a/web/pgadmin/feature_tests/connect_to_server_feature_test.py
+++ /dev/null
@@ -1,84 +0,0 @@
-##
-#
-# pgAdmin 4 - PostgreSQL Tools
-#
-# Copyright (C) 2013 - 2017, The pgAdmin Development Team
-# This software is released under the PostgreSQL Licence
-#
-##
-
-import time
-from selenium.webdriver import ActionChains
-
-import config as app_config
-from regression.feature_utils.base_feature_test import BaseFeatureTest
-from regression.python_test_utils import test_utils
-
-
-class ConnectsToServerFeatureTest(BaseFeatureTest):
-"""
-Tests that a database connection can be created from the UI
-"""
-scenarios = [
-("Test database connection", dict())
-]
-
-def before(self):
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
-  self.server['port'],
-  self.server['sslmode'])
-test_utils.drop_database(connection, "acceptance_test_db")
-test_utils.create_database(self.server, "acceptance_test_db")
-test_utils.create_table(self.server, "acceptance_test_db", "test_table")
-
-def runTest(self):
-"""This function tests that a database connection can be created from
-the UI"""
-self.assertEqual(app_config.APP_NAME, self.page.driver.title)
-self.page.wait_for_spinner_to_disappear()
-
-self._connects_to_server()
-self._tables_node_expandable()
-
-def after(self):
-self.page.remove_server(self.server)
-
-connection = test_utils.get_db_connection(self.server['db'],
-  self.server['username'],
-  self.server['db_password'],
-  self.server['host'],
-  self.server['port'],
-  self.server['sslmode'])
-test_utils.drop_database(connection, "acceptance_test_db")
-
-  

Re: [pgAdmin4][RM2586] Cleanup feature test

2017-08-06 Thread Sarah McAlear
Hi Harshal!

There are a few files in which there are leftover imports that are not
needed anymore:

   - PGDataypeFeatureTest
   - PgadminPage
   - CheckForXssFeatureTest
   - CheckDebuggerForXssFeatureTest


We also noticed that there were quite a few time.sleep functions that were
removed. This seems great overall, but we think that some of them were in
place because of varying network and computer speeds. So for example, in
QueryToolFeatureTest, there is an ajax call that was followed by a
time.sleep to ensure that it had finished executing before continuing to
execute. Removing this may reintroduce some flakiness. If there are no
issues with flakiness after this patch, it seems like a great idea. We ran
the tests a few times and didn't notice any flakiness, but we're unsure if
it will be a problem on a different system.

Thanks!
Wenlin & Sarah


On Wed, Aug 2, 2017 at 9:32 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> Please find attached patch to improve feature test execution time.
> Now on my machine overall execution time is cut down to 280 seconds from
> 400+ seconds
>
> Changes:
>
> 1. Removed fixed python time.sleeps where ever possible.
> 2. Removed connect to server test cases.
> 3. Query tool test cases:
>  i. Merged 3 test cases On demand result on scroll, grid select all
> and column select all.
>  ii. Merged 3 test cases Explain query, Explain query with verbose and
> Explain query with cost.
>  iii. Merged 3 test cases Explain analyze query, Explain analyze with
> buffers and Explain analyze with timing.
> 4. Improved debugger XSS test case execution time.
>
> --
> *Harshal Dhumal*
> *Sr. Software Engineer*
>
> EnterpriseDB India: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>