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

Error: Generating coverage report. Cannot destructure property 'name' of 'item' as it is null.

colin99d opened this issue · comments

I am trying to add this coverage checker to our large repository. There seems to be an issue creating the proper coverage report.
Screen Shot 2022-04-26 at 7 20 03 AM

I modified our Github Actions workflow to show everything being exported. The link to the issue is here: https://github.com/OpenBB-finance/OpenBBTerminal/runs/6174383671?check_suite_focus=true
Screen Shot 2022-04-26 at 7 20 40 AM
The above 4 sections show the tests ran, then the two desired output files, then show this coverage reporter which is currently failing.

Thank you for the great example. I fixed a bug.
You can just run MishaKav/pytest-coverage-comment@main or use MishaKav/pytest-coverage-comment@v1.1.27`
Please update me if it works now, I didn't test my plugin on such big repos.
Thank you.

Screen Shot 2022-04-26 at 3 06 36 PM

Thanks for the quick response! The report now runs error-free; however, it does not show the individual breakdown for files. Is this something that can be fixed or is our repository just too large?

can you please provide me the content of pytest-coverage.txt?

I see the problem, you set this setting: report-only-changed-files: true
so in such case, it will show in the table only the changed files, in your commit, I saw that you changed only the readme file, so it didn't has any files to put in the table.

I see!! Thanks for the help MishaKav! This repo is super useful.

GlaThank you, glad to hear that, it was the purpose of the action )
I have the same action for jest (tests for node/javascript)

@colin99d after your confusion, I release a feature that will give an indication for this.

  • When you enable report-only-changed-files, you will see a small "dot" near the title, that indicates that it shows only reported files.
  • In case you will update only README.md files, when you open a collapse, it will show you.

image

You can just run MishaKav/pytest-coverage-comment@main or use MishaKav/pytest-coverage-comment@v1.1.28

Awesome! I got one more issue for you that relates.
Screen Shot 2022-04-26 at 5 37 27 PM
On the PR I have been talking about we changed two files with less than 100% code coverage to test (fa_controller.py and loggers.py). However, these are not showing up in the coverage report. It was working fine on a smaller repo, so I believe this a is a large repo glitch again.
Screen Shot 2022-04-26 at 5 38 49 PM

As I see on your commit f80c0b4 you changed only test.yml file.
It takes the changes from the commit and not full PR (maybe I can get all changed files from PR, need to check it)

You always can check it on the action itself.
image

@colin99d I checked this again when your action runs on push it will contain only changed files that belong to this commit.
When you will run on the pull_request event, it will report tall files that changed on the full PR.

I see. I tried just removing report-only-changed-files: true and now it only shows the failure in coverage for one file and not all of them.