Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

[TOOL] Code coverage in CI - #296

Closed
vlad-perevezentsev wants to merge 20 commits into
IntelPython:mainfrom
vlad-perevezentsev:code_coverage
Closed

vlad-perevezentsev wants to merge 20 commits into
IntelPython:mainfrom
vlad-perevezentsev:code_coverage

Conversation

@vlad-perevezentsev

@vlad-perevezentsev vlad-perevezentsev commented Mar 29, 2021 •

Copy link
Copy Markdown
Contributor

Added support for test code coverage measuring by pytest run for the numpy-dpex.

@vlad-perevezentsev vlad-perevezentsev linked an issue Mar 29, 2021 that may be closed by this pull request

@PokhodenkoSA PokhodenkoSA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vlad-perevezentsev
Please fix small remarks and try to investigate this:

  Coverage statistics reporting failed
  Traceback (most recent call last):
    File "$PREFIX/lib/python3.7/site-packages/teamcity_messages-1.25-py3.7.egg/teamcity/pytest_plugin.py", line 371, in pytest_terminal_summary
      self._report_coverage()
    File "$PREFIX/lib/python3.7/site-packages/teamcity_messages-1.25-py3.7.egg/teamcity/pytest_plugin.py", line 378, in _report_coverage
      from coverage.report import Reporter
  ImportError: cannot import name 'Reporter' from 'coverage.report' ($PREFIX/lib/python3.7/site-packages/coverage/report.py)

Comment thread .coveragerc Resolved
Comment thread .coveragerc Resolved
@PokhodenkoSA

Copy link
Copy Markdown
Contributor

Blocked by SAT-3964. Waiting for coverage package on internal CI.

@vlad-perevezentsev

Copy link
Copy Markdown
Contributor Author

@PokhodenkoSA
Сoverage reports include coverage of test files Testing Conda.
Pytest-cov does not have a omit command issue.
I suggest running pytest with the coverage command.

@PokhodenkoSA

PokhodenkoSA commented Apr 8, 2021 •

Copy link
Copy Markdown
Contributor

@PokhodenkoSA

Сoverage reports include coverage of test files Testing Conda.

Pytest-cov does not have a omit command issue.

I suggest running pytest with the coverage command.

As mentioned in the issue omit is supported via configuration file of coverage and author of the issue do not want to add new config file in his repo. We allow adding config files. It is convenient to make tolls work the same way for all developers. pytest-cov does not support omit, but it calls coverage which does support. You just used wrong config file.

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

Issues with no description are unacceptable. Please indicate what this is PR attempts to solve, how to see that the PR does address the problem, etc.

@PokhodenkoSA @diptorupd

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

Suggested wording:

Added support for test code coverage measuring by pytest run for the numpy-ddpy.

@PokhodenkoSA PokhodenkoSA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, fix small remarks.

Comment thread .coveragerc Resolved
Comment thread conda-recipe/run_test.sh Outdated
set -x

pytest -q -ra --disable-warnings --pyargs numba_dppy -vv
pytest -q -ra --disable-warnings --cov numba_dppy --cov-report term-missing --pyargs numba_dppy -vv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, try to use config file for these arguments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Type of report cannot be specified in .coveragerc

@PokhodenkoSA

PokhodenkoSA commented Sep 19, 2021 •

Copy link
Copy Markdown
Contributor

Moved all parts except for recipe modification into #561.
So this PR is a tool for collecting coverage in internal CI with all devices.

Comment thread conda-recipe/meta.yaml Outdated
- setuptools
- cython
- numpy=1.20*
- numba 0.54*|0.55*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the purpose?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added this because numba-dppy didn't support numpy 1.21.
I will delete the last commit.

Comment thread .coveragerc
Comment on lines 15 to 17
@@ -12,10 +12,6 @@ precision = 2
omit =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What this change for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't be here

@diptorupd

Copy link
Copy Markdown
Contributor

closing as the running coverage in recipe is not required and we have coverage generation using public CI.

@diptorupd diptorupd closed this Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

2 - Ready for Review infrastructure tests Related to test suite or test run infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants