Re: [pgadmin4][Patch]: Test cases for the backup module - Mailing list pgadmin-hackers
From | Khushboo Vashi |
---|---|
Subject | Re: [pgadmin4][Patch]: Test cases for the backup module |
Date | |
Msg-id | CAFOhELfWeg0g4arK_mpgE0CEAmre-pU58UAr7KtemMcXczyq7A@mail.gmail.com Whole thread Raw |
In response to | Re: [pgadmin4][Patch]: Test cases for the backup module (Khushboo Vashi <khushboo.vashi@enterprisedb.com>) |
Responses |
Re: [pgadmin4][Patch]: Test cases for the backup module
|
List | pgadmin-hackers |
Hi,Please find the attached patch excluding feature test cases.Python test cases are working fine, so we can commit this patch. I am working on fixing the feature tests which are failing on the different window sizes.Thanks,KhushbooOn Fri, Jun 8, 2018 at 2:38 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Fri, Jun 8, 2018 at 6:33 AM, Khushboo Vashi <khushboo.vashi@enterprisedb.c--om> wrote: Hi Dave,As per our discussion I have changed the window size to 1280X800, before it was 1280X900.Please find the attached updated patchI'm not sure that actually made any difference on my system. The window continued to look taller than it is wide, so I wonder if the code to set the size is being ignored, or is at the wrong place?Anyway, I got 10 failures with this patch :-(==============================
============================== ========== ERROR: runTest (pgadmin.feature_tests.pg_util
ities_backup_restore_test.PGUt ilitiesBackupFeatureTest) Test for PG utilities - Backup and Restore
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/pg_util ities_backup_restore_test.py", line 97, in runTest self.page.find_by_xpath("//div
[contains(@class,'wcFloatingFo cus')" File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 171, in find_by_xpath lambda driver: driver.find_element_by_xpath(x
path) File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 263, in wait_for_element return self._wait_for("element to exist", element_if_it_exists)
File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 337, in _wait_for "Timed out waiting for " + waiting_for_message
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/selenium/webdriver/support /wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for element to exist
==============================
============================== ========== ERROR: runTest (pgadmin.feature_tests.xss_che
cks_pgadmin_debugger_test.Chec kDebuggerForXssFeatureTest) Tests to check if Debugger is vulnerable to XSS
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/xss_che cks_pgadmin_debugger_test.py", line 42, in runTest self._function_node_expandable
() File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/xss_che cks_pgadmin_debugger_test.py", line 57, in _function_node_expandable self.page.select_tree_item("a_
test_function()") File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 135, in select_tree_item "' and @class='aciTreeItem']").click(
) File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 171, in find_by_xpath lambda driver: driver.find_element_by_xpath(x
path) File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 263, in wait_for_element return self._wait_for("element to exist", element_if_it_exists)
File "/Users/dpage/git/pgadmin4/web
/regression/feature_utils/pgad min_page.py", line 337, in _wait_for "Timed out waiting for " + waiting_for_message
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/selenium/webdriver/support /wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for element to exist
==============================
============================== ========== ERROR: runTest (pgadmin.tools.backup.tests.te
st_create_backup_job.BackupJob Test) When backup the object with the default options
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/tests/te st_create_backup_job.py", line 58, in runTest self.assertNotIn
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/tests/te st_backup_utils.py", line 33, in run_backup_job random.randint(1, 9999999)))
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 830, in get return self.open(*args, **kw)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/testing.py", line 127, in open follow_redirects=follow_redire
cts) File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 803, in open response = self.run_wsgi_app(environ, buffered=buffered)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 716, in run_wsgi_app rv = run_wsgi_app(self.application, environ, buffered=buffered)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 923, in run_wsgi_app app_rv = app(environ, start_response)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request()
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request()
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpo
int](**req.view_args) File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask_login.py", line 792, in decorated_view return func(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web
/pgadmin/misc/bgprocess/__init __.py", line 62, in index return make_response(response=BatchPr
ocess.list()) File "/Users/dpage/git/pgadmin4/web
/pgadmin/misc/bgprocess/proces ses.py", line 584, in list details = desc.details(p.command, args)
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/__init__ .py", line 159, in details name, host, port = self.get_server_details()
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/__init__ .py", line 122, in get_server_details host = manager.local_bind_host if manager.use_ssh_tunnel else s.host
AttributeError: 'NoneType' object has no attribute 'use_ssh_tunnel'
==============================
============================== ========== ERROR: runTest (pgadmin.tools.maintenance.tes
ts.test_create_maintenance_job .MaintenanceJobTest) When maintenance the object with the default options
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/maintenance/tes ts/test_create_maintenance_job .py", line 71, in runTest random.randint(1, 9999999)))
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 830, in get return self.open(*args, **kw)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/testing.py", line 127, in open follow_redirects=follow_redire
cts) File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 803, in open response = self.run_wsgi_app(environ, buffered=buffered)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 716, in run_wsgi_app rv = run_wsgi_app(self.application, environ, buffered=buffered)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 923, in run_wsgi_app app_rv = app(environ, start_response)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request()
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request()
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpo
int](**req.view_args) File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask_login.py", line 792, in decorated_view return func(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web
/pgadmin/misc/bgprocess/__init __.py", line 62, in index return make_response(response=BatchPr
ocess.list()) File "/Users/dpage/git/pgadmin4/web
/pgadmin/misc/bgprocess/proces ses.py", line 584, in list details = desc.details(p.command, args)
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/__init__ .py", line 159, in details name, host, port = self.get_server_details()
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/__init__ .py", line 122, in get_server_details host = manager.local_bind_host if manager.use_ssh_tunnel else s.host
AttributeError: 'NoneType' object has no attribute 'use_ssh_tunnel'
==============================
============================== ========== ERROR: runTest (pgadmin.tools.restore.tests.t
est_create_restore_job.Restore JobTest) When restore the object with the default options
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/restore/tests/t est_create_restore_job.py", line 95, in runTest self.create_backup()
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/restore/tests/t est_create_restore_job.py", line 86, in create_backup self.assertNotIn
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/tests/te st_backup_utils.py", line 33, in run_backup_job random.randint(1, 9999999)))
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 830, in get return self.open(*args, **kw)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/testing.py", line 127, in open follow_redirects=follow_redire
cts) File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 803, in open response = self.run_wsgi_app(environ, buffered=buffered)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 716, in run_wsgi_app rv = run_wsgi_app(self.application, environ, buffered=buffered)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/werkzeug/test.py", line 923, in run_wsgi_app app_rv = app(environ, start_response)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1997, in __call__ return self.wsgi_app(environ, start_response)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1985, in wsgi_app response = self.handle_exception(e)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request()
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb)
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request()
File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask/app.py", line 1598, in dispatch_request return self.view_functions[rule.endpo
int](**req.view_args) File "/Users/dpage/.virtualenvs/pga
dmin4/lib/python2.7/site-packa ges/flask_login.py", line 792, in decorated_view return func(*args, **kwargs)
File "/Users/dpage/git/pgadmin4/web
/pgadmin/misc/bgprocess/__init __.py", line 62, in index return make_response(response=BatchPr
ocess.list()) File "/Users/dpage/git/pgadmin4/web
/pgadmin/misc/bgprocess/proces ses.py", line 584, in list details = desc.details(p.command, args)
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/__init__ .py", line 159, in details name, host, port = self.get_server_details()
File "/Users/dpage/git/pgadmin4/web
/pgadmin/tools/backup/__init__ .py", line 122, in get_server_details host = manager.local_bind_host if manager.use_ssh_tunnel else s.host
AttributeError: 'NoneType' object has no attribute 'use_ssh_tunnel'
==============================
============================== ========== FAIL: runTest (pgadmin.browser.server_groups
.servers.databases.schemas.fun ctions.tests.test_trigger_func _add.TriggerFuncAddTestCase) Fetch Trigger Function Node URL
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/browser/server_groups /servers/databases/schemas/fun ctions/tests/test_trigger_func _add.py", line 111, in runTest self.assertEquals(response.sta
tus_code, 200) AssertionError: 500 != 200
==============================
============================== ========== FAIL: runTest (pgadmin.browser.server_groups
.servers.databases.schemas.fun ctions.tests.test_trigger_func _delete.TriggerFuncDeleteTestC ase) Fetch Trigger Function Node URL
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/browser/server_groups /servers/databases/schemas/fun ctions/tests/test_trigger_func _delete.py", line 72, in runTest self.assertEquals(response.sta
tus_code, 200) AssertionError: 500 != 200
==============================
============================== ========== FAIL: runTest (pgadmin.browser.server_groups
.servers.databases.schemas.fun ctions.tests.test_trigger_func _get.TriggerFuncGetTestCase) Fetch Trigger Function Node URL
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/browser/server_groups /servers/databases/schemas/fun ctions/tests/test_trigger_func _get.py", line 72, in runTest self.assertEquals(response.sta
tus_code, 200) AssertionError: 500 != 200
==============================
============================== ========== FAIL: runTest (pgadmin.browser.server_groups
.servers.databases.schemas.fun ctions.tests.test_trigger_func _put.TriggerFuncPutTestCase) Fetch Trigger Function Node URL
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/browser/server_groups /servers/databases/schemas/fun ctions/tests/test_trigger_func _put.py", line 87, in runTest self.assertEquals(put_response
.status_code, 200) AssertionError: 500 != 200
==============================
============================== ========== FAIL: runTest (pgadmin.feature_tests.pg_util
ities_maintenance_test.PGUtili tiesMaintenanceFeatureTest) Test for PG maintenance: database pg_maintenance
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/pg_util ities_maintenance_test.py", line 63, in runTest self._verify_command()
File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/pg_util ities_maintenance_test.py", line 90, in _verify_command self.assertEquals(command, "VACUUM "
AssertionError: u'Backing up an object on the server \'Regression - PG 11 Feature Tests (localhost:5436)\' from database \'pg_utility_test_db\'...\nRun
ning command:\n/Library/PostgreSQL/ 11/bin/pg_dump --file "/Users/dpage/test_backup" --host "localhost" --port "5436" --username "postgres" --no-password --verbose --format=c --blobs "pg_utility_test_db"' != 'VACUUM (VERBOSE)\nRunning Query:\nVACUUM VERBOSE;'
==============================
============================== ========== FAIL: runTest (pgadmin.feature_tests.pg_util
ities_maintenance_test.PGUtili tiesMaintenanceFeatureTest) Test for PG maintenance: database
------------------------------
------------------------------ ---------- Traceback (most recent call last):
File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/pg_util ities_maintenance_test.py", line 63, in runTest self._verify_command()
File "/Users/dpage/git/pgadmin4/web
/pgadmin/feature_tests/pg_util ities_maintenance_test.py", line 97, in _verify_command " public." + self.table_name + ";")
AssertionError: u'Backing up an object on the server \'Regression - PG 11 Feature Tests (localhost:5436)\' from database \'pg_utility_test_db\'...\nRun
ning command:\n/Library/PostgreSQL/ 11/bin/pg_dump --file "/Users/dpage/test_backup" --host "localhost" --port "5436" --username "postgres" --no-password --verbose --format=c --blobs "pg_utility_test_db"' != 'VACUUM (VERBOSE)\nRunning Query:\nVACUUM VERBOSE public.pg_maintenance_table;'
------------------------------
------------------------------ ---------- Ran 369 tests in 417.660s
FAILED (failures=6, errors=5, skipped=13)
==============================
============================== ========== Test Result Summary
==============================
============================== ==========
Regression - PG 11:
346 tests passed
10 tests failed:
TriggerFuncGetTestCase (Fetch Trigger Function Node URL)
MaintenanceJobTest (When maintenance the object with the default options)
TriggerFuncDeleteTestCase (Fetch Trigger Function Node URL)
TriggerFuncPutTestCase (Fetch Trigger Function Node URL)
RestoreJobTest (When restore the object with the default options)
CheckDebuggerForXssFeatureTest (Tests to check if Debugger is vulnerable to XSS)
TriggerFuncAddTestCase (Fetch Trigger Function Node URL)
PGUtilitiesBackupFeatureTest (Test for PG utilities - Backup and Restore)
PGUtilitiesMaintenanceFeatureT
est (Test for PG maintenance: database, Test for PG maintenance: database pg_maintenance)
BackupJobTest (When backup the object with the default options)
13 tests skipped:
SynonymDeleteTestCase (Fetch synonym Node URL)
SynonymGetTestCase (Fetch synonym Node URL)
PackageDeleteTestCase (Fetch Package Node URL)
ResourceGroupsGetTestCase (Get resource groups)
TestSSLConnection (Test for SSL connection)
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)
==============================
============================== ========== Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachment
pgadmin-hackers by date: