Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure coveralls for test workflow #55

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: [push, pull_request]
env:
DJANGO_SETTINGS_MODULE: gymkhana.settings
DJANGO_SECRET_KEY: "q$o5mx19x9(9_^rzqf@o@s^t%t!ghix7($f9ymy49_^ryzq9x9"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

jobs:
build:
Expand Down Expand Up @@ -53,4 +55,10 @@ jobs:
run: |
source "$(pipenv --venv)"/bin/activate
pip3 install coverage
coverage run --source='.' manage.py test
coverage run --branch manage.py test
# - name: Coveralls
# working-directory: ./src
# run: coveralls
- name: Codecov
working-directory: ./src
run: bash <(curl -s https://codecov.io/bash)
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ script:
- flake8 .
- python3 manage.py makemigrations
- python3 manage.py migrate
- coverage run manage.py test
#after_success:
# - coveralls
- coverage run --branch manage.py test
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion src/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ omit =
[report]
exclude_lines=
pragma: no cover
pragma: no use
pragma: no use
8 changes: 4 additions & 4 deletions src/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
import os
import sys

if __name__ == "__main__":
if __name__ == "__main__": # pragma: no branch
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gymkhana.settings")
try:
from django.core.management import execute_from_command_line
except ImportError: # pragma: no cover
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try: # pragma: no cover
try:
import django
except ImportError: # pragma: no cover
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise # pragma: no cover
raise
execute_from_command_line(sys.argv)