Skip to content

Commit

Permalink
Upload test coverage report to codecov website. (#1222)
Browse files Browse the repository at this point in the history
* Upload test coverage report ot codecov website.

* Upload to codecov.

* Try_01 CovdeCov upload.

* Updated makefile to have xml format test report.

* Upload cove results only for 22.2

* Use cov_xml.xml

* Update upload - code-cov 2

* Typo corrected.

* Upload cov results - updated file path.
  • Loading branch information
prmukherj authored Jan 4, 2023
1 parent 010cf6a commit 501b33d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 16 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,18 +452,19 @@ jobs:
PYFLUENT_START_INSTANCE: 0
FLUENT_IMAGE_TAG: ${{ matrix.image-tag }}

- name: Zip 23.1 Coverage Results before upload
run: |
sudo apt install zip -y
zip -r cov.zip cov_html
- name: Upload 22.2 Coverage Results to Codecov
if: matrix.image-tag == 'v22.2.0'
uses: codecov/codecov-action@v3
with:
root_dir: ${{ github.workspace }}
name: cov_xml.xml

- name: Upload 23.1 Coverage Results
if: matrix.image-tag == 'v23.1.0'
- name: Upload 22.2 Coverage Artifacts
if: matrix.image-tag == 'v22.2.0'
uses: actions/upload-artifact@v3
with:
name: HTML-Coverage-tag-231
path: cov.zip
retention-days: 7
name: cov_xml.xml
path: ./cov_xml.xml

release:
name: Release
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ unittest: unittest-dev-231
unittest-dev-222:
@echo "Running unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "dev and not fluent_231 and not fluent_232" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc
@python -m pytest -v -m "dev and not fluent_231 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc

unittest-dev-231:
@echo "Running unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "dev and not fluent_222 and not fluent_232" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc
@python -m pytest -v -m "dev and not fluent_222 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc

unittest-dev-232:
@echo "Running unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "dev and not fluent_222 and not fluent_231" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc
@python -m pytest -v -m "dev and not fluent_222 and not fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc

unittest-all-222:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "not fluent_231 and not fluent_232" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc --durations=0
@python -m pytest -v -m "not fluent_231 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0

unittest-all-231:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "not fluent_222 and not fluent_232" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc --durations=0
@python -m pytest -v -m "not fluent_222 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0

unittest-all-232:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "not fluent_222 and not fluent_231" --cov=ansys.fluent --cov-report html:cov_html --cov-config=.coveragerc --durations=0
@python -m pytest -v -m "not fluent_222 and not fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0

api-codegen:
@echo "Running API codegen"
Expand Down
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PyFluent
========
|pyansys| |pypi| |GH-CI| |MIT| |black|
|pyansys| |pypi| |GH-CI| |codecov| |MIT| |black|

.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
:target: https://docs.pyansys.com/
Expand All @@ -14,6 +14,9 @@ PyFluent
:target: https://github.com/pyansys/pyfluent/actions/workflows/ci.yml
:alt: GH-CI

.. |codecov| image:: https://codecov.io/gh/pyansys/pymapdl/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pyansys/pymapdl

.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT
Expand Down
21 changes: 21 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
comment:
layout: "diff"
behavior: default
require_changes: true # Avoid coverage comment if no files are changed.

coverage:
range: 70..100
round: down
precision: 2
status:
project:
default:
target: 80%
patch:
default:
# basic
target: 90%
if_not_found: success
if_ci_failed: error
if_no_uploads: error
threshold: 4% # Because some tests are flaky.

0 comments on commit 501b33d

Please sign in to comment.