Skip to content

Commit

Permalink
Report test coverage separately
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <mark.syms@citrix.com>
  • Loading branch information
MarkSymsCtx committed Jul 3, 2019
1 parent 9d38b5e commit 266391c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tests/run_python_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ fi
--xunit-file=nosetests.xml \
tests

# Handle coverage errors explicitly
set +e

echo "Test coverage"
coverage report -m --fail-under=100 --include=$SMROOT/tests/*

if [ $? -ne 0 ]
then
echo "Test code not fully covered"
exit 1
fi

set -e

echo "Code coverage"
OMITS="$SMROOT/tests/*,$SMROOT/.env/*,$SMROOT/tests/mocks/*"
for format in xml html report; do
coverage $format --include="$SMROOT/*" --omit="$SMROOT/.env/*,$SMROOT/tests/mocks/*"
coverage $format --include="$SMROOT/*" --omit=$OMITS
done
)

0 comments on commit 266391c

Please sign in to comment.