Re: [pgadmin-hackers] Acceptance Tests against a browser (WIP)

2017-01-31 Thread Dave Page
Hi George,

I just tried to do some debugging of pgAdmin, and found that I
couldn't start it. On further investigation, I found that I had an
instance running in the background on my system. I'm assuming this was
started by the acceptance tests, but not shutdown. I killed it off,
and re-ran the tests only to see failures because the database and
table used in the acceptance tests were still present. When the tests
completed, pgAdmin was again left running in the background.

I've just re-run the tests, having first killed the backgrounded
pgAdmin and then manually cleaned up the test objects. This time I do
indeed only get the two errors below when it tests the first of 3
servers I have configured. The second and third servers get three
errors each, and pgAdmin is left running in the background again.

So, you were right that I had another instance of pgAdmin running...
but it was tests that caused it :-p



On Tue, Jan 31, 2017 at 3:10 PM, Dave Page  wrote:
> Hi
>
> On Tue, Jan 31, 2017 at 2:54 PM, George Gelashvili
>  wrote:
>> Hi Dave,
>>
>> We agree that a random port would be a nice addition. We think having
>> randomized test database names can lead to polluting with lots of extra
>> databases left around in the event that cleanup fails for whatever reason
>> (e.g. a test errors out).  We see this happen already with the randomized
>> test databases you mention. We agree that there should probably be one
>> strategy across the test suite. We could use randomized names and have a
>> more general cleanup step that removes all databases of the form "test_...".
>
> I'm very wary about doing things like that. We had an early version of
> the suite that managed to delete all databases :-/. Maybe we could use
> a patterned name, but only delete databases that also have a comment
> with some text in it that we can verify?
>
>> Dave, are those errors you saw when you shut down your application on :5050
>> and did a fresh run of the tests? If not, could you please do a clean run?
>> It's possible that the second error could be related to viewport size as you
>> suggested, but the first error just looks like a problem with the test not
>> being able to spin up its own server.
>
> That was on a second run of the tests, yes. I just did a careful
> cleanup of left-over test databases, double-checked my server wasn't
> running and re-ran the tests - I got the same results.
>
>>
>> Thanks,
>> George & Tira
>>
>> On Tue, Jan 31, 2017 at 9:41 AM, Dave Page  wrote:
>>>
>>> Hi
>>>
>>> On Mon, Jan 30, 2017 at 9:23 PM, Atira Odhner  wrote:
>>> > Here's the patch with one more fix -- cleaning up the connections that
>>> > get
>>> > created in pgAdmin.
>>>
>>> Hmm, I had trouble with this one. I noticed a few issues:
>>>
>>> - The tests started pgAdmin listening on the default port (5050),
>>> however, I already had an instance running on there;
>>> a) It should have detected that something else was running on the port
>>> b) Shouldn't we just use a random, unused port?
>>>
>>> - Errors were given because I already had an acceptance_test_db on a
>>> number of servers, and that contained the test table. Obviously the
>>> code now cleans up after itself, but I think we should use a random
>>> database name as the main regression tests do (they append a random
>>> number to the name iirc).
>>>
>>> - Some of the tests just seemed to time out. I *think* this might be
>>> because the test browser window opens quite narrowly, and it looks
>>> like the tests are probably trying to do things with nodes that aren't
>>> actually visible.
>>>
>>> ==
>>> ERROR: runTest
>>> (pgadmin.acceptance.tests.connect_to_server_feature_test.ConnectsToServerFeatureTest)
>>> --
>>> Traceback (most recent call last):
>>>   File
>>> "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/connect_to_server_feature_test.py",
>>> line 69, in tearDown
>>> self.app_starter.stop_app()
>>>   File "/Users/dpage/git/pgadmin4/web/regression/utils/app_starter.py",
>>> line 27, in stop_app
>>> os.killpg(os.getpgid(self.pgadmin_process.pid), signal.SIGTERM)
>>> OSError: [Errno 3] No such process
>>>
>>> ==
>>> ERROR: runTest
>>> (pgadmin.acceptance.tests.sql_template_selection_by_postgres_version_works_feature_test.SQLTemplateSelectionByPostgresVersionWorksFeatureTest)
>>> --
>>> Traceback (most recent call last):
>>>   File
>>> "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/sql_template_selection_by_postgres_version_works_feature_test.py",
>>> line 37, in runTest
>>> self.page.find_by_xpath("//*[@id='tree']//*[@class='aciTreeText'
>>> and .='Trigger Functions']").click()
>>>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
>>> line 45, in find_b

