-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathci_test.sh
43 lines (34 loc) · 1.47 KB
/
ci_test.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
#!/bin/bash -xe
# This is a hack. We are running in sudo, must start the virtualenv manually
if [ "${TRAVIS_PYTHON_VERSION:0:4}" == "pypy" ]; then
venv=${TRAVIS_PYTHON_VERSION}
else
venv=python${TRAVIS_PYTHON_VERSION}
fi
[ -f "/home/travis/virtualenv/${venv}/bin/activate" ] && source /home/travis/virtualenv/${venv}/bin/activate
python --version
coverage --version
# run in pypy , never run coverage
if [ "${TRAVIS_PYTHON_VERSION:0:4}" == "pypy" ]; then
python -m unittest discover
else
coverage run -m unittest discover
fi
cache_dir=`pwd`/cache
if [ "${TRAVIS_EVENT_TYPE}" == "cron" -o "${TRAVIS_EVENT_TYPE}" == "pull_request" -o "${TRAVIS_TAG:-}" != "" ]; then
python setup.py bdist_wheel
wget https://github.com/hubo1016/vlcp-controller-test/archive/master.tar.gz -O ./vlcp-controller-test.tar.gz
tar -xzvf vlcp-controller-test.tar.gz
cp dist/*.whl vlcp-controller-test-master/
pushd vlcp-controller-test-master/
if [ "${TRAVIS_PYTHON_VERSION:0:4}" == "pypy" ]; then
bash -xe starttest.sh "$venv" "${KV_DB}" "" "$cache_dir" "$ovs_version"
else
# only all integration test we will upload coverage file
# otherwise coverage line maybe zigzag because common commit
# will only run unittest
bash <(curl -s https://codecov.io/bash) -F unittests -e DB=${KV_DB}
bash -xe starttest.sh "$venv" "${KV_DB}" "coverage" "$cache_dir" "$ovs_version"
bash <(curl -s https://codecov.io/bash) -F integration -e DB=${KV_DB}
fi
fi