diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-23 16:17:05 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-03-23 16:17:05 +0800 |
commit | 876071cc5fdfee08ad7790c736f8443db6e0b298 (patch) | |
tree | eb912aa284cc494d92dec831d44de70259b212b9 | |
parent | 34e12d9aa0e7cc9baeba6de454fbce00ae627aea (diff) |
make unittest execution more user-friendly
allow users use their existed venv
manage all test-related libs in test-requirements.txt
Change-Id: I39a63833e4a1f4f088afa045a83bf12cd01da167
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
-rwxr-xr-x | utils/test/testapi/run_test.sh | 14 | ||||
-rw-r--r-- | utils/test/testapi/test-requirements.txt | 5 |
2 files changed, 9 insertions, 10 deletions
diff --git a/utils/test/testapi/run_test.sh b/utils/test/testapi/run_test.sh index 4efc7af3b..1e05dd6ba 100755 --- a/utils/test/testapi/run_test.sh +++ b/utils/test/testapi/run_test.sh @@ -8,15 +8,17 @@ SCRIPTDIR=`dirname $0` echo "Running unit tests..." # Creating virtual environment -virtualenv $SCRIPTDIR/testapi_venv -source $SCRIPTDIR/testapi_venv/bin/activate +if [ ! -z $VIRTUAL_ENV ]; then + venv=$VIRTUAL_ENV +else + venv=$SCRIPTDIR/.venv + virtualenv $venv +fi +source $venv/bin/activate # Install requirements pip install -r $SCRIPTDIR/requirements.txt -pip install coverage -pip install nose>=1.3.1 -pip install pytest -pip install mock +pip install -r $SCRIPTDIR/test-requirements.txt find . -type f -name "*.pyc" -delete diff --git a/utils/test/testapi/test-requirements.txt b/utils/test/testapi/test-requirements.txt index 4633ad637..645687b14 100644 --- a/utils/test/testapi/test-requirements.txt +++ b/utils/test/testapi/test-requirements.txt @@ -2,10 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -tox mock pytest -pytest-cov coverage -pykwalify -pip_check_reqs +nose>=1.3.1 |