Re: [pgadmin-hackers] Acceptance Tests against a browser (WIP)

2017-01-31 Thread Dave Page
Hi

On Tue, Jan 31, 2017 at 2:54 PM, George Gelashvili
 wrote:
> Hi Dave,
>
> We agree that a random port would be a nice addition. We think having
> randomized test database names can lead to polluting with lots of extra
> databases left around in the event that cleanup fails for whatever reason
> (e.g. a test errors out).  We see this happen already with the randomized
> test databases you mention. We agree that there should probably be one
> strategy across the test suite. We could use randomized names and have a
> more general cleanup step that removes all databases of the form "test_...".

I'm very wary about doing things like that. We had an early version of
the suite that managed to delete all databases :-/. Maybe we could use
a patterned name, but only delete databases that also have a comment
with some text in it that we can verify?

> Dave, are those errors you saw when you shut down your application on :5050
> and did a fresh run of the tests? If not, could you please do a clean run?
> It's possible that the second error could be related to viewport size as you
> suggested, but the first error just looks like a problem with the test not
> being able to spin up its own server.

That was on a second run of the tests, yes. I just did a careful
cleanup of left-over test databases, double-checked my server wasn't
running and re-ran the tests - I got the same results.

>
> Thanks,
> George & Tira
>
> On Tue, Jan 31, 2017 at 9:41 AM, Dave Page  wrote:
>>
>> Hi
>>
>> On Mon, Jan 30, 2017 at 9:23 PM, Atira Odhner  wrote:
>> > Here's the patch with one more fix -- cleaning up the connections that
>> > get
>> > created in pgAdmin.
>>
>> Hmm, I had trouble with this one. I noticed a few issues:
>>
>> - The tests started pgAdmin listening on the default port (5050),
>> however, I already had an instance running on there;
>> a) It should have detected that something else was running on the port
>> b) Shouldn't we just use a random, unused port?
>>
>> - Errors were given because I already had an acceptance_test_db on a
>> number of servers, and that contained the test table. Obviously the
>> code now cleans up after itself, but I think we should use a random
>> database name as the main regression tests do (they append a random
>> number to the name iirc).
>>
>> - Some of the tests just seemed to time out. I *think* this might be
>> because the test browser window opens quite narrowly, and it looks
>> like the tests are probably trying to do things with nodes that aren't
>> actually visible.
>>
>> ==
>> ERROR: runTest
>> (pgadmin.acceptance.tests.connect_to_server_feature_test.ConnectsToServerFeatureTest)
>> --
>> Traceback (most recent call last):
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/connect_to_server_feature_test.py",
>> line 69, in tearDown
>> self.app_starter.stop_app()
>>   File "/Users/dpage/git/pgadmin4/web/regression/utils/app_starter.py",
>> line 27, in stop_app
>> os.killpg(os.getpgid(self.pgadmin_process.pid), signal.SIGTERM)
>> OSError: [Errno 3] No such process
>>
>> ==
>> ERROR: runTest
>> (pgadmin.acceptance.tests.sql_template_selection_by_postgres_version_works_feature_test.SQLTemplateSelectionByPostgresVersionWorksFeatureTest)
>> --
>> Traceback (most recent call last):
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/sql_template_selection_by_postgres_version_works_feature_test.py",
>> line 37, in runTest
>> self.page.find_by_xpath("//*[@id='tree']//*[@class='aciTreeText'
>> and .='Trigger Functions']").click()
>>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
>> line 45, in find_by_xpath
>> return self.wait_for_element(lambda:
>> self.driver.find_element_by_xpath(xpath))
>>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
>> line 72, in wait_for_element
>> return self._wait_for("element to exist", element_if_it_exists)
>>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
>> line 106, in _wait_for
>> raise RuntimeError("timed out waiting for " + waiting_for_message)
>> RuntimeError: timed out waiting for element to exist
>>
>> ==
>> ERROR: runTest
>> (pgadmin.acceptance.tests.sql_template_selection_by_postgres_version_works_feature_test.SQLTemplateSelectionByPostgresVersionWorksFeatureTest)
>> --
>> Traceback (most recent call last):
>>   File
>> "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/sql_template_selection_by_postgres_version_works_feature_test.py",
>> line 60, in tearDown
>> self.page.find_by_xpath("//button[contain

Re: [pgadmin-hackers] Acceptance Tests against a browser (WIP)

2017-01-31 Thread George Gelashvili
Hi Dave,

We agree that a random port would be a nice addition. We think having
randomized test database names can lead to polluting with lots of extra
databases left around in the event that cleanup fails for whatever reason
(e.g. a test errors out).  We see this happen already with the randomized
test databases you mention. We agree that there should probably be one
strategy across the test suite. We could use randomized names and have a
more general cleanup step that removes all databases of the form "test_...".

Dave, are those errors you saw when you shut down your application on :5050
and did a fresh run of the tests? If not, could you please do a clean run?
It's possible that the second error could be related to viewport size as
you suggested, but the first error just looks like a problem with the test
not being able to spin up its own server.

Thanks,
George & Tira

On Tue, Jan 31, 2017 at 9:41 AM, Dave Page  wrote:

> Hi
>
> On Mon, Jan 30, 2017 at 9:23 PM, Atira Odhner  wrote:
> > Here's the patch with one more fix -- cleaning up the connections that
> get
> > created in pgAdmin.
>
> Hmm, I had trouble with this one. I noticed a few issues:
>
> - The tests started pgAdmin listening on the default port (5050),
> however, I already had an instance running on there;
> a) It should have detected that something else was running on the port
> b) Shouldn't we just use a random, unused port?
>
> - Errors were given because I already had an acceptance_test_db on a
> number of servers, and that contained the test table. Obviously the
> code now cleans up after itself, but I think we should use a random
> database name as the main regression tests do (they append a random
> number to the name iirc).
>
> - Some of the tests just seemed to time out. I *think* this might be
> because the test browser window opens quite narrowly, and it looks
> like the tests are probably trying to do things with nodes that aren't
> actually visible.
>
> ==
> ERROR: runTest (pgadmin.acceptance.tests.connect_to_server_feature_test.
> ConnectsToServerFeatureTest)
> --
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/
> connect_to_server_feature_test.py",
> line 69, in tearDown
> self.app_starter.stop_app()
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/app_starter.py",
> line 27, in stop_app
> os.killpg(os.getpgid(self.pgadmin_process.pid), signal.SIGTERM)
> OSError: [Errno 3] No such process
>
> ==
> ERROR: runTest (pgadmin.acceptance.tests.sql_template_selection_by_
> postgres_version_works_feature_test.SQLTemplateSelectionByPostgres
> VersionWorksFeatureTest)
> --
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/
> sql_template_selection_by_postgres_version_works_feature_test.py",
> line 37, in runTest
> self.page.find_by_xpath("//*[@id='tree']//*[@class='aciTreeText'
> and .='Trigger Functions']").click()
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
> line 45, in find_by_xpath
> return self.wait_for_element(lambda:
> self.driver.find_element_by_xpath(xpath))
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
> line 72, in wait_for_element
> return self._wait_for("element to exist", element_if_it_exists)
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
> line 106, in _wait_for
> raise RuntimeError("timed out waiting for " + waiting_for_message)
> RuntimeError: timed out waiting for element to exist
>
> ==
> ERROR: runTest (pgadmin.acceptance.tests.sql_template_selection_by_
> postgres_version_works_feature_test.SQLTemplateSelectionByPostgres
> VersionWorksFeatureTest)
> --
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/
> sql_template_selection_by_postgres_version_works_feature_test.py",
> line 60, in tearDown
> self.page.find_by_xpath("//button[contains(.,'Cancel')]").click()
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
> line 45, in find_by_xpath
> return self.wait_for_element(lambda:
> self.driver.find_element_by_xpath(xpath))
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
> line 72, in wait_for_element
> return self._wait_for("element to exist", element_if_it_exists)
>   File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
> line 106, in _wait_for
> raise RuntimeError("timed out waiting for " + waiting_for_message)
> RuntimeError: timed out waiting for el

