Skip to content

Commit

Permalink
tweak coverage report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
AdeelH committed May 2, 2024
1 parent f36c1c2 commit 86295f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
-v "$(pwd):/opt/src" \
--rm -t \
"raster-vision-${IMAGE_TYPE}" \
coverage xml
coverage xml --omit=/opt/data/* --skip-empty
;;
*)
echo "Invalid argument. Run --help for usage."
Expand All @@ -67,7 +67,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
./scripts/integration_tests

# Create new coverage reports
coverage xml
coverage xml --omit=/opt/data/* --skip-empty
fi
fi
fi
3 changes: 2 additions & 1 deletion scripts/unit_tests
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ else
if ! [ -x "$(command -v coverage)" ]; then
python -m unittest discover -t "$SRC_DIR" tests -vf
else
coverage run -m unittest discover -t "$SRC_DIR" tests -vf && coverage html
coverage run -m unittest discover -t "$SRC_DIR" tests -vf && \
coverage html --omit=/opt/data/* --skip-empty --precision=2
fi
fi
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ coverage run -m unittest discover -t . tests -vf

Generate an HTML report from the `.coverage` file:
```sh
coverage html
coverage html --omit=/opt/data/* --skip-empty --precision=2
```

See `coverage help` for other available report formats.

0 comments on commit 86295f8

Please sign in to comment.