Closed will-moore closed 6 years ago
./test/integration/test_figure_files.py:57:29: W292 no newline at end of file
========================== 5 failed in 11.61 seconds ===========================
Scripts tests are failing because scripts are not being copied over
id = super(TestFigureScripts, self).get_script_by_name(path, name)
> assert id > 0
E assert -1 > 0
My Django test is failing with
rsp = get(django_client, request_url, data, status_code, csrf)
> assert rsp.get('Content-Type') == 'application/json'
E AssertionError
but as I mentioned at https://github.com/will-moore/figure/pull/4#issuecomment-364456120 debugging this isn't so straight-forward given this test setup...
app-build
implies that the tests are now run when executing docker app
. At that stage, the scripts have not copied. Copying the script will not solve the issueapp
and some under script
. @jburel : will splitting the tests into subdirectories (or adding a @pytest.mark
) help?
@joshmoore that was my next step to see what can be done at the tests level
This looks like it's working. One test still failing but I think that's for @will-moore :
django_client = <django.test.client.Client object at 0x6e66310>
request_url = '/figure/list_web_figures/', data = None, status_code = 200
csrf = False
def get_json(django_client, request_url, data=None, status_code=200,
csrf=False):
"""
Performs a GET request and returns the JSON response as a dict.
:param django_client: Django test Client
:param request_url: The url to request
:param data: A dictionary of data, used to build a query string
:param status_code: Verify that the response has this status
:param csrf: If true, add csrf token to query string
"""
rsp = get(django_client, request_url, data, status_code, csrf)
> assert rsp.get('Content-Type') == 'application/json'
E AssertionError
/opt/omero/web/OMERO.web/lib/python/omeroweb/testlib/__init__.py:362: AssertionError
------------------------------ Captured log setup ------------------------------
views.py 104 INFO INIT '455'
settings.py 885 INFO Processing custom settings for module omeroweb.api.api_settings
__init__.py 2209 INFO created connection (uuid=c52a8abf-68e3-4362-a20a-e00789e895f1)
connector.py 229 INFO Client version: '['5', '4', '3']'; Server version: '['5', '4', '3']'
__init__.py 2209 INFO created connection (uuid=64a0d3c6-5c72-4381-a5e9-9702e201f98c)
upgrade_check.py 148 INFO no update needed
__init__.py 2209 INFO created connection (uuid=53a44b34-cb35-4ad5-8631-fdf97de12c99)
connector.py 229 INFO Client version: '['5', '4', '3']'; Server version: '['5', '4', '3']'
__init__.py 2209 INFO created connection (uuid=a09ce5b0-f17d-4ac3-92c6-7297b69e70b8)
upgrade_check.py 148 INFO no update needed
------------------------------ Captured log call -------------------------------
__init__.py 2209 INFO created connection (uuid=854bf328-dbf0-4170-a9c6-59545f969836)
connector.py 229 INFO Client version: '['5', '4', '3']'; Server version: '['5', '4', '3']'
__init__.py 2209 INFO created connection (uuid=a320847d-fa01-469b-ba66-1d1d2aaea9b9)
upgrade_check.py 148 INFO no update needed
__init__.py 2209 INFO created connection (uuid=a320847d-fa01-469b-ba66-1d1d2aaea9b9)
---------------------------- Captured log teardown -----------------------------
__init__.py 2209 INFO created connection (uuid=64a0d3c6-5c72-4381-a5e9-9702e201f98c)
__init__.py 1922 INFO closed connecion (uuid=64a0d3c6-5c72-4381-a5e9-9702e201f98c)
__init__.py 2209 INFO created connection (uuid=a09ce5b0-f17d-4ac3-92c6-7297b69e70b8)
__init__.py 1922 INFO closed connecion (uuid=a09ce5b0-f17d-4ac3-92c6-7297b69e70b8)
__init__.py 2209 INFO created connection (uuid=a320847d-fa01-469b-ba66-1d1d2aaea9b9)
__init__.py 1922 INFO closed connecion (uuid=a320847d-fa01-469b-ba66-1d1d2aaea9b9)
===================== 1 failed, 4 passed in 27.40 seconds ======================
Travis is now green. Suggested merging workflow
travis.yml
and merge this PR (see e4cbfb4)
Looked at adding Django-based tests but this will clearly take a lot more setup than I am familiar with just now. E.g. need to do similar to https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/setup.py#L24
Currently failing locally with