Browse Source

Add JSON coverage report format

pull/1331/head
Ross McFarland 3 weeks ago
parent
commit
287dd83273
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
3 changed files with 19 additions and 13 deletions
  1. +4
    -0
      .changelog/7f722301e34140f7bbf0b4126709342d.md
  2. +1
    -0
      .gitignore
  3. +14
    -13
      script/coverage

+ 4
- 0
.changelog/7f722301e34140f7bbf0b4126709342d.md View File

@ -0,0 +1,4 @@
---
type: none
---
Add JSON coverage report format

+ 1
- 0
.gitignore View File

@ -5,6 +5,7 @@
/build/
/config/
.coverage
coverage.json
coverage.xml
dist/
docs/_build/


+ 14
- 13
script/coverage View File

@ -12,19 +12,20 @@ PRAGMA_OUTPUT=$(grep -r -I --line-number "# pragma: \+no.*cover" "$SOURCE_DIR" |
PRAGMA_COUNT=$(echo "$PRAGMA_OUTPUT" | grep -c . || true)
PRAGMA_ALLOWED=5
if [ "$PRAGMA_COUNT" -ne "$PRAGMA_ALLOWED" ]; then
echo "Found $PRAGMA_COUNT instances of 'pragma: no cover' (no more than $PRAGMA_ALLOWED allowed):"
echo "$PRAGMA_OUTPUT"
echo "Code coverage should not be disabled, except for version handling blocks"
exit 1
echo "Found $PRAGMA_COUNT instances of 'pragma: no cover' (no more than $PRAGMA_ALLOWED allowed):"
echo "$PRAGMA_OUTPUT"
echo "Code coverage should not be disabled, except for version handling blocks"
exit 1
fi
pytest \
--disable-network \
--cov-reset \
--cov=$SOURCE_DIR \
--cov-fail-under=100 \
--cov-report=html \
--cov-report=xml \
--cov-report=term \
--cov-branch \
"$@"
--disable-network \
--cov-reset \
--cov=$SOURCE_DIR \
--cov-fail-under=100 \
--cov-report=html \
--cov-report=json \
--cov-report=xml \
--cov-report=term \
--cov-branch \
"$@"

Loading…
Cancel
Save