diff --git a/functionaltests/.coveragerc b/functionaltests/.coveragerc new file mode 100644 index 000000000..c829e628b --- /dev/null +++ b/functionaltests/.coveragerc @@ -0,0 +1,12 @@ +[run] +branch = True +source = ../barbican +omit = ../barbican/tests/*, + ../barbican/model/migration/alembic_migrations/versions/*, + ../barbican/plugin/dogtag.py, ../barbican/plugin/symantec.py + +[report] +ignore_errors = True +exclude_lines = + pragma: no cover + @abc.abstractmethod diff --git a/functionaltests/.testr.conf b/functionaltests/.testr.conf index ece7e9eac..c3547761a 100644 --- a/functionaltests/.testr.conf +++ b/functionaltests/.testr.conf @@ -3,7 +3,7 @@ test_command= OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \ - ${PYTHON:-python} -m subunit.run discover -s ./api -t . $LISTOPT $IDOPTION + ${PYTHON:-python} -m coverage run -a -m subunit.run discover -s ./api -t . $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/functionaltests/pretty_tox.sh b/functionaltests/pretty_tox.sh index 83df3a9d5..d686b5b9e 100644 --- a/functionaltests/pretty_tox.sh +++ b/functionaltests/pretty_tox.sh @@ -3,8 +3,8 @@ set -o pipefail TESTRARGS=$1 -python setup.py testr --testr-args="--subunit $TESTRARGS" | subunit-trace --no-failure-debug -f +python setup.py testr --coverage --testr-args="--subunit $TESTRARGS" | subunit-trace --no-failure-debug -f retval=$? echo -e "\nSlowest Tests:\n" testr slowest -exit $retval \ No newline at end of file +exit $retval diff --git a/functionaltests/run_tests.sh b/functionaltests/run_tests.sh index 4893e1fb3..35cc11e33 100755 --- a/functionaltests/run_tests.sh +++ b/functionaltests/run_tests.sh @@ -28,6 +28,9 @@ testr run --subunit | subunit-trace --no-failure-debug -f retval=$? testr slowest +coverage combine +coverage report -m + # run the tests in parallel SKIP=^\(\?\!\.\*\(ProjectQuotasPagingTestCase\|QuotaEnforcementTestCase\|ListingCAsTestCase\|ProjectCATestCase\|GlobalPreferredCATestCase\|CertificateAuthoritiesTestCase\)\) testr init @@ -35,4 +38,7 @@ testr run $SKIP --parallel --subunit | subunit-trace --no-failure-debug -f retval=$(($retval || $?)) testr slowest +coverage combine +coverage report -m + exit $retval