forked from ome/omero-mapr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntest
executable file
·42 lines (30 loc) · 1.23 KB
/
runtest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -e -u -x
SERVER_HOST=${SERVER_HOST:-"localhost"}
SERVER_PORT=${SERVER_PORT:-"4064"}
OMEROPATH=${OMEROPATH:-"${HOME}/OMERO.${COMPONENT}"}
maprsrcpath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# create virtualenv
virtualenv $HOME/omerovenv --system-site-packages
set +u
source $HOME/omerovenv/bin/activate
set -u
# instal OMERO.web prerequisites
pip install -r ${OMEROPATH}/share/web/requirements-py27-nginx.txt
# install mapr
pip install -e ${maprsrcpath}
${OMEROPATH}/bin/omero config set omero.web.apps '["omero_mapr"]'
${OMEROPATH}/bin/omero config set omero.web.server_list '[["'${SERVER_HOST}'", '${SERVER_PORT}', "'${SERVER_HOST}'"]]'
# prepare ice.config
sed -i "s/^\(omero\.host\s*=\s*\).*\$/\1$SERVER_HOST/" ${OMEROPATH}/etc/ice.config
sed -i "s/^\(omero\.port\s*=\s*\).*\$/\1$SERVER_PORT/" ${OMEROPATH}/etc/ice.config
# setup paths to OMERO.py
export PYTHONPATH=${OMEROPATH}/lib/python:${OMEROPATH}/lib/python/omeroweb:${PYTHONPATH:-}
export ICE_CONFIG=${OMEROPATH}/etc/ice.config
until ${OMEROPATH}/bin/omero login -s $SERVER_HOST -p $SERVER_PORT -u root -w omero ; do
>&2 echo "OMERO.server is unavailable - sleeping"
sleep 10
done
# run tests
(cd ${maprsrcpath} && python setup.py test)
#deactivate