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

Set DJANGO_SETTINGS_MODULE before the tests #4

Merged
merged 1 commit into from Feb 9, 2018

Conversation

Projects
None yet
3 participants
@joshmoore

joshmoore commented Feb 9, 2018

Tested with:

git clone -b django_tests git://github.com/will-moore/figure omero-figure # name is important!
cd omero-figure
git clone git://github.com/openmicroscopy/omero-test-infra .omero # name is important!
.omero/docker app

I still had a few regular failures, but those are assertions for @will-moore to look at.

@will-moore

This comment has been minimized.

Show comment
Hide comment
@will-moore

will-moore Feb 9, 2018

Owner

I get....

==================================== ERRORS ====================================
___________ ERROR collecting test/integration/test_figure_scripts.py ___________
import file mismatch:
imported module 'test_figure_scripts' has this __file__ attribute:
  /Users/wmoore/Desktop/FIGURE/figure/test/integration/test_figure_scripts.py
which is not the same as the test file we want to collect:
  /omero-figure/test/integration/test_figure_scripts.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.20 seconds ============================

Tried $ rm -rf __pycache__/ but got same error...

Owner

will-moore commented Feb 9, 2018

I get....

==================================== ERRORS ====================================
___________ ERROR collecting test/integration/test_figure_scripts.py ___________
import file mismatch:
imported module 'test_figure_scripts' has this __file__ attribute:
  /Users/wmoore/Desktop/FIGURE/figure/test/integration/test_figure_scripts.py
which is not the same as the test file we want to collect:
  /omero-figure/test/integration/test_figure_scripts.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.20 seconds ============================

Tried $ rm -rf __pycache__/ but got same error...

@will-moore

This comment has been minimized.

Show comment
Hide comment
@will-moore

will-moore Feb 9, 2018

Owner

That was after adding a new-line at end of file test/integration/test_figure_files.py which was the original flake8 error.

Owner

will-moore commented Feb 9, 2018

That was after adding a new-line at end of file test/integration/test_figure_files.py which was the original flake8 error.

@joshmoore

This comment has been minimized.

Show comment
Hide comment
@joshmoore

joshmoore Feb 9, 2018

Are you running in docker or locally? If the latter, then try: find . -name __pycache__

joshmoore commented Feb 9, 2018

Are you running in docker or locally? If the latter, then try: find . -name __pycache__

@will-moore

This comment has been minimized.

Show comment
Hide comment
@will-moore

will-moore Feb 9, 2018

Owner

I'm running $ .omero/docker app locally.

$ find . -name __pycache__
./test/integration/__pycache__
$ rm -rf ./test/integration/__pycache__
$ .omero/docker app
...
========================== 5 failed in 13.34 seconds ===========================

So the tests are running now, Thanks.
But it takes a few minutes to run each time, so debugging might take a while.

Owner

will-moore commented Feb 9, 2018

I'm running $ .omero/docker app locally.

$ find . -name __pycache__
./test/integration/__pycache__
$ rm -rf ./test/integration/__pycache__
$ .omero/docker app
...
========================== 5 failed in 13.34 seconds ===========================

So the tests are running now, Thanks.
But it takes a few minutes to run each time, so debugging might take a while.

@will-moore

This comment has been minimized.

Show comment
Hide comment
@will-moore

will-moore Feb 9, 2018

Owner

The scripts tests are failing because the scripts aren't found

        id = super(TestFigureScripts, self).get_script_by_name(path, name)
>       assert id > 0
E       assert -1 > 0

But even if I use

$ .omero/docker app scripts

it still fails, possibly because I need @jburel's branch of omero-test-infra?

Owner

will-moore commented Feb 9, 2018

The scripts tests are failing because the scripts aren't found

        id = super(TestFigureScripts, self).get_script_by_name(path, name)
>       assert id > 0
E       assert -1 > 0

But even if I use

$ .omero/docker app scripts

it still fails, possibly because I need @jburel's branch of omero-test-infra?

@jburel

This comment has been minimized.

Show comment
Hide comment
@jburel

jburel Feb 9, 2018

the branch has been merged

jburel commented Feb 9, 2018

the branch has been merged

@will-moore

This comment has been minimized.

Show comment
Hide comment
@will-moore

will-moore Feb 9, 2018

Owner

My test is failing with

        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

Normally to debug that, I would go into omeroweb/testlib/__init__.py and add

print rsp

right before the assertion so I can see the error message.
But I guess that's not an option in this setup?

Owner

will-moore commented Feb 9, 2018

My test is failing with

        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

Normally to debug that, I would go into omeroweb/testlib/__init__.py and add

print rsp

right before the assertion so I can see the error message.
But I guess that's not an option in this setup?

@will-moore will-moore merged commit 36d8056 into will-moore:django_tests Feb 9, 2018

@will-moore will-moore referenced this pull request Feb 12, 2018

Merged

Django tests #270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment