Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Login (for tests and in general) #114

Closed
2 tasks done
fmigneault opened this issue Oct 5, 2018 · 1 comment
Closed
2 tasks done

Fix Login (for tests and in general) #114

fmigneault opened this issue Oct 5, 2018 · 1 comment
Assignees
Labels
bug Problem, error, or invalid behaviour help wanted tests Test execution or additional use cases
Milestone

Comments

@fmigneault
Copy link
Collaborator

fmigneault commented Oct 5, 2018

Tests run locally fail because they cannot succeed the login procedure.

todo

error detail

. . . 
Starting Magpie app...
.......E....ssssssssssss
======================================================================
ERROR: setUpClass (tests.test_magpie_api.TestMagpieAPI_AdminAuth_Local)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/francis/VISI/PAVICS/magpie/tests/test_magpie_api.py", line 80, in setUpClass
    cls.check_requirements()
  File "/home/francis/VISI/PAVICS/magpie/tests/interfaces.py", line 113, in check_requirements
    assert cls.headers and cls.cookies, cls.require
AssertionError: cannot run tests without logged in 'administrators' user

======================================================================
ERROR: setUpClass (tests.test_magpie_ui.TestMagpieUI_AdminAuth_Local)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/francis/VISI/PAVICS/magpie/tests/test_magpie_ui.py", line 67, in setUpClass
    cls.headers, cls.cookies = utils.check_or_try_login_user(cls.url, cls.usr, cls.pwd, use_ui_form_submit=True)
  File "/home/francis/VISI/PAVICS/magpie/tests/utils.py", line 142, in check_or_try_login_user
    resp = app_or_url.get(url='/ui/login')
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 331, in get
    expect_errors=expect_errors)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 651, in do_request
    self._check_status(status, res)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 683, in _check_status
    res)
AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/ui/login)
{"code": 500, "route_name": "/ui/login", "detail": "Internal Server Error. Unhandled exception occurred.", "request_url": "http://localhost/ui/login", "type": "application/json", "method": "GET"}

======================================================================
ERROR: test_Login (tests.test_magpie_ui.TestMagpieUI_NoAuth_Local)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/francis/VISI/PAVICS/magpie/tests/interfaces.py", line 731, in test_Login
  File "/home/francis/VISI/PAVICS/magpie/tests/utils.py", line 369, in check_UpStatus
    resp = test_request(test_class.url, method, path, cookies=test_class.cookies)
  File "/home/francis/VISI/PAVICS/magpie/tests/utils.py", line 90, in test_request
    return app_or_url.get(path, **kwargs)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 331, in get
    expect_errors=expect_errors)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 651, in do_request
    self._check_status(status, res)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 683, in _check_status
    res)
AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/ui/login)
{"code": 500, "route_name": "/ui/login", "detail": "Internal Server Error. Unhandled exception occurred.", "request_url": "http://localhost/ui/login", "type": "application/json", "method": "GET"}

----------------------------------------------------------------------
Ran 75 tests in 2291.536s

FAILED (errors=3, skipped=60)
@fmigneault fmigneault self-assigned this Oct 5, 2018
@fmigneault fmigneault added the bug Problem, error, or invalid behaviour label Oct 5, 2018
@fmigneault
Copy link
Collaborator Author

fmigneault commented Oct 25, 2018

Tests work using MAGPIE_TEST_REMOTE_SERVER_URL=http://localhost:2001/magpie using another instance running Magpie on said port.
"Local" tests using webtest.TestApp still fail (cannot find route /signin_interal)
see #ergo/ziggurat_foundations#61

Error as of c60aef0

======================================================================
ERROR: setUpClass (tests.test_magpie_api.TestMagpieAPI_AdminAuth_Local)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/francis/VISI/PAVICS/magpie/tests/test_magpie_api.py", line 80, in setUpClass
    use_ui_form_submit=False, version=cls.version)
  File "/home/francis/VISI/PAVICS/magpie/tests/utils.py", line 147, in check_or_try_login_user
    resp = app_or_url.post_json('/signin', data, headers=headers)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/utils.py", line 36, in wrapper
    return self._gen_request(method, url, **kw)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 755, in _gen_request
    expect_errors=expect_errors)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 651, in do_request
    self._check_status(status, res)
  File "/home/francis/.conda/envs/magpie/lib/python2.7/site-packages/webtest/app.py", line 683, in _check_status
    res)
AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/signin)
{"code": 500, "route_name": "/signin", "detail": "Internal Server Error. Unhandled exception occurred.", "request_url": "http://localhost/signin", "type": "application/json", "method": "POST"}

----------------------------------------------------------------------
Ran 93 tests in 7.721s

FAILED (errors=1, skipped=64)

@fmigneault fmigneault added tests Test execution or additional use cases help wanted labels Feb 4, 2019
@fmigneault fmigneault added this to the 0.10.x milestone Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem, error, or invalid behaviour help wanted tests Test execution or additional use cases
Projects
None yet
Development

No branches or pull requests

1 participant