MishaKav / pytest-coverage-comment

Comments a pull request with the pytest code coverage badge and full report
MIT License
171 stars 57 forks source link

Coverage file wouldn't created. #163

Open ChehST opened 4 months ago

ChehST commented 4 months ago

I've tried add comment covarege but no comment with report was generated. At workflow debugger i've find this output...

Run pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=app Parser/tests/ | tee pytest-coverage.txt

ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --cov-report=term-missing:skip-covered --cov=app
  inifile: /home/runner/work/CI-CD-pipeline/CI-CD-pipeline/Parser/pytest.ini
  rootdir: /home/runner/work/CI-CD-pipeline/CI-CD-pipeline/Parser

I've try run pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=app Parser/tests/ | tee pytest-coverage.txt and catch some errors. With these commands file wouldn't create! And it will influence on next steps

I mean that README description is misleading users to use pytest with incorrect arguments

pytest==8.1.1

ChehST commented 4 months ago

I realized that both options are possible. I was unaware of the pytest-cov plugin. However, I did not find any mention of the package version requirements.

Mb it would be good idea to add check project's requirement file or any way to understend which keys to use - native from pytest or pytest-cov's plugin