Skip to content

Commit

Permalink
[DONE] FIX Coveralls (#1124)
Browse files Browse the repository at this point in the history
Fix the Coveralls bug preventing coverage being analysed
* Add workflow_dispatch, so that pod_dev github action can be run manually.
* Save coverage report as cobertura.xml
* remove 'source' in coverage call
  • Loading branch information
Badatos authored May 14, 2024
1 parent 2de73fa commit 0c7ac26
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

[report]
# Here you can exclude a file from coverage testing

# nb: you can also add a "# pragma: no cover"
# on each function you don't want to be covered
[run]
source = pod/
relative_files = True
source = .
# Here you can exclude a file from coverage testing
omit = pod/*settings*.py
pod/custom/settings*.py
pod/*apps.py
pod/wsgi.py
pod/db_migrations/*
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/code_formatting.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
name: Code Formatting
run-name: ${{ github.actor }} is running Pod code formatting 🎨

on:
push:
branches: [master, develop]
workflow_dispatch:

jobs:
code-formatting:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/pod_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
pull_request:
branches:
- develop
workflow_dispatch:

env:
PYTHON_VERSION: '3.9'
Expand Down Expand Up @@ -106,7 +107,7 @@ jobs:
docker exec pod-back-with-volumes ps auxf
docker exec pod-back-with-volumes python manage.py loaddata pod/video/fixtures/sample_videos.json
- name: run test in docker
run: docker exec pod-back-with-volumes coverage run --append --source='.' manage.py test -v 3 --keepdb pod.video_encode_transcript.tests.test_remote_encode_transcode
run: docker exec pod-back-with-volumes coverage run --append manage.py test -v 3 --keepdb pod.video_encode_transcript.tests.test_remote_encode_transcode

- name: Run pa11y-ci full
run: docker exec pa11y-ci pa11y-ci -c /usr/src/app/dockerfile-dev-with-volumes/pa11y-ci/config.json
Expand Down Expand Up @@ -135,15 +136,16 @@ jobs:

- name: Setup Pod
run: |
coverage run --append --source='.' manage.py create_pod_index --settings=pod.main.test_settings
coverage run --append manage.py create_pod_index --settings=pod.main.test_settings
python manage.py makemigrations --settings=pod.main.test_settings
python manage.py migrate --settings=pod.main.test_settings
- name: Run Tests with coverage
env:
PYTHONUNBUFFERED: 1
run: |
coverage run --append --source='.' manage.py test -v 3 --settings=pod.main.test_settings
coverage run --append manage.py test -v 3 --settings=pod.main.test_settings
coverage xml -o cobertura.xml
- name: Send coverage to coveralls.io
# coveralls command has been installed by requirements-dev.txt
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pod_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- main
- master
workflow_dispatch:

jobs:
Pod-Main:
Expand All @@ -35,7 +36,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Remove apt repos that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ Start reading our code and you'll get the hang of it. We optimize for readabilit

* Configuration variables are uppercase and can be called
in all modules keeping the same name.
For example, MAVAR = getattr(settings, "MAVAR", default value)
For example, `MAVAR = getattr(settings, "MAVAR", default value)`
* Global variables to a module are also in uppercase but are considered private
to the module and therefore must be prefixed and suffixed with a double underscore
* All .py files must be indented using 4 spaces,
and all other files (.css, .html, .js) with 2 spaces (soft tabs)
* All .py files must be indented using **4 spaces**,
and all other files (.css, .html, .js) with **2 spaces** (soft tabs)
* This is open source software.
Consider the people who will read your code, and make it look nice for them.
It's sort of like driving a car: Perhaps you love doing donuts when you're alone,
Expand Down

0 comments on commit 0c7ac26

Please sign in to comment.