Re: [pgadmin-hackers] Acceptance Tests against a browser (WIP)

2017-01-31 Thread Dave Page
Hi

On Mon, Jan 30, 2017 at 9:23 PM, Atira Odhner  wrote:
> Here's the patch with one more fix -- cleaning up the connections that get
> created in pgAdmin.

Hmm, I had trouble with this one. I noticed a few issues:

- The tests started pgAdmin listening on the default port (5050),
however, I already had an instance running on there;
a) It should have detected that something else was running on the port
b) Shouldn't we just use a random, unused port?

- Errors were given because I already had an acceptance_test_db on a
number of servers, and that contained the test table. Obviously the
code now cleans up after itself, but I think we should use a random
database name as the main regression tests do (they append a random
number to the name iirc).

- Some of the tests just seemed to time out. I *think* this might be
because the test browser window opens quite narrowly, and it looks
like the tests are probably trying to do things with nodes that aren't
actually visible.

==
ERROR: runTest 
(pgadmin.acceptance.tests.connect_to_server_feature_test.ConnectsToServerFeatureTest)
--
Traceback (most recent call last):
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/connect_to_server_feature_test.py",
line 69, in tearDown
self.app_starter.stop_app()
  File "/Users/dpage/git/pgadmin4/web/regression/utils/app_starter.py",
