diff options
author | 2016-11-16 18:16:43 +0100 | |
---|---|---|
committer | 2016-11-17 09:27:08 +0100 | |
commit | c850beb64083c730301188ade4cbba0f2a329a92 (patch) | |
tree | 19b241b8a85c463744cff8e4e40c8b4e3764475b /utils/test/reporting/run_unit_tests.sh | |
parent | 483081b7fb0cf5d7dec5ee1d6ff0bddc387a59dc (diff) |
Refactor reporting dir
- dockerization
- create util function for all the test projects
- create a common config files
- add unit tests
- pep8
JIRA: RELENG-162
Change-Id: Ib209be4233084100ff238a7aeb2843ccc24a6f1e
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'utils/test/reporting/run_unit_tests.sh')
-rwxr-xr-x | utils/test/reporting/run_unit_tests.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/utils/test/reporting/run_unit_tests.sh b/utils/test/reporting/run_unit_tests.sh new file mode 100755 index 000000000..6b0e3b2b1 --- /dev/null +++ b/utils/test/reporting/run_unit_tests.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -o errexit +set -o pipefail + +# ****************************** +# prepare the env for the tests +# ****************************** +# Either Workspace is set (CI) +if [ -z $WORKSPACE ] +then + WORKSPACE="." +fi + +export CONFIG_REPORTING_YAML=./reporting.yaml + +# *************** +# Run unit tests +# *************** +echo "Running unit tests..." + +# start vitual env +virtualenv $WORKSPACE/reporting_venv +source $WORKSPACE/reporting_venv/bin/activate + +# install python packages +easy_install -U setuptools +easy_install -U pip +pip install -r $WORKSPACE/docker/requirements.pip +pip install -e $WORKSPACE + +python $WORKSPACE/setup.py develop + +# unit tests +# TODO: remove cover-erase +# To be deleted when all functest packages will be listed +nosetests --with-xunit \ + --cover-package=utils \ + --with-coverage \ + --cover-xml \ + tests/unit +rc=$? + +deactivate |