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

ADD: Add tests to improve coverage #195

Merged
merged 32 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3da8571
ADD: Add tests to improve coverage
ldevillez May 5, 2024
3362033
FIX: formatting with black
ldevillez May 5, 2024
5a1e023
FIX: fix merge of 194 and improve coverage
ldevillez May 11, 2024
ce71d08
ADD: coverage to github workflow
ldevillez May 11, 2024
ffc9d49
FIX: black formating
ldevillez May 11, 2024
1f67910
FIX: indent workflow tests
ldevillez May 11, 2024
7893aee
FIX: generate coverage only if tests were run
ldevillez May 11, 2024
cd37088
FIX: update workflow versions
ldevillez May 11, 2024
e4eebd9
FIX: typo
ldevillez May 11, 2024
518e4bc
FIX: typo
ldevillez May 11, 2024
099c0a1
FIX: typo condition workflow
ldevillez May 11, 2024
cd137b1
FIX: typo condition workflow
ldevillez May 11, 2024
c9fbe6e
FIX: black version set in workflow
ldevillez May 11, 2024
6b8901f
FIX: typo condition workflow
ldevillez May 11, 2024
5ce64c8
FIX: typo condition workflow
ldevillez May 11, 2024
f14dbaf
FIX: file pattern workflow
ldevillez May 11, 2024
f13f7dd
FIX: typo workflow
ldevillez May 11, 2024
7477572
TEST echo
ldevillez May 11, 2024
3f0fd0d
FIX: typo workflow
ldevillez May 11, 2024
00b3d91
FIX: typo workflow
ldevillez May 11, 2024
8acda48
FIX: typo workflow
ldevillez May 11, 2024
5a317ff
FIX: typo workflow
ldevillez May 11, 2024
5618185
FIX: typo workflow
ldevillez May 14, 2024
7f577e8
fix pyproject.toml
ldevillez May 14, 2024
fde7c41
fix pyproject.toml
ldevillez May 14, 2024
decc303
fix pyproject.toml
ldevillez May 14, 2024
bb64f1e
FIX: poetry lock
ldevillez May 14, 2024
66cb285
FIX: workflow
ldevillez May 14, 2024
e863378
FIX: workflow
ldevillez May 14, 2024
d56e983
FIX: coverage.xml and python version
ldevillez May 17, 2024
c6d4d9b
FIX: pylint linting
ldevillez May 19, 2024
e0c9fff
ADD: changelog
ldevillez May 19, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
version: "23.1.0"
32 changes: 19 additions & 13 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,34 @@ jobs:
run: sudo apt-get install libgirepository1.0-dev

- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
id: changed-python
uses: tj-actions/changed-files@v44
with:
files: "**/*.py"
files: |
**.py
#fetch_depth: 0

- name: Install python
if: steps.changed-files.output.any_changed == 'true'
if: steps.changed-python.outputs.any_changed == 'true'
uses: actions/setup-python@v3
with:
python-version: 3.x
python-version: "3.11"


- run: pip install --upgrade pip
if: steps.changed-files.output.any_changed == 'true'
- run: pip install .
if: steps.changed-files.output.any_changed == 'true'
- run: pip install pylint==2.16.*
if: steps.changed-files.output.any_changed == 'true'
- run: pylint --rcfile=pylintrc ${{ steps.changed-files.outputs.all_changed_files }}
if: steps.changed-files.output.any_changed == 'true'
if: steps.changed-python.outputs.any_changed == 'true'

- run: pip install poetry
if: steps.changed-python.outputs.any_changed == 'true'

- run: poetry install --with dev
if: steps.changed-python.outputs.any_changed == 'true'


- run: poetry run pylint --rcfile=pylintrc ${{ steps.changed-python.outputs.all_changed_files }}
if: steps.changed-python.outputs.any_changed == 'true'
39 changes: 28 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,46 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
id: changed-python
uses: tj-actions/changed-files@v44
with:
files: "**/*.py"
files: |
**.py
#fetch_depth: 0

- name: Set up Python all python version
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-python.outputs.any_changed == 'true'
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install dependencies
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-python.outputs.any_changed == 'true'
run: sudo apt-get install libgirepository1.0-dev

- run: pip install --upgrade pip
if: steps.chaged-files.output.any_changed == 'true'
- run: pip install .
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-python.outputs.any_changed == 'true'

- run: pip install poetry
if: steps.changed-python.outputs.any_changed == 'true'

- run: poetry install --with dev
if: steps.changed-python.outputs.any_changed == 'true'

- name: Run Test
if: steps.chaged-files.output.any_changed == 'true'
run: python -m unittest
if: steps.changed-python.outputs.any_changed == 'true'
run: poetry run coverage run -m unittest

- name: Create coverage xml
if: steps.changed-python.outputs.any_changed == 'true'
run: poetry run coverage xml

- name: Get Cover
if: steps.changed-python.outputs.any_changed == 'true'
uses: orgoro/[email protected]
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
16 changes: 8 additions & 8 deletions .github/workflows/tests_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v44
with:
files: "docs/*"

- name: Install Poetry
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
run: pipx install poetry
- name: Install Python
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: poetry
- name: Setup Pages
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/configure-pages@v2
- name: Install local Python package
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
run: poetry install --with docs
- name: Setup Pages
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/configure-pages@v3
- name: Build docs
if: steps.chaged-files.output.any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
run: cd docs && poetry run make html
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

### Added
- Adding option to specify texmode via a SVG attribute (see --texmode)
- Adding tests to improve the coverage of the code
### Changed
### Deprecated
### Removed
### Fixed
- Fixed string encoding exception when using stdout as output
- Fixing multiple bugs along the code related to the news tests to improve the coverage
- Fixing typo in github action for pylint and tests
### Security

## v3.0.1 - 14/01/2023
Expand Down
Loading
Loading