line 27, in stop_app
os.killpg(os.getpgid(self.pgadmin_process.pid), signal.SIGTERM)
OSError: [Errno 3] No such process

==
ERROR: runTest 
(pgadmin.acceptance.tests.sql_template_selection_by_postgres_version_works_feature_test.SQLTemplateSelectionByPostgresVersionWorksFeatureTest)
--
Traceback (most recent call last):
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/sql_template_selection_by_postgres_version_works_feature_test.py",
line 37, in runTest
self.page.find_by_xpath("//*[@id='tree']//*[@class='aciTreeText'
and .='Trigger Functions']").click()
  File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
line 45, in find_by_xpath
return self.wait_for_element(lambda:
self.driver.find_element_by_xpath(xpath))
  File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
line 72, in wait_for_element
return self._wait_for("element to exist", element_if_it_exists)
  File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
line 106, in _wait_for
raise RuntimeError("timed out waiting for " + waiting_for_message)
RuntimeError: timed out waiting for element to exist

==
ERROR: runTest 
(pgadmin.acceptance.tests.sql_template_selection_by_postgres_version_works_feature_test.SQLTemplateSelectionByPostgresVersionWorksFeatureTest)
--
Traceback (most recent call last):
  File 
"/Users/dpage/git/pgadmin4/web/pgadmin/acceptance/tests/sql_template_selection_by_postgres_version_works_feature_test.py",
line 60, in tearDown
self.page.find_by_xpath("//button[contains(.,'Cancel')]").click()
  File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
line 45, in find_by_xpath
return self.wait_for_element(lambda:
self.driver.find_element_by_xpath(xpath))
  File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
line 72, in wait_for_element
return self._wait_for("element to exist", element_if_it_exists)
  File "/Users/dpage/git/pgadmin4/web/regression/utils/pgadmin_page.py",
line 106, in _wait_for
raise RuntimeError("timed out waiting for " + waiting_for_message)
RuntimeError: timed out waiting for element to exist

--

Thanks.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch] Minor fix in test file for the Template loader

2017-01-31 Thread Dave Page
Works a treat - thanks, applied.

On Tue, Jan 31, 2017 at 10:49 AM, Murtuza Zabuawala
 wrote:
> Hi Dave,
>
> Please find minor patch for the same.
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Jan 31, 2017 at 4:10 PM, Dave Page  wrote:
>>
>> On Tue, Jan 31, 2017 at 10:36 AM, Murtuza Zabuawala
>>  wrote:
>> > Hi Dave,
>> >
>> > Even I tested against Python3.5 but did not receive any such error and I
>> > tried again after your mail but still did not receive error.
>> >
>> > murtuza@vm:~/pgadmin4/web/regression$ python3 --version
>> >
>> > Python 3.5.0
>>
>> Hmm, I have:
>>
>> (pgadmin4-py35) piranha:web dpage$ python --version
>> Python 3.5.3
>> (pgadmin4-py35) piranha:web dpage$ pip freeze
>> Babel==1.3
>> beautifulsoup4==4.4.1
>> blinker==1.3
>> click==6.6
>> extras==0.0.3
>> fixtures==2.0.0
>> Flask==0.11.1
>> Flask-Babel==0.11.1
>> Flask-Gravatar==0.4.2
>> Flask-HTMLmin==1.2
>> Flask-Login==0.3.2
>> Flask-Mail==0.9.1
>> Flask-Principal==0.4.0
>> Flask-Security==1.7.5
>> Flask-SQLAlchemy==2.1
>> Flask-WTF==0.12
>> html5lib==1.0b3
>> htmlmin==0.1.10
>> itsdangerous==0.24
>> Jinja2==2.7.3
>> linecache2==1.0.0
>> MarkupSafe==0.23
>> passlib==1.6.2
>> pbr==1.9.1
>> psycopg2==2.6.2
>> pycrypto==2.6.1
>> pyrsistent==0.11.13
>> python-dateutil==2.5.0
>> python-mimeparse==1.5.1
>> pytz==2014.10
>> simplejson==3.6.5
>> six==1.9.0
>> speaklater==1.3
>> SQLAlchemy==1.0.14
>> sqlparse==0.1.19
>> testscenarios==0.5.0
>> testtools==2.0.0
>> traceback2==1.4.0
>> unittest2==1.1.0
>> Werkzeug==0.9.6
>> WTForms==2.0.2
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Another Python 3 fix.

