Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OME, Go (omego)
===============

.. image:: https://github.com/ome/omego/actions/workflows/workflow.yml/badge.svg
.. image:: https://github.com/ome/omego/workflows/OMERO/badge.svg
:target: https://github.com/ome/omego/actions

.. image:: https://badge.fury.io/py/omego.svg
Expand All @@ -12,18 +12,6 @@ The omego command provides utilities for installing and managing OME application
Getting Started
---------------

For Python 2.6, you will need to install `argparse`_

::

$ pip install argparse

With that, it's possible to execute omego:

::

$ python omego/main.py

Pip installation
-----------------

Expand All @@ -43,5 +31,3 @@ Copyright
---------

2013-2026, The Open Microscopy Environment

.. _argparse: http://pypi.python.org/pypi/argparse
4 changes: 2 additions & 2 deletions ci-build
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ omego -h
#Install a new server without web
#Tests rely on a non-zero error code being returned on failure
if [ $TEST = install ]; then
export OMERODIR='./OMERO.server-5.6.4-ice36-b232'
omego install --initdb --dbhost localhost --dbname omero --prestartfile $HOME/config.omero -v --release 5.6.4 --ice 3.6 --no-web --no-start
export OMERODIR='./OMERO.server-5.6.17-ice36'
omego install --initdb --dbhost localhost --dbname omero --prestartfile $HOME/config.omero -v --release 5.6.17 --ice 3.6 --no-web --no-start

ls OMERO.server
# Should return 0 DB_UPTODATE
Expand Down
90 changes: 90 additions & 0 deletions test/integration/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

from __future__ import division
from past.utils import old_div
from builtins import object
import pytest # noqa

Expand All @@ -37,6 +38,79 @@ def download(self, *args):
main("omego", args=args, items=[("download", DownloadCommand)])


class TestDownloadJenkins(Downloader):

def setup_class(self):
self.artifact = 'java'
self.branch = 'OMERO-build'
self.ice = '3.6'

@pytest.mark.skipif(True, reason='URL to be updated')
def testDownloadNoUnzip(self, tmpdir):
with tmpdir.as_cwd():
self.download('--skipunzip', '--branch', self.branch,
'--ice', self.ice)
files = tmpdir.listdir()
assert len(files) == 1

@pytest.mark.skipif(True, reason='URL to be updated')
def testDownloadUnzip(self, tmpdir):
with tmpdir.as_cwd():
self.download('--branch', self.branch, '--ice', self.ice)
files = tmpdir.listdir()
assert len(files) == 2

@pytest.mark.skipif(True, reason='URL to be updated')
def testDownloadUnzipDir(self, tmpdir):
with tmpdir.as_cwd():
self.download('--unzipdir', 'OMERO.java', '--branch', self.branch,
'--ice', self.ice)
expected = old_div(tmpdir, 'OMERO.java')
assert expected.exists()
assert expected.isdir()

@pytest.mark.skipif(True, reason='URL to be updated')
def testDownloadSym(self, tmpdir):
with tmpdir.as_cwd():
self.download('--branch', self.branch, '--ice', self.ice,
'--sym', 'auto')
files = tmpdir.listdir()
assert len(files) == 3

expected = old_div(tmpdir, 'OMERO.java')
assert expected.exists()
assert expected.isdir()

# Part two, if an artifact already exists and is unzipped check
# that a new symlink is created if necessary
self.download('--branch', self.branch, '--ice', self.ice,
'--sym', 'custom.sym')
files2 = tmpdir.listdir()
files2diff = set(files2).symmetric_difference(files)
assert len(files2diff) == 1
sym2 = files2diff.pop()
assert sym2 == (old_div(tmpdir, 'custom.sym'))
assert sym2.isdir()

@pytest.mark.skipif(True, reason='URL to be updated')
def testDownloadBuildNumber(self):
# Old Jenkins artifacts are deleted so we can't download.
# Instead assert that an AttributeError is raised.
# This is not ideal since this error could occur for other reasons.
branch = self.branch + ':600'
with pytest.raises(AttributeError) as exc:
self.download('--branch', branch, '--ice', self.ice)
assert 'No artifacts' in exc.value.args[0]

def testDownloadList(self, tmpdir):
self.artifact = ''
self.branch = 'latest'
with tmpdir.as_cwd():
self.download('--branch', self.branch)
files = tmpdir.listdir()
assert len(files) == 0


class TestDownloadRelease(Downloader):

def setup_class(self):
Expand All @@ -52,3 +126,19 @@ def testDownloadRelease(self, tmpdir):
def testDownloadNonExistingArtifact(self):
with pytest.raises(AttributeError):
self.download('-n', '--release', '5.3', '--ice', '3.3')


class TestDownloadBioFormats(Downloader):

def setup_class(self):
self.branch = 'BIOFORMATS-build'

@pytest.mark.skipif(True, reason='URL to be updated')
def testDownloadJar(self, tmpdir):
self.artifact = 'formats-api'
with tmpdir.as_cwd():
self.download('--branch', self.branch)
files = tmpdir.listdir()
assert len(files) == 1
assert files[0].basename.endswith(".jar")
assert files[0].basename.startswith('formats-api')