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

problems testing locally #203

Closed
snacktavish opened this issue Oct 9, 2016 · 12 comments
Closed

problems testing locally #203

snacktavish opened this issue Oct 9, 2016 · 12 comments

Comments

@snacktavish
Copy link
Member

I think this is a problem with my local phylesystem-api web2py setup, as these all pass running against devapi, but when I an running phylesystem-api (master) on my machine, I set my test.conf to local, (apihost = http://127.0.0.1:8000) some tests pass, e.g. test_api_root.py, test_study_get.py run fine, which suggests my setup is at least partially ok, but most fail.

../../germinator/ws-tests/run_tests.sh -t . http://127.0.0.1:8000

Failures: test_amendment_get_404.py test_amendment_list.py test_collection_get_404.py test_collection_list.py test_external_url.py test_v2_studies_findall.py test_v2_studies_find_doi.py test_v2_studies_find_trees.py test_v2_studies_properties.py

For example:
python test_amendment_list.py
testing-harness: Sent GET to http://127.0.0.1:8000/v3/amendments/list_all
testing-harness: Got status code 400 (expecting 200)
testing-harness: Did not get expected response status. Got:
400
testing-harness: Full response:

invalid request


resp.text =

invalid request


Traceback (most recent call last):
File "test_amendment_list.py", line 9, in
return_bool_data=True)
File "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 176, in test_http_json_method
raise_for_status(resp)
File "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 209, in raise_for_status
raise e
requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST

Any ideas about what I am doing wrong?

@jimallman
Copy link
Member

Sanity check: Is your peyotl up to date?

@jimallman
Copy link
Member

Also, you might need to update the local mini_* data repos as described here.

@jar398
Copy link
Member

jar398 commented Oct 9, 2016 via email

@jar398
Copy link
Member

jar398 commented Oct 9, 2016 via email

@jar398
Copy link
Member

jar398 commented Oct 9, 2016 via email

@snacktavish
Copy link
Member Author

Thanks @jimallman I did double check peyotl, and it's up-to-date and on master, as is phylesystem-api. And removing and replacing the mini system didn't help.

@jar398's idea about the translation makes sense to me, but adding host:translate=true didn't fix anything.

Also - on the new fix-translations branch no tests pass

Traceback (most recent call last):
File "test_xml_study_create_delete.py", line 2, in
from opentreetesting import test_http_json_method, config, exit_if_api_is_readonly, get_obj_from_http
File "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 278, in
('/v3/conflict/', '/v3/')
TypeError: 'tuple' object is not callable
F
Passed 0 out of 31 tests.

I'll hop on gitter on Monday, I suspect I'm missing something obvious!

@jar398
Copy link
Member

jar398 commented Oct 9, 2016

Unlikely that it's your error. As I said, I didn't test that branch; I'm enlisting your help in doing so.

When python says "object is not callable" that often means there's a comma missing.
Indeed I left out a comma, so you might try pulling that branch again.

@snacktavish
Copy link
Member Author

Ah ya, I recognized that about the fix-translations branch, but I meant I suspect I have something potentially obvious wrong in my web2py configuration. Pulling the new version of fix-translations brings me back to 9/31 tests passing.

@jar398
Copy link
Member

jar398 commented Oct 10, 2016

OK, so we have two hypotheses, one having to do with your web2py configuration, the other having to do with translations and opentreetesting.py. Happy to help work through this with you tomorrow.

@snacktavish
Copy link
Member Author

as far as I can tell, no one has it testing locally working currently, so I will test on devapi if needed.

@jar398
Copy link
Member

jar398 commented Oct 27, 2016

I have reported what I believe to be the underlying problem here: OpenTreeOfLife/germinator#117

@snacktavish
Copy link
Member Author

Ok! Getting there! if I haev germinator on issue-117, and everything else on master. I run:

../../germinator/ws-tests/run_tests.sh -t . host:translate=true host:apihost=http://127.0.0.1:8000

I still have two tests failing.

...resp.text = <html><body><h1>invalid request</h1></body></html>
Traceback (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 "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 176, in test_http_json_method
    raise_for_status(resp)
  File "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 209, in raise_for_status
    raise e
requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: http://127.0.0.1:8000/v2/collection/nonexistentuser/fake-id
Fresp.text = <html><body><h1>invalid request</h1></body></html>
Traceback (most recent call last):
  File "test_collection_list.py", line 10, in <module>
    return_bool_data=True)
  File "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 176, in test_http_json_method
    raise_for_status(resp)
  File "/home/ejmctavish/projects/otapi/germinator/ws-tests/opentreetesting.py", line 209, in raise_for_status
    raise e
requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: http://127.0.0.1:8000/v2/collections/find_collections
Fs..sssssss.....s......ssss
Passed 16 out of 31 tests.
An 's' means a test was skipped.
Skipped 13 tests.
Failures:  test_collection_get_404.py test_collection_list.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants