Skip to content

Commit

Permalink
add coverage (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
reschandreas authored Mar 15, 2024
1 parent 0c78207 commit acd71f8
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 111 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/python-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,21 @@ jobs:
run: |
cd cli
python -m unittest
- name: Generate coverage report
run: |
cd cli
coverage run -m unittest discover
coverage json
test_coverage=$(jq ".totals.percent_covered" coverage.json)
echo "Coverage: $test_coverage"
if [ $test_coverage -lt 65 ]; then
echo "Coverage is less than 65%"
exit 1
fi
# Add this
- name: Update Coverage Badge
# GitHub actions: default branch variable
# https://stackoverflow.com/questions/64781462/github-actions-default-branch-variable
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: we-cli/coverage-badge-action@main

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/python,intellij,pycharm,macos,linux,windows
# End of https://www.toptal.com/developers/gitignore/api/python,intellij,pycharm,macos,linux,windows

coverage.svg
coverage.json
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
![tests](https://github.com/ls1intum/Aeolus/actions/workflows/python-unit-tests.yaml/badge.svg)
![containers](https://github.com/ls1intum/Aeolus/actions/workflows/build-and-push.yaml/badge.svg)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
![coverage](https://github.com/ls1intum/Aeolus/badges/coverage.svg)

On how to use Aeolus, please refer to the [documentation](https://ls1intum.github.io/Aeolus/).

Expand Down
5 changes: 0 additions & 5 deletions cli/migration/.gitignore

This file was deleted.

104 changes: 0 additions & 104 deletions cli/migration/extract_bamboo_plans.py

This file was deleted.

2 changes: 2 additions & 0 deletions cli/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ types-requests
urllib3
python-jenkins
Jinja2>=3.1.3
coverage
coverage-badge
6 changes: 5 additions & 1 deletion cli/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ click==8.1.6
# black
# pip-tools
coverage==7.3.0
# via
# -r requirements.in
# coverage-badge
coverage-badge==1.1.0
# via -r requirements.in
datamodel-code-generator==0.21.4
# via -r requirements.in
Expand All @@ -40,7 +44,7 @@ genson==1.2.2
# via datamodel-code-generator
gitdb==4.0.10
# via gitpython
gitpython==3.1.41
gitpython==3.1.42
# via -r requirements.in
idna==3.4
# via
Expand Down

0 comments on commit acd71f8

Please sign in to comment.