2017-01-31 Thread Dave Page
Another Python 3 fix.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0da8d1fe4c62e03157fcbee7b1f626dbae4f140c
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/utils/sqlautocomplete/counter.py | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch] Minor fix in test file for the Template loader

2017-01-31 Thread Murtuza Zabuawala
Hi Dave,

Please find minor patch for the same.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, Jan 31, 2017 at 4:10 PM, Dave Page  wrote:

> On Tue, Jan 31, 2017 at 10:36 AM, Murtuza Zabuawala
>  wrote:
> > Hi Dave,
> >
> > Even I tested against Python3.5 but did not receive any such error and I
> > tried again after your mail but still did not receive error.
> >
> > murtuza@vm:~/pgadmin4/web/regression$ python3 --version
> >
> > Python 3.5.0
>
> Hmm, I have:
>
> (pgadmin4-py35) piranha:web dpage$ python --version
> Python 3.5.3
> (pgadmin4-py35) piranha:web dpage$ pip freeze
> Babel==1.3
> beautifulsoup4==4.4.1
> blinker==1.3
> click==6.6
> extras==0.0.3
> fixtures==2.0.0
> Flask==0.11.1
> Flask-Babel==0.11.1
> Flask-Gravatar==0.4.2
> Flask-HTMLmin==1.2
> Flask-Login==0.3.2
> Flask-Mail==0.9.1
> Flask-Principal==0.4.0
> Flask-Security==1.7.5
> Flask-SQLAlchemy==2.1
> Flask-WTF==0.12
> html5lib==1.0b3
> htmlmin==0.1.10
> itsdangerous==0.24
> Jinja2==2.7.3
> linecache2==1.0.0
> MarkupSafe==0.23
> passlib==1.6.2
> pbr==1.9.1
> psycopg2==2.6.2
> pycrypto==2.6.1
> pyrsistent==0.11.13
> python-dateutil==2.5.0
> python-mimeparse==1.5.1
> pytz==2014.10
> simplejson==3.6.5
> six==1.9.0
> speaklater==1.3
> SQLAlchemy==1.0.14
> sqlparse==0.1.19
> testscenarios==0.5.0
> testtools==2.0.0
> traceback2==1.4.0
> unittest2==1.1.0
> Werkzeug==0.9.6
> WTForms==2.0.2
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
diff --git a/web/pgadmin/utils/sqlautocomplete/counter.py 
b/web/pgadmin/utils/sqlautocomplete/counter.py
index 081b390..1ccd99c 100644
--- a/web/pgadmin/utils/sqlautocomplete/counter.py
+++ b/web/pgadmin/utils/sqlautocomplete/counter.py
@@ -3,7 +3,12 @@ Copied from 
http://code.activestate.com/recipes/576611-counter-class/
 """
 
 from heapq import nlargest
-from itertools import repeat, ifilter
+from itertools import repeat
+try:
+from itertools import ifilter
+except ImportError:
+# ifilter is in-built function in Python3 as filter
+ifilter = filter
 from operator import itemgetter
 
 

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch] Minor fix in test file for the Template loader

2017-01-31 Thread Dave Page
On Tue, Jan 31, 2017 at 10:36 AM, Murtuza Zabuawala
 wrote:
> Hi Dave,
>
> Even I tested against Python3.5 but did not receive any such error and I
> tried again after your mail but still did not receive error.
>
> murtuza@vm:~/pgadmin4/web/regression$ python3 --version
>
> Python 3.5.0

Hmm, I have:

(pgadmin4-py35) piranha:web dpage$ python --version
Python 3.5.3
(pgadmin4-py35) piranha:web dpage$ pip freeze
Babel==1.3
beautifulsoup4==4.4.1
blinker==1.3
click==6.6
extras==0.0.3
fixtures==2.0.0
Flask==0.11.1
Flask-Babel==0.11.1
Flask-Gravatar==0.4.2
Flask-HTMLmin==1.2
Flask-Login==0.3.2
Flask-Mail==0.9.1
Flask-Principal==0.4.0
Flask-Security==1.7.5
Flask-SQLAlchemy==2.1
Flask-WTF==0.12
html5lib==1.0b3
htmlmin==0.1.10
itsdangerous==0.24
Jinja2==2.7.3
linecache2==1.0.0
MarkupSafe==0.23
passlib==1.6.2
pbr==1.9.1
psycopg2==2.6.2
pycrypto==2.6.1
pyrsistent==0.11.13
python-dateutil==2.5.0
python-mimeparse==1.5.1
pytz==2014.10
simplejson==3.6.5
six==1.9.0
speaklater==1.3
SQLAlchemy==1.0.14
sqlparse==0.1.19
testscenarios==0.5.0
testtools==2.0.0
traceback2==1.4.0
unittest2==1.1.0
Werkzeug==0.9.6
WTForms==2.0.2


-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch] Minor fix in test file for the Template loader

2017-01-31 Thread Murtuza Zabuawala
Hi Dave,

Even I tested against Python3.5 but did not receive any such error and I
tried again after your mail but still did not receive error.

murtuza@vm:~/pgadmin4/web/regression$ python3 --version

Python 3.5.0

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, Jan 31, 2017 at 3:34 PM, Dave Page  wrote:

> Thanks Murtuza. When you get a minute, can you also look at the
> following issue I get with the tests under Python 3.5? It doesn't seem
> to stop them working.
>
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/route.py", line
> 75, in load_generators
> import_module(module_name)
>   File "/Users/dpage/.virtualenvs/pgadmin4-py35/lib/python3.5/
> importlib/__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in
> _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 673, in exec_module
>   File "", line 222, in
> _call_with_frames_removed
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/
> sqlautocomplete/counter.py",
> line 6, in 
> from itertools import repeat, ifilter
> ImportError: cannot import name 'ifilter'
>
>
> On Tue, Jan 31, 2017 at 5:25 AM, Murtuza Zabuawala
>  wrote:
> > Hi,
> >
> > PFA patch to fix the issue in test suite for template loader.
> >
> > Issue(Python3):
> > murtuza@vm:~/pgadmin4/web/regression$ python3 runtests.py
> > pgAdmin 4 - Application Initialisation
> > ==
> >
> >
> > The configuration database - '/../.pgadmin/test_pgadmin4.db' does not
> exist.
> > Entering initial setup mode...
> > NOTE: Configuring authentication for SERVER mode.
> >
> >
> > The configuration database has been created at
> /../.pgadmin/test_pgadmin4.db
> > Traceback (most recent call last):
> >   File "runtests.py", line 250, in 
> > test_module_list = get_test_modules(args)
> >   File "runtests.py", line 138, in get_test_modules
> > TestsGeneratorRegistry.load_generators('pgadmin')
> >   File "../../pgadmin4/web/pgadmin/utils/route.py", line 66, in
> > load_generators
> > import_module(module_name)
> >   File "/../../3.5/lib/python3.5/importlib/__init__.py", line 126, in
> > import_module
> > return _bootstrap._gcd_import(name[level:], package, level)
> >   File "", line 986, in _gcd_import
> >   File "", line 969, in _find_and_load
> >   File "", line 958, in
> _find_and_load_unlocked
> >   File "", line 673, in _load_unlocked
> >   File "", line 658, in
> exec_module
> >   File "", line 764, in get_code
> >   File "", line 724, in
> source_to_code
> >   File "", line 222, in
> > _call_with_frames_removed
> >   File
> > "/../../pgadmin4/web/pgadmin/utils/tests/test_versioned_
> template_loader.py",
> > line 50
> > except TemplateNotFound, e:
> >^
> > SyntaxError: invalid syntax
> >
> > --
> > Regards,
> > Murtuza Zabuawala
> > EnterpriseDB: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: [pgadmin-hackers] [pgAdmin4][Patch] Minor fix in test file for the Template loader

2017-01-31 Thread Ashesh Vashi
Murtuza,

FYI -
http://www.diveintopython3.net/porting-code-to-python-3-with-2to3.html#itertools

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


On Tue, Jan 31, 2017 at 3:34 PM, Dave Page  wrote:

> Thanks Murtuza. When you get a minute, can you also look at the
> following issue I get with the tests under Python 3.5? It doesn't seem
> to stop them working.
>
> Traceback (most recent call last):
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/route.py", line
> 75, in load_generators
> import_module(module_name)
>   File "/Users/dpage/.virtualenvs/pgadmin4-py35/lib/python3.5/
> importlib/__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in
> _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 673, in exec_module
>   File "", line 222, in
> _call_with_frames_removed
>   File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/
> sqlautocomplete/counter.py",
> line 6, in 
> from itertools import repeat, ifilter
> ImportError: cannot import name 'ifilter'
>
>
> On Tue, Jan 31, 2017 at 5:25 AM, Murtuza Zabuawala
>  wrote:
> > Hi,
> >
> > PFA patch to fix the issue in test suite for template loader.
> >
> > Issue(Python3):
> > murtuza@vm:~/pgadmin4/web/regression$ python3 runtests.py
> > pgAdmin 4 - Application Initialisation
> > ==
> >
> >
> > The configuration database - '/../.pgadmin/test_pgadmin4.db' does not
> exist.
> > Entering initial setup mode...
> > NOTE: Configuring authentication for SERVER mode.
> >
> >
> > The configuration database has been created at
> /../.pgadmin/test_pgadmin4.db
> > Traceback (most recent call last):
> >   File "runtests.py", line 250, in 
> > test_module_list = get_test_modules(args)
> >   File "runtests.py", line 138, in get_test_modules
> > TestsGeneratorRegistry.load_generators('pgadmin')
> >   File "../../pgadmin4/web/pgadmin/utils/route.py", line 66, in
> > load_generators
> > import_module(module_name)
> >   File "/../../3.5/lib/python3.5/importlib/__init__.py", line 126, in
> > import_module
> > return _bootstrap._gcd_import(name[level:], package, level)
> >   File "", line 986, in _gcd_import
> >   File "", line 969, in _find_and_load
> >   File "", line 958, in
> _find_and_load_unlocked
> >   File "", line 673, in _load_unlocked
> >   File "", line 658, in
> exec_module
> >   File "", line 764, in get_code
> >   File "", line 724, in
> source_to_code
> >   File "", line 222, in
> > _call_with_frames_removed
> >   File
> > "/../../pgadmin4/web/pgadmin/utils/tests/test_versioned_
> template_loader.py",
> > line 50
> > except TemplateNotFound, e:
> >^
> > SyntaxError: invalid syntax
> >
> > --
> > Regards,
> > Murtuza Zabuawala
> > EnterpriseDB: http://www.enterprisedb.com
> > The Enterprise PostgreSQL Company
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>


Re: [pgadmin-hackers] pgAdmin4: Minor code change in test-suite (RM #2127)

2017-01-31 Thread Dave Page
Thanks, applied.

On Tue, Jan 31, 2017 at 6:23 AM, Navnath Gadakh
 wrote:
> Hello Dave,
> Please find the attached patch for minor code changes in test-suite.
> It's just need to add config.UPGRADE_CHECK_ENABLED = False  in runtests.py.
> So that it will not try to check the application version if there is no
> internet connection on the host machine.
>
> Thanks.
>
> --
> Regards,
> Navnath Gadakh
>
> EnterpriseDB Corporation
> The Enterprise PostgreSQL Company
>
>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Disable upgrade checks during regression testing.

2017-01-31 Thread Dave Page
Disable upgrade checks during regression testing.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=fd53e0c527db5a13f6abdaa2cdf18d26e5f42665
Author: Navnath Gadakh 

Modified Files
--
web/regression/runtests.py | 5 +
1 file changed, 5 insertions(+)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Regarding Import and Export Issue

2017-01-31 Thread vinay.mali
Hi,
Provide required details as below,   
   - pgAdmin4 Version: Yes after installing PostgreSQL 9.6   

   - PostgreSQL Version: 9.6   

   - Operating system: Windows 10   

   - Reproduce steps: Clearly mention the steps to reproduce the bug.   

   
   - Create table test having id as integer and name as character varying with 
some values in it.
   - click on button export and and select csv type with delimiter as ',' store 
where you want it.
   
   - Expected result: How application should behave on the above mentioned 
steps.   

   
   - Need to start the export functionality but it wont.
   
   - Actual result: What is the actual result on running the above steps i.e. 
the bug behavior.
   
   - same way create csv file and import to any of it havinf same no f columns 
in it.
 Regards,Vinay MaliSoftware Developer | Pune, (IST) | Cell: +91-99233 88865 

On Tuesday, 31 January 2017 3:23 PM, Murtuza Zabuawala 
 wrote:
 

 Hi,
Provide required details as below,   
   - pgAdmin4 Version: ?   

   - PostgreSQL Version: ?   

   - Operating system: ?   

   - Reproduce steps: Clearly mention the steps to reproduce the bug.   

   - Expected result: How application should behave on the above mentioned 
steps.   

   - Actual result: What is the actual result on running the above steps i.e. 
the bug behavior.   


--Regards,Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, Jan 31, 2017 at 1:10 PM,  wrote:

Hello
I have issue for the for the tables data in the Export and import functionality.
 Regards,Vinay MaliSoftware Developer | Pune, (IST) | 



   

Re: [pgadmin-hackers] [pgAdmin4][Patch] Minor fix in test file for the Template loader

2017-01-31 Thread Dave Page
Thanks Murtuza. When you get a minute, can you also look at the
following issue I get with the tests under Python 3.5? It doesn't seem
to stop them working.

Traceback (most recent call last):
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/route.py", line
75, in load_generators
import_module(module_name)
  File 
"/Users/dpage/.virtualenvs/pgadmin4-py35/lib/python3.5/importlib/__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 986, in _gcd_import
  File "", line 969, in _find_and_load
  File "", line 958, in _find_and_load_unlocked
  File "", line 673, in _load_unlocked
  File "", line 673, in exec_module
  File "", line 222, in _call_with_frames_removed
  File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/sqlautocomplete/counter.py",
line 6, in 
from itertools import repeat, ifilter
ImportError: cannot import name 'ifilter'


On Tue, Jan 31, 2017 at 5:25 AM, Murtuza Zabuawala
 wrote:
> Hi,
>
> PFA patch to fix the issue in test suite for template loader.
>
> Issue(Python3):
> murtuza@vm:~/pgadmin4/web/regression$ python3 runtests.py
> pgAdmin 4 - Application Initialisation
> ==
>
>
> The configuration database - '/../.pgadmin/test_pgadmin4.db' does not exist.
> Entering initial setup mode...
> NOTE: Configuring authentication for SERVER mode.
>
>
> The configuration database has been created at /../.pgadmin/test_pgadmin4.db
> Traceback (most recent call last):
>   File "runtests.py", line 250, in 
> test_module_list = get_test_modules(args)
>   File "runtests.py", line 138, in get_test_modules
> TestsGeneratorRegistry.load_generators('pgadmin')
>   File "../../pgadmin4/web/pgadmin/utils/route.py", line 66, in
> load_generators
> import_module(module_name)
>   File "/../../3.5/lib/python3.5/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 986, in _gcd_import
>   File "", line 969, in _find_and_load
>   File "", line 958, in _find_and_load_unlocked
>   File "", line 673, in _load_unlocked
>   File "", line 658, in exec_module
>   File "", line 764, in get_code
>   File "", line 724, in source_to_code
>   File "", line 222, in
> _call_with_frames_removed
>   File
> "/../../pgadmin4/web/pgadmin/utils/tests/test_versioned_template_loader.py",
> line 50
> except TemplateNotFound, e:
>^
> SyntaxError: invalid syntax
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] pgAdmin 4 commit: Python 3 fix for the template loader test.

2017-01-31 Thread Dave Page
Python 3 fix for the template loader test.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2e5771e164d2f67118948c4a620a1262a47dbdeb
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/utils/tests/test_versioned_template_loader.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] Regarding Import and Export Issue

2017-01-31 Thread Murtuza Zabuawala
Hi,

Provide required details as below,

   - pgAdmin4 Version: ?
   - PostgreSQL Version: ?
   - Operating system: ?
   - Reproduce steps: Clearly mention the steps to reproduce the bug.
   - Expected result: How application should behave on the above mentioned
   steps.
   - Actual result: What is the actual result on running the above steps
   i.e. the bug behavior.


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Tue, Jan 31, 2017 at 1:10 PM,  wrote:

> Hello
>
> I have issue for the for the tables data in the Export and import
> functionality.
>
>
> Regards,
> Vinay Mali
> Software Developer | Pune, (IST) |
>


[pgadmin-hackers] Regarding Import and Export Issue

2017-01-31 Thread vinay.mali
Hello
I have issue for the for the tables data in the Export and import functionality.
 Regards,Vinay MaliSoftware Developer | Pune, (IST) | 

[pgadmin-hackers] pgAdmin4: Minor code change in test-suite (RM #2127)

2017-01-31 Thread Navnath Gadakh
Hello Dave,
Please find the attached patch for minor code changes in test-suite.
It's just need to add config.UPGRADE_CHECK_ENABLED = False  in runtests.py.
So that it will not try to check the application version if there is no
internet connection on the host machine.

Thanks.

-- 
Regards,
Navnath Gadakh

EnterpriseDB Corporation
The Enterprise PostgreSQL Company


minor_code_change_in_testsuite_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers