Skip to content

Commit

Permalink
Generate XML coverage report
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
cutwater committed Oct 10, 2024
1 parent 8d401e9 commit 687dc05
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

9 changes: 6 additions & 3 deletions .github/workflows/ci_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ jobs:
sudo apt install -y libsasl2-dev libldap2-dev libssl-dev gettext
- name: install tox & coverage
run: pip3 install tox coverage
run: pip3 install tox coverage[toml]

- name: run the unit tests
run: tox -e py311

- name: Inject PR number into coverage.xml
run: sed -i '2i <!-- PR ${{ github.event.number }} -->' coverage.xml

- name: upload coverage as artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: /tmp/galaxy_ng-test-results.xml
path: coverage.xml

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
Expand All @@ -99,7 +102,7 @@ jobs:
continue-on-error: true
run: |
curl -v --user "${{ vars.PDE_ORG_RESULTS_AGGREGATOR_UPLOAD_USER }}:${{ secrets.PDE_ORG_RESULTS_UPLOAD_PASSWORD }}" \
--form "xunit_xml=@coverage.xml" \
--form "xunit_xml=@/tmp/galaxy_ng-test-results.xml" \
--form "component_name=hub" \
--form "git_commit_sha=${{ github.sha }}" \
--form "git_repository_url=https://github.com/${{ github.repository }}" \
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,17 @@ legacy_tox_ini = """
--capture=no -v \
-p 'no:pulpcore' \
-p 'no:pulp_ansible' \
--cov-report term-missing:skip-covered \
--cov-report xml:coverage.xml \
--cov=galaxy_ng \
--junit-xml=/tmp/galaxy_ng-test-results.xml \
--pyargs "galaxy_ng.tests.unit" \
'
"""

[tool.coverage.run]
relative_files = true
data_file = "/tmp/.coverage"
omit = [
"galaxy_ng/_vendor/*",
"galaxy_ng/tests/*",
]

0 comments on commit 687dc05

Please sign in to comment.