summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/run-backend-api-tests.sh
diff options
context:
space:
mode:
authoralfonsomthd <almartin@redhat.com>2019-03-08 17:35:34 +0100
committeralfonsomthd <almartin@redhat.com>2019-03-08 17:35:34 +0100
commitda52919f69e332b3f25fff1d22ffdf83f7a62420 (patch)
treeff918415f93ce582bad0d9a713f8b129e84922f8 /src/pybind/mgr/dashboard/run-backend-api-tests.sh
parentMerge PR #26823 into master (diff)
downloadceph-da52919f69e332b3f25fff1d22ffdf83f7a62420.tar.xz
ceph-da52919f69e332b3f25fff1d22ffdf83f7a62420.zip
mgr/dashboard: enable coverage for API tests
* Fixed: install in system the 'coverage' version set in requirements.txt as dashboard/module.py uses system version. * Updated 'coverage' to latest stable version. * Added teuthology missing dependency: backports.ssl-match-hostname * More precise coverage measurement through CherryPy Bus API. * Coverage report shown when no ceph-mgr running (cleanup_teuthology). Fixes: https://tracker.ceph.com/issues/36176 Signed-off-by: Alfonso Martínez <almartin@redhat.com>
Diffstat (limited to '')
-rwxr-xr-xsrc/pybind/mgr/dashboard/run-backend-api-tests.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/pybind/mgr/dashboard/run-backend-api-tests.sh b/src/pybind/mgr/dashboard/run-backend-api-tests.sh
index 630adac9e0a..9a3a47fe763 100755
--- a/src/pybind/mgr/dashboard/run-backend-api-tests.sh
+++ b/src/pybind/mgr/dashboard/run-backend-api-tests.sh
@@ -33,6 +33,7 @@ setup_teuthology() {
read -r -d '' TEUTHOLOGY_PY_REQS <<EOF
apache-libcloud==2.2.1 \
asn1crypto==0.22.0 \
+backports.ssl-match-hostname==3.5.0.1 \
bcrypt==3.1.4 \
certifi==2018.1.18 \
cffi==1.10.0 \
@@ -89,10 +90,14 @@ EOF
fi
fi
-# export COVERAGE_ENABLED=true
-# export COVERAGE_FILE=.coverage.mgr.dashboard
-
cd $CURR_DIR
+
+ COVERAGE_VERSION=$(cat requirements.txt | grep coverage)
+ if [[ "$CEPH_MGR_PY_VERSION_MAJOR" == '3' ]]; then
+ pip3 install "$COVERAGE_VERSION"
+ else
+ pip install "$COVERAGE_VERSION"
+ fi
}
run_teuthology_tests() {
@@ -121,6 +126,10 @@ run_teuthology_tests() {
export RGW=1
fi
+ export COVERAGE_ENABLED=true
+ export COVERAGE_FILE=.coverage.mgr.dashboard
+ find . -iname "*${COVERAGE_FILE}*" -type f -delete
+
eval python ../qa/tasks/vstart_runner.py $OPTIONS $TEST_CASES
deactivate
@@ -131,6 +140,11 @@ cleanup_teuthology() {
cd "$BUILD_DIR"
killall ceph-mgr
sleep 10
+ if [[ "$COVERAGE_ENABLED" == 'true' ]]; then
+ source $TEMP_DIR/venv/bin/activate
+ (coverage combine && coverage report) || true
+ deactivate
+ fi
../src/stop.sh
sleep 5