MishaKav / pytest-coverage-comment

Comments a pull request with the pytest code coverage badge and full report

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coverage report does not show when multi file input

kankoyan opened this issue · comments

or am I doing sth incorrect?

It was missing by design, just release a version that fixed that, you can use:

- name: Pytest Coverage Comment
  uses: MishaKav/pytest-coverage-comment@main
  with:
      pytest-coverage-path: ./data/pytest-coverage_4.txt
      multiple-files: |
        title1, ./data/pytest-coverage_4.txt, ./data/pytest_1.xml

or use specific version

- name: Pytest Coverage Comment
  uses: MishaKav/pytest-coverage-comment@v1.1.32
  with:
      pytest-coverage-path: ./data/pytest-coverage_4.txt
      multiple-files: |
        title1, ./data/pytest-coverage_4.txt, ./data/pytest_1.xml

thank you!
thanks for the great tool!

hmm but does this work for multiple coverage files?

this is what you can get
image

right, but are we able to get multiple coverage report showed in ui? in our case we run the pytest twice and they generates models_coverage.txt and common_coverage.txt

can pytest-coverage-path take multiple file path I guess?

can pytest-coverage-path take multiple file path I guess?

on which property name are you talking?

  uses: MishaKav/pytest-coverage-comment@v1.1.32
  with:
      pytest-coverage-path: ./data/pytest-coverage_4.txt
      multiple-files: |
        title1, ./data/pytest-coverage_4.txt, ./data/pytest_1.xml

above essentially indicating that they can be only one coverage report since pytest-coverage-path takes one path only, can we make it to take multiple paths so that it can generate multiple coverage report?

currently pytest-coverage-path support only a single file. I don't think that I will add this feature at all.
GitHub comments are very limited, especially when the action posts rich HTML with links etc, so sometimes that is not enough space even for one report.

I can suggest you try running this action twice (each time for a different report) and pass the create-new-comment: true, in this way it should post you 2 different reports (2 different comments)

I see.. thank you so much!