public inbox for [email protected]
help / color / mirror / Atom feedFrom: Navnath Gadakh <[email protected]>
To: Dave Page <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Cc: Kanchan Mohitey <[email protected]>
Cc: Ikram Khan <[email protected]>
Cc: Hamid Quddus <[email protected]>
Subject: Re: pgAdmin4: Test-suite OS compatability issue
Date: Fri, 5 May 2017 16:05:59 +0530
Message-ID: <CAOAJCYqaWi7HjsxYBcZWKUqdo820h0Qv_P2ZsO7QxWpvX27MLA@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxozWNxu80+PnBhG5m+Mw7UUB+ZdqeNai8TYQdiqoLjgnNg@mail.gmail.com>
References: <CAOAJCYrRH_E-=TwsVK7=FsiV86xBgwKOQnVHanOQ9sMeBECe-g@mail.gmail.com>
<CA+OCxozWSsEe=NWMd4GD7YvkcnHf60=1n8+RmCHUPOb--7YV8g@mail.gmail.com>
<CAOAJCYpnE6hBb2NdLL6W_UD39H=kKZ+OJ61U7GyOMt8S6+3_5g@mail.gmail.com>
<CA+OCxowfyY0OqTWKv6QUr77Bh_H+u4S6DHTZT=2VZOYbmK0VaA@mail.gmail.com>
<CAOAJCYrxxm4qLH+LqJvPGc0=TLGT9ndsN=cJyw-LabnSdRcppA@mail.gmail.com>
<CA+OCxoyrA8z6D4LBnjFJ0xzj+VvROQPoKZysVgigV7zo54xiNg@mail.gmail.com>
<CAOAJCYpvAzq_QYVKXw2B0A2nSPzb1KG=3UJOUHoyRztQ8kRNMA@mail.gmail.com>
<CA+OCxozWNxu80+PnBhG5m+Mw7UUB+ZdqeNai8TYQdiqoLjgnNg@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi Dave,
Please find the revised patch with some code changes related OS
module used in feature tests for starting and stoping the app. There are
some functions of of OS module not supported in windows and unix/mac I have
applied some checked in the code.
Hope this will successfully run on your machine. :)
Thank you.
On Thu, May 4, 2017 at 5:46 PM, Dave Page <[email protected]> wrote:
> Hi
>
> Relevant console output is here, and the console log is attached. Again,
> the pgAdmin4.py remained running (pid 39809). Killing it returned control
> to the terminal.
>
> Regression - PG 9.4:
>
> 144 tests passed
> 0 tests failed
> 12 tests skipped:
> SynonymGetTestCase (Fetch synonym Node URL)
> PackageDeleteTestCase (Fetch Package Node URL)
> ResourceGroupsGetTestCase (Get resource groups)
> SynonymDeleteTestCase (Fetch synonym Node URL)
> ResourceGroupsAddTestCase (Add resource groups)
> PackagePutTestCase (Fetch Package Node URL)
> SynonymPutTestCase (Fetch synonym Node URL)
> ResourceGroupsPutTestCase (Put resource groups)
> ResourceGroupsDeleteTestCase (Delete resource groups)
> SynonymAddTestCase (Default Node URL)
> PackageAddTestCase (Fetch Package Node URL)
> PackageGetTestCase (Fetch Package Node URL)
>
> ======================================================================
>
> Please check output in file: /Users/dpage/git/pgadmin4/web/
> regression/regression.log
>
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Deleting servers.
> Stopping app.
> I am in stop_app() function.
> Quitting driver.
> pgAdmin4.py process killed.
>
> On Thu, May 4, 2017 at 12:53 PM, Navnath Gadakh <
> [email protected]> wrote:
>
>> Hi Dave,
>>
>> Please find the revised patch. I have added some print statements
>> for debug purpose, so that I can get which line causing this issue. Most
>> probably issue should be in the cleanup process.
>>
>> Please apply the patch and run the regression. Send me your console
>> output and *regression.log* file
>>
>> Thanks!
>>
>>
>>
>>
>>
>>
>> On Thu, May 4, 2017 at 2:18 PM, Dave Page <[email protected]> wrote:
>>
>>> I still see the issue. See the attached screenshot. Killing process
>>> 32287 caused the test suite to exit.[image: Inline image 1]
>>>
>>> On Wed, May 3, 2017 at 1:32 PM, Navnath Gadakh <
>>> [email protected]> wrote:
>>>
>>>> It's getting strange now. I just updated my Mac OS from EI Capitan(10.11.6)
>>>> to Sierra(10.12.4). I have applied the patch and it ran successfully
>>>> without any hangup.
>>>>
>>>> This is my console output:
>>>>
>>>> *======================================================================*
>>>>
>>>> *Test Result Summary*
>>>>
>>>> *======================================================================*
>>>>
>>>> *REGRESSION TEST 1 PostgreSQL 9.6:*
>>>>
>>>> *140 tests passed*
>>>>
>>>> *0 test failed*
>>>>
>>>> *16 tests skipped:*
>>>>
>>>> *PackageAddTestCase (Fetch Package Node URL)*
>>>>
>>>> *PackageDeleteTestCase (Fetch Package Node URL)*
>>>>
>>>> *PackageGetTestCase (Fetch Package Node URL)*
>>>>
>>>> *PackagePutTestCase (Fetch Package Node URL)*
>>>>
>>>> *SynonymAddTestCase (Default Node URL)*
>>>>
>>>> *SynonymDeleteTestCase (Fetch synonym Node URL)*
>>>>
>>>> *SynonymGetTestCase (Fetch synonym Node URL)*
>>>>
>>>> *SynonymPutTestCase (Fetch synonym Node URL)*
>>>>
>>>> *ResourceGroupsAddTestCase (Add resource groups)*
>>>>
>>>> *ResourceGroupsDeleteTestCase (Delete resource groups)*
>>>>
>>>> *ResourceGroupsPutTestCase (Put resource groups)*
>>>>
>>>> *ResourceGroupsGetTestCase (Get resource groups)*
>>>>
>>>> *TableSpaceAddTestCase (Check Tablespace Node)*
>>>>
>>>> *TableSpaceDeleteTestCase (Check Tablespace Node)*
>>>>
>>>> *TablespaceGetTestCase (Check Tablespace Node)*
>>>>
>>>> *TableSpaceUpdateTestCase (Check Tablespace Node)*
>>>>
>>>> *======================================================================*
>>>>
>>>> *Please check output in file:
>>>> /Users/edb/Navnath/pgadmin4/web/regression/regression.log*
>>>>
>>>> *(pgenv36) Laptop227-pn-in:regression Navnath$ *
>>>>
>>>>
>>>>
>>>> On Wed, May 3, 2017 at 1:39 PM, Dave Page <[email protected]> wrote:
>>>>
>>>>> 10.12.3 (Sierra), 16GB MBP. Running in a virtualenv built from the
>>>>> system Python installation. Packages are:
>>>>>
>>>>> (pgadmin4)piranha:~ dpage$ pip freeze
>>>>> alabaster==0.7.10
>>>>> alembic==0.9.1
>>>>> args==0.1.0
>>>>> Babel==1.3
>>>>> beautifulsoup4==4.4.1
>>>>> blinker==1.3
>>>>> chromedriver-installer==0.0.6
>>>>> click==6.6
>>>>> clint==0.5.1
>>>>> dateutils==0.6.6
>>>>> docutils==0.13.1
>>>>> extras==1.0.0
>>>>> fixtures==3.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-Migrate==2.0.3
>>>>> Flask-Principal==0.4.0
>>>>> Flask-Script==2.0.5
>>>>> Flask-Security==1.7.5
>>>>> Flask-SQLAlchemy==2.1
>>>>> Flask-WTF==0.12
>>>>> html5lib==1.0b3
>>>>> htmlmin==0.1.10
>>>>> imagesize==0.7.1
>>>>> importlib==1.0.3
>>>>> itsdangerous==0.24
>>>>> Jinja2==2.7.3
>>>>> linecache2==1.0.0
>>>>> Mako==1.0.6
>>>>> MarkupSafe==0.23
>>>>> minify==0.1.4
>>>>> passlib==1.6.2
>>>>> pbr==2.0.0
>>>>> pkginfo==1.4.1
>>>>> psycopg2==2.6.2
>>>>> pycrypto==2.6.1
>>>>> Pygments==2.2.0
>>>>> pyperclip==1.5.27
>>>>> pyrsistent==0.12.1
>>>>> python-dateutil==2.5.0
>>>>> python-editor==1.0.3
>>>>> python-mimeparse==1.6.0
>>>>> pytz==2014.10
>>>>> requests==2.13.0
>>>>> requests-toolbelt==0.7.1
>>>>> selenium==3.3.1
>>>>> simplejson==3.6.5
>>>>> six==1.10.0
>>>>> snowballstemmer==1.2.1
>>>>> speaklater==1.3
>>>>> Sphinx==1.5.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
>>>>>
>>>>>
>>>>> On Wed, May 3, 2017 at 7:13 AM, Navnath Gadakh <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Dave,
>>>>>>
>>>>>> I have applied and run this patch on Mac and it ran
>>>>>> successfully without hang up.
>>>>>>
>>>>>> I used different OS:
>>>>>> OS X Yosemite Version 10.10.2
>>>>>> OS X EI Capitan Version 10.11.6
>>>>>>
>>>>>> What is your system config?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, May 2, 2017 at 4:39 PM, Dave Page <[email protected]> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> When testing on Mac, the testsuite never exits with this patch
>>>>>>> applied. It just hangs after printing the result summary.
>>>>>>>
>>>>>>> On Fri, Apr 28, 2017 at 2:51 PM, Navnath Gadakh <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi Dave,
>>>>>>>>
>>>>>>>> Please find the patch for OS compatability issue of
>>>>>>>> test-suite.
>>>>>>>>
>>>>>>>> *Code Changes:*
>>>>>>>>
>>>>>>>> 1. Minor code changes done related to os module in
>>>>>>>> *pgadmin4/web/regression/feature_utils/app_starter.py*
>>>>>>>> 2. Code added in pgadmin4/*web/pgadmin/utils/tests/test_versioned_template_loader.py
>>>>>>>> *to handle path for SQL file.
>>>>>>>> 3. Code added to convert unicode to string in some .py
>>>>>>>> files.
>>>>>>>>
>>>>>>>> *Note:*
>>>>>>>> With python2.6.6 test-suite is failed to execute. I
>>>>>>>> have created the RM 2367
>>>>>>>> <https://redmine.postgresql.org/issues/2367;
>>>>>>>>
>>>>>>>> Thank you!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Regards,
>>>>>>>> Navnath Gadakh
>>>>>>>>
>>>>>>>> EnterpriseDB Corporation
>>>>>>>> The Enterprise PostgreSQL Company
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Sent via pgadmin-hackers mailing list (
>>>>>>>> [email protected])
>>>>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Navnath Gadakh
>>>>>>
>>>>>> EnterpriseDB Corporation
>>>>>> The Enterprise PostgreSQL Company
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Dave Page
>>>>> Blog: http://pgsnake.blogspot.com
>>>>> Twitter: @pgsnake
>>>>>
>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>> The Enterprise PostgreSQL Company
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>> Navnath Gadakh
>>>>
>>>> EnterpriseDB Corporation
>>>> The Enterprise PostgreSQL Company
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>>
>> --
>> Regards,
>> Navnath Gadakh
>>
>> EnterpriseDB Corporation
>> The Enterprise PostgreSQL Company
>>
>>
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
--
Regards,
Navnath Gadakh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[image/png] Screen Shot 2017-05-04 at 09.32.53.png (60.3K, 3-Screen%20Shot%202017-05-04%20at%2009.32.53.png)
download | view image
[application/octet-stream] testsuite_os_compatability_issue_v3.patch (6.7K, 4-testsuite_os_compatability_issue_v3.patch)
download | inline diff:
diff --git a/web/pgadmin/utils/tests/test_versioned_template_loader.py b/web/pgadmin/utils/tests/test_versioned_template_loader.py
index 5374b87..4ba5603 100644
--- a/web/pgadmin/utils/tests/test_versioned_template_loader.py
+++ b/web/pgadmin/utils/tests/test_versioned_template_loader.py
@@ -33,34 +33,37 @@ class TestVersionedTemplateLoader(BaseTestGenerator):
def test_get_source_returns_a_template(self):
expected_content = "Some SQL" \
"\nsome more stuff on a new line\n"
-
+ # For cross platform we join the SQL path (This solves the slashes issue)
+ sql_path = os.path.join("some_feature", "sql", "9.1_plus", "some_action.sql")
content, filename, up_to_dateness = self.loader.get_source(None, "some_feature/sql/9.1_plus/some_action.sql")
-
- self.assertEqual(expected_content, content)
- self.assertIn("some_feature/sql/9.1_plus/some_action.sql", filename)
+ self.assertEqual(expected_content, str(content).replace("\r",""))
+ self.assertIn(sql_path, filename)
def test_get_source_when_the_version_is_9_1_returns_9_1_template(self):
expected_content = "Some SQL" \
"\nsome more stuff on a new line\n"
-
+ # For cross platform we join the SQL path (This solves the slashes issue)
+ sql_path = os.path.join("some_feature", "sql", "9.1_plus", "some_action.sql")
content, filename, up_to_dateness = self.loader.get_source(None, "some_feature/sql/#90100#/some_action.sql")
- self.assertEqual(expected_content, content)
- self.assertIn("some_feature/sql/9.1_plus/some_action.sql", filename)
+ self.assertEqual(expected_content, str(content).replace("\r",""))
+ self.assertIn(sql_path, filename)
def test_get_source_when_the_version_is_9_3_and_there_are_templates_for_9_2_and_9_1_returns_9_2_template(self):
-
+ # For cross platform we join the SQL path (This solves the slashes issue)
+ sql_path = os.path.join("some_feature", "sql", "9.2_plus", "some_action.sql")
content, filename, up_to_dateness = self.loader.get_source(None, "some_feature/sql/#90300#/some_action.sql")
- self.assertEqual("Some 9.2 SQL", content)
- self.assertIn("some_feature/sql/9.2_plus/some_action.sql", filename)
+ self.assertEqual("Some 9.2 SQL", str(content).replace("\r",""))
+ self.assertIn(sql_path, filename)
def test_get_source_when_the_version_is_9_0_and_there_are_templates_for_9_1_and_9_2_returns_default_template(self):
-
+ # For cross platform we join the SQL path (This solves the slashes issue)
+ sql_path = os.path.join("some_feature", "sql", "default", "some_action_with_default.sql")
content, filename, up_to_dateness = self.loader.get_source(None, "some_feature/sql/#90000#/some_action_with_default.sql")
- self.assertEqual("Some default SQL", content)
- self.assertIn("some_feature/sql/default/some_action_with_default.sql", filename)
+ self.assertEqual("Some default SQL", str(content).replace("\r",""))
+ self.assertIn(sql_path, filename)
def test_raise_not_found_exception_when_postgres_version_less_than_all_available_sql_templates(self):
diff --git a/web/regression/feature_utils/app_starter.py b/web/regression/feature_utils/app_starter.py
index b03f2a9..96cc516 100644
--- a/web/regression/feature_utils/app_starter.py
+++ b/web/regression/feature_utils/app_starter.py
@@ -6,17 +6,15 @@
# This software is released under the PostgreSQL Licence
#
##########################################################################
-
import os
import subprocess
-
import signal
-
import random
+
class AppStarter:
- """
- Helper for starting the full pgadmin4 app and loading the page via selenium
+ """ Helper for starting the full pgadmin4 app and loading the page via
+ selenium
"""
def __init__(self, driver, app_config):
@@ -24,23 +22,35 @@ class AppStarter:
self.app_config = app_config
def start_app(self):
+ """ This function start the subprocess to start pgAdmin app """
random_server_port = str(random.randint(10000, 65535))
env = {
"PGADMIN_PORT": random_server_port,
- "SQLITE_PATH": self.app_config.TEST_SQLITE_PATH
- }
+ "SQLITE_PATH": str(self.app_config.TEST_SQLITE_PATH)
+ }
env.update(os.environ)
- self.pgadmin_process = subprocess.Popen(["python", "pgAdmin4.py"],
- shell=False,
- preexec_fn=os.setsid,
- stderr=open(os.devnull, 'w'),
- env=env)
+ # Add OS check for pass value for 'preexec_fn'
+ self.pgadmin_process = subprocess.Popen(
+ ["python", "pgAdmin4.py"],
+ shell=False,
+ preexec_fn=None if os.name == 'nt' else os.setsid,
+ stderr=open(os.devnull, 'w'),
+ env=env
+ )
self.driver.set_window_size(1024, 1024)
- print("opening browser")
- self.driver.get("http://" + self.app_config.DEFAULT_SERVER + ":" + random_server_port)
+ self.driver.get(
+ "http://" + self.app_config.DEFAULT_SERVER + ":" +
+ random_server_port)
def stop_app(self):
+ """ This function stop the started app by killing process """
self.driver.quit()
- os.killpg(os.getpgid(self.pgadmin_process.pid), signal.SIGTERM)
+ # os.killpg supported in Mac and Unix as this function not supported in
+ # Windows
+ try:
+ os.killpg(os.getpgid(self.pgadmin_process.pid), signal.SIGTERM)
+ except AttributeError:
+ # os.kill is supported by Windows
+ os.kill(self.pgadmin_process.pid, signal.SIGTERM)
diff --git a/web/regression/runtests.py b/web/regression/runtests.py
index 5f4a3d0..3ab7512 100644
--- a/web/regression/runtests.py
+++ b/web/regression/runtests.py
@@ -67,10 +67,10 @@ if pgadmin_credentials:
for item in ['login_username', 'login_password']):
pgadmin_credentials = pgadmin_credentials[
'pgAdmin4_login_credentials']
- os.environ['PGADMIN_SETUP_EMAIL'] = pgadmin_credentials[
- 'login_username']
- os.environ['PGADMIN_SETUP_PASSWORD'] = pgadmin_credentials[
- 'login_password']
+ os.environ['PGADMIN_SETUP_EMAIL'] = str(pgadmin_credentials[
+ 'login_username'])
+ os.environ['PGADMIN_SETUP_PASSWORD'] = str(pgadmin_credentials[
+ 'login_password'])
# Execute the setup file
exec (open("setup.py").read())
view thread (10+ 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], [email protected], [email protected], [email protected]
Subject: Re: pgAdmin4: Test-suite OS compatability issue
In-Reply-To: <CAOAJCYqaWi7HjsxYBcZWKUqdo820h0Qv_P2ZsO7QxWpvX27MLA@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