Skip to content

Commit

Permalink
Merge pull request #195 from xyz2tex/187-improve-test-coverage
Browse files Browse the repository at this point in the history
ADD: Add tests to improve coverage
  • Loading branch information
ldevillez authored May 19, 2024
2 parents a0d38db + e0c9fff commit 7eef4c8
Show file tree
Hide file tree
Showing 34 changed files with 1,778 additions and 665 deletions.
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

0 comments on commit 7eef4c8

Please sign in to comment.