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 unit tests #10

Merged
merged 35 commits into from
Aug 30, 2019
Merged

Fix unit tests #10

merged 35 commits into from
Aug 30, 2019

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Aug 29, 2019

Work in progress...
Teaching tests to skip if they need OMERODIR to run and it isn't set.
Or to skip permanently if they need omero.db.version etc from etc/properties since this is no-longer stored there.

TODO:

  • add unit/clitest/test_web.py back to omero-web
  • add testParseAllOfficialScripts to scripts

@will-moore
Copy link
Member Author

Travis fails with

�[0m�[91m  File "build/bdist.linux-x86_64/egg/setuptools_scm/version.py", line 66, in _warn_if_setuptools_outdated
setuptools_scm.version.SetuptoolsOutdatedWarning: your setuptools is too old (<12)
�[0mThe command '/bin/sh -c python setup.py test -t test/unit/clitest/test_admin.py' returned a non-zero code: 1
travis_time:end:21992406:start=1567075416842251391,finish=1567075466520498546,duration=49678247155

src/omero/cli.py Outdated
@@ -718,7 +718,8 @@ def add_error(self, name, rcode, msg):
"""
err = self.__errors.get(name)
if err is not None:
self.ctx.die(2, "Error already exists: %s (%s)" % (name, err))
# self.ctx.die(, "Error already exists: %s (%s)" % (name, err))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just be careful with this one ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops - I commented that out to get tests passing locally but am not sure why it's failing or what use case it's expected to handle?

@will-moore
Copy link
Member Author

Seems tests aren't actually being run:

travis_time:start:1297c8a8
�[0K$ omero version
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
5.5.dev2
travis_time:end:1297c8a8:start=1567111871166146818,finish=1567111871934041033,duration=767894215
�[0K�[32;1mThe command "omero version" exited with 0.�[0m

@will-moore
Copy link
Member Author

Hmmm - I thought the my "fix" at d0ec9b7 got Travis green, but it seems that what's changed is using omero-py is now 5.5.dev2 and doesn't seem to be running any tests:

travis_time:end:010c7d34:start=1567098312805210960,finish=1567098316678854937,duration=3873643977
�[0K�[32;1mThe command "pip install dist/omero-py*gz" exited with 0.�[0m

travis_time:start:08a3b79f
�[0K$ python -c "import omero_version; print omero_version.omero_version"
5.5.dev2
travis_time:end:08a3b79f:start=1567098316683713765,finish=1567098316698668337,duration=14954572
�[0K�[32;1mThe command "python -c "import omero_version; print omero_version.omero_version"" exited with 0.�[0m

travis_time:start:162ef345
�[0K$ omero version
ERROR:omero.gateway:No Pillow installed, line plots and split channel will fail!
5.5.dev2
travis_time:end:162ef345:start=1567098316704668009,finish=1567098317509253858,duration=804585849
�[0K�[32;1mThe command "omero version" exited with 0.�[0m

@@ -183,16 +181,16 @@ def testGroupingWithMainExtraDot(self):
assert "belong" == groupings["A"]["2"], str(groupings)
assert "together" == groupings["A"]["3"], str(groupings)

def testParseAllOfficialScripts(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be migrated to scripts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshmoore
Copy link
Member

============= 786 passed, 134 skipped, 1 xfailed in 43.92 seconds ==============

Merging so that other PRs will start getting the benefit of the tests. Thanks, @will-moore !

@joshmoore joshmoore merged commit 73f4d27 into ome:master Aug 30, 2019
joshmoore added a commit to joshmoore/omero-scripts that referenced this pull request Sep 2, 2019
joshmoore added a commit to joshmoore/omero-scripts that referenced this pull request Sep 2, 2019
sbesson added a commit to sbesson/omero-py that referenced this pull request Oct 5, 2020
snoopycrimecop pushed a commit to snoopycrimecop/omero-py that referenced this pull request Apr 1, 2021
This should replace the wait.sh-stype scripts that exist in
multiple (especially docker) repositories.

Example output:

```
    $ omero sessions login -w omero root@localhost --retry=100
    Previous session expired for root on localhost:4064
    09:41:30.959913: Login retry ome#1 in 3s
    09:41:33.977181: Login retry ome#2 in 3s
    ...
    09:41:58.129038: Login retry ome#10 in 3s
    WARNING:omero.client:None - createSession retry: 1
    WARNING:omero.client:None - createSession retry: 2
    09:42:17.100098: Login retry ome#11 in 3s
    Created session for root@localhost:4064. Idle timeout: 10 min. Current group: system
````

see: https://github.com/ome/omero-server-docker/blob/master/test_login.sh
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

Successfully merging this pull request may close these issues.

2 participants