OpenTreeOfLife / peyotl

python library for interacting with Open Tree of Life resources
BSD 2-Clause "Simplified" License
11 stars 7 forks source link

ws-tests failing for phylesystem-api / peyotl #175

Closed jar398 closed 6 years ago

jar398 commented 6 years ago

I suspect these errors have something to do with the commits on Nov 8. Maybe those commits should be moved from master to a development branch, so that we don't break the production sites when production gets reinitialized.

None of the thirty ws-tests pass (against api.opentreeoflife.org). Here are the first two:

Running tests in ../germinator/ws-tests/../../phylesystem-api/ws-tests
Traceback (most recent call last):
  File "test_amendment_get_404.py", line 7, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', expected_status=404):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 100, in test_http_json_method
    print 'Non gzipped response, but not a string is:', results
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /v3/amendment/additions-0000000-99999999 (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_amendment_list.py", line 9, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
F
bredelings commented 6 years ago

Hi Jonathan, So, they pass for me:

$ ./ws-tests/run_tests.sh https://api.opentreeoflife.org
No tests directory specified, will run all tests
Running tests in ../germinator/ws-tests/../../phylesystem-api/ws-tests
.....s..sssssss.."NONE" is an invalid formatter name
...s......"NONE" is an invalid formatter name
sss
Passed 18 out of 30 tests.
An 's' means a test was skipped.
Skipped 12 tests.

Have you changed something about api.opentreeoflife.org since then?

jar398 commented 6 years ago

I haven't made any changes. We're running the tests in different ways. I am using the API-wide test script in the germinator repo, which uses the master copy of opentreetesting.py. Perhaps the peyotl version of opentreetest.py has gotten out of sync with the master version in the germinator repo? (The specific opentreetesting.py versions in each subsystem repo really ought to be deleted in favor of the one in the germinator repo, to avoid confusions like this. I didn't want to touch peyotl at the time I was working on the test system, however. Deleting them might require changes to the subsystem-specific testing instructions.) You should be able to reproduce the following:

(ve)bash-3.2$ (cd germinator; git pull)
remote: Counting objects: 10, done.        
remote: Compressing objects: 100% (6/6), done.        
remote: Total 10 (delta 4), reused 10 (delta 4), pack-reused 0        
Unpacking objects: 100% (10/10), done.
From github.com:OpenTreeOfLife/germinator
 * [new branch]      development -> origin/development
Already up-to-date.
(ve)bash-3.2$ (cd peyotl; git pull)
remote: Counting objects: 462, done.        
remote: Total 462 (delta 318), reused 318 (delta 318), pack-reused 144        
Receiving objects: 100% (462/462), 77.39 KiB | 0 bytes/s, done.
Resolving deltas: 100% (360/360), completed with 66 local objects.
From github.com:OpenTreeOfLife/peyotl
   9409f37..874f39c  master                 -> origin/master
   d0fb2e2..244fecc  add-support-for-illustrations -> origin/add-support-for-illustrations
 * [new branch]      phylesystem-1-issue-14 -> origin/phylesystem-1-issue-14
   1105116..7b931a3  reduce-dup             -> origin/reduce-dup
 * [new branch]      test-harness-fix       -> origin/test-harness-fix
Updating 9409f37..874f39c
Fast-forward
 peyotl/__init__.py                               |   4 +-
 peyotl/collections_store/__init__.py             |  11 +++
 peyotl/collections_store/collections_umbrella.py |   3 +-
 peyotl/collections_store/validation/adaptor.py   |  17 ++--
 peyotl/external.py                               |   3 +-
 peyotl/nexson_syntax/__init__.py                 |  72 +++++++++++++---
 peyotl/ott/__init__.py                           | 124 ++++++++++++----------------
 peyotl/test/data/nexson/S15515.json              |   2 +-
 tests/bash-test-helpers.bash                     |   2 +-
 tests/local_repos_tests/test_collections.py      |   2 +-
 tests/ws_tests/read_only/test_treebase_import.py |   7 +-
 11 files changed, 147 insertions(+), 100 deletions(-)
(ve)bash-3.2$ 
(ve)bash-3.2$ (cd phylesystem-api; git pull)
Already up-to-date.
(ve)bash-3.2$ 
(ve)bash-3.2$ 
(ve)bash-3.2$ cd germinator/ws-tests/
(ve)bash-3.2$ ./run_tests.sh https://api.opentreeoflife.org
No tests directory specified, will run all tests
Running tests in ../../germinator/ws-tests/../../phylesystem-api/ws-tests
Traceback (most recent call last):
  File "test_amendment_get_404.py", line 7, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', expected_status=404):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 100, in test_http_json_method
    print 'Non gzipped response, but not a string is:', results
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /v3/amendment/additions-0000000-99999999 (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_amendment_list.py", line 9, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_api_root.py", line 6, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', expected_status=200):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 100, in test_http_json_method
    print 'Non gzipped response, but not a string is:', results
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /phylesystem (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_collection_get_404.py", line 7, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', expected_status=404):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 100, in test_http_json_method
    print 'Non gzipped response, but not a string is:', results
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /v2/collection/nonexistentuser/fake-id (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_collection_list.py", line 10, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_empty_study_put.py", line 3, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_external_url.py", line 10, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_file_get.py", line 17, in <module>
    is_json=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_integration.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_invalid_merge.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_nonauth_study_put.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_nonnexson_study_put.py", line 3, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_study_create_delete.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_study_create_delete_message.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_study_create_treebase.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_study_get.py", line 7, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', data=data, expected_status=200):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 95, in test_http_json_method
    if isinstance(results, unicode) or isinstance(results, str):
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /phylesystem/v1/study/10 (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_study_get_404.py", line 7, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', expected_status=404):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 100, in test_http_json_method
    print 'Non gzipped response, but not a string is:', results
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /phylesystem/v1/study/1 (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_study_get_bad_outformat.py", line 7, in <module>
    if test_http_json_method(SUBMIT_URI, 'GET', data=data, expected_status=400):
  File "/Users/jar/otrepo/phylesystem-api/ws-tests/opentreetesting.py", line 95, in test_http_json_method
    if isinstance(results, unicode) or isinstance(results, str):
  File "/Library/Python/2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Python/2.7/site-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Python/2.7/site-packages/requests/adapters.py", line 375, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ot17.opentreeoflife.org', port=80): Max retries exceeded with url: /phylesystem/v1/study/10 (Caused by <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known)
FTraceback (most recent call last):
  File "test_study_get_multiformat.py", line 14, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_study_list.py", line 10, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_study_push.py", line 3, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_tree_get.py", line 12, in <module>
    is_json=False)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_tree_newick_get.py", line 12, in <module>
    is_json=False)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_v2_studies_find_doi.py", line 15, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_v2_studies_find_trees.py", line 14, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_v2_studies_findall.py", line 10, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_v2_studies_properties.py", line 10, in <module>
    return_bool_data=True)
TypeError: test_http_json_method() got an unexpected keyword argument 'return_bool_data'
FTraceback (most recent call last):
  File "test_valid_study_put.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_valid_study_put_multiformat.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
FTraceback (most recent call last):
  File "test_valid_study_put_override_author.py", line 2, in <module>
    from opentreetesting import test_http_json_method, writable_api_host_and_oauth_or_exit
ImportError: cannot import name writable_api_host_and_oauth_or_exit
F
Passed 0 out of 30 tests.
Failures:  test_amendment_get_404.py test_amendment_list.py test_api_root.py test_collection_get_404.py test_collection_list.py test_empty_study_put.py test_external_url.py test_file_get.py test_integration.py test_invalid_merge.py test_nonauth_study_put.py test_nonnexson_study_put.py test_study_create_delete.py test_study_create_delete_message.py test_study_create_treebase.py test_study_get.py test_study_get_404.py test_study_get_bad_outformat.py test_study_get_multiformat.py test_study_list.py test_study_push.py test_tree_get.py test_tree_newick_get.py test_v2_studies_find_doi.py test_v2_studies_find_trees.py test_v2_studies_findall.py test_v2_studies_properties.py test_valid_study_put.py test_valid_study_put_multiformat.py test_valid_study_put_override_author.py
Running tests in ../../germinator/ws-tests/../../treemachine/ws-tests
...F........
Passed 11 out of 12 tests.
Failures:  test_mrca_400.py
Running tests in ../../germinator/ws-tests/../../taxomachine/ws-tests
.....Expected to find 5551856 in bad ids, found []
F........Arachnides not in context Animals
F.bad match return 409712, expected one of [5507594, 1058735, 643717, 515698]
F.s..resp.text = {
  "message" : "No taxa found with these OTT ids: [3895873]",
  "exception" : "BadInputException",
  "fullname" : "org.neo4j.server.rest.repr.BadInputException",
  "stacktrace" : [ "org.opentree.taxonomy.plugins.taxonomy_v3.mrca(taxonomy_v3.java:154)", "java.lang.reflect.Method.invoke(Method.java:498)", "org.neo4j.server.plugins.PluginMethod.invoke(PluginMethod.java:57)", "org.neo4j.server.plugins.PluginManager.invoke(PluginManager.java:168)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:300)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "java.lang.reflect.Method.invoke(Method.java:498)", "org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)" ]
}
Traceback (most recent call last):
  File "/Users/jar/a/ot/repo/germinator/ws-tests/check.py", line 18, in simple_test
    return_bool_data=True)
  File "/Users/jar/a/ot/repo/germinator/ws-tests/opentreetesting.py", line 176, in test_http_json_method
    raise_for_status(resp)
  File "/Users/jar/a/ot/repo/germinator/ws-tests/opentreetesting.py", line 209, in raise_for_status
    raise e
HTTPError: 400 Client Error: Bad Request
F.F..........Arachnides not in context Animals
F...
Passed 31 out of 38 tests.
An 's' means a test was skipped.
Skipped 1 tests.
Failures:  test_v2_taxonomy_lica_bad_taxon.py test_v2_tnrs_contexts.py test_v2_tnrs_match_names.py test_v3_taxonomy_mrca.py test_v3_taxonomy_mrca_bad_taxon.py test_v3_tnrs_contexts.py
Running tests in ../../germinator/ws-tests/../../oti/ws-tests
....Traceback (most recent call last):
  File "test_v3_vs_oti_properties.py", line 34, in <module>
    assert otindex_result == oti_result
NameError: name 'otindex_result' is not defined
F
Passed 4 out of 5 tests.
Failures:  test_v3_vs_oti_properties.py
Running tests in ../../germinator/ws-tests/../../reference-taxonomy/ws-tests
..
Passed 2 out of 2 tests.
(ve)bash-3.2$ 
bredelings commented 6 years ago

Hey Jonathan,

I'm still not getting any errors. I don't know where the errors are coming from. What do they mean? To me they look like python errors, not errors in any actual services.

-BenRI

jar398 commented 6 years ago

Sorry about that. I got burned by a python misfeature that has burned me before: if you say import x, and there's a file x.pyc, it loads x.pyc - even if there's a more recent x.py in the same directory. I deleted opentreetesting.pyc in the phylesystem-api repo, and now the tests work.