forked from fabric8-analytics/fabric8-gemini-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.sh
executable file
·45 lines (39 loc) · 1.25 KB
/
runtests.sh
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
43
44
45
#!/usr/bin/bash -ex
gc() {
retval=$?
docker-compose -f docker-compose.yml down -v || :
exit $retval
}
trap gc EXIT SIGINT
# Enter local-setup/ directory
# Run local instances for: dynamodb, gremlin-websocket, gremlin-http
function start_gemini_service {
#pushd local-setup/
echo "Invoke Docker Compose services"
docker-compose -f docker-compose.yml up --force-recreate -d
#popd
}
start_gemini_service
export PYTHONPATH=`pwd`/src
echo "Create Virtualenv for Python deps ..."
function prepare_venv() {
VIRTUALENV=`which virtualenv`
if [ $? -eq 1 ]; then
# python34 which is in CentOS does not have virtualenv binary
VIRTUALENV=`which virtualenv-3`
fi
${VIRTUALENV} -p python3 venv && source venv/bin/activate
}
prepare_venv
pip3 install -r requirements.txt
pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-worker.git@561636c
export DEPLOYMENT_PREFIX="${USER}"
export WORKER_ADMINISTRATION_REGION=api
export SENTRY_DSN=''
export PYTHONDONTWRITEBYTECODE=1
export POSTGRESQL_USER='coreapi'
export POSTGRESQL_PASSWORD='coreapi'
export POSTGRESQL_DATABASE='coreapi'
export PGBOUNCER_SERVICE_HOST='coreapi-pgbouncer'
python3 `which pytest` --cov=src/ --cov-report term-missing -vv tests/
rm -rf venv/