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

added the tests for python and C++ and combined test report into unified test report #574

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
20 changes: 9 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,24 @@ jobs:
run: |
CXXFLAGS=--coverage CFLAGS=--coverage python scripts/build/install.py
# coverage tests
- name: Run tests
- name: Run python tests
run: |
python -m pytest --doctest-modules --cov=./ --cov-report=xml -s
python -m pytest --doctest-modules --cov=./ --cov-report=xml:coverage-python.xml -s

- name: Capture Coverage Data with lcov
run: |
lcov --capture --directory . --output-file coverage.info --no-external

- name: Generate HTML Coverage Report with genhtml
- name: Capture C++ Coverage Data
run: |
genhtml coverage.info --output-directory coverage_report

lcov --capture --directory . --output-file coverage-cpp.info --no-external
python -m pip install gcovr
gcovr -r . --xml-pretty --output coverage-cpp.xml

- name: Upload Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./coverage.xml
files: ./coverage-python.xml,./coverage-cpp.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to do the same thing locally? Can you show a screenshot?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have arrived at a preliminary solution for merging Python and C++ coverage reports using Codecov, based on their official documentation https://docs.codecov.com/docs/github-4a-merging-reports.

To further validate this solution, I plan to develop and test it locally by utilizing a Codecov API key. I will ensure comprehensive testing and provide you with an update on the results by the end of the week sir .

Copy link
Member

@czgdp1807 czgdp1807 Dec 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there should be a way to do it without Codecov. This is indeed tough to achieve. So if you want to take other issues while parallelly working on it, feel free to do so.

flags: unittests
name: codecov-umbrella
path_to_write_report: ./coverage/codecov_report.txt
Expand Down Expand Up @@ -199,4 +197,4 @@ jobs:

- name: Build Documentation
run: |
sphinx-build -b html docs/source/ docs/build/html
sphinx-build -b html docs/source/ docs/build/html
Loading