MishaKav/pytest-coverage-comment

Links in comment lead to 404

aaronkurz opened this issue · 11 comments

In my own personal project, as well as for this repo, the links in the comment (files and lines missing) lead to 404 pages:
Screenshot 2022-03-08 at 15 56 56
Screenshot 2022-03-08 at 15 55 23

In my "action" the real files of testing are missing by purpose.
This feature should work, you can see examples in other public repos like that

Can you provide me please a full example of which structure you have in your project?

This is the (relevant part of) the Github actions workflow:

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.9'
      - name: General preparations
        # create empty source/backend/resources/bpmn folder necessary for running certain functionalities
        run: |
          cd source/backend
          mkdir -p resources/bpmn
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Backend unit tests
        run: |
          cd source/backend
          export PYTHONPATH=. pytest
          pytest -v
          pytest --cache-clear --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov-config=unit-tests/.coveragerc --cov=. > pytest-coverage.txt
      - name: Comment unit test coverage
        if: ${{ github.event_name == 'pull_request'}}
        id: coverageComment
        uses: MishaKav/pytest-coverage-comment@main
        with:
          pytest-coverage-path: ./source/backend/pytest-coverage.txt
          junitxml-path: ./source/backend/pytest.xml
          junitxml-title: Backend Unit Test Summary
          title: Backend Unit Test Coverage Report (files with 100% coverage not shown)
          badge-title: Backend Unit Test Coverage

Maybe it is because the repo is private?

Here is also the structure:
Screenshot 2022-03-08 at 21 46 41

It's working on private repo also.
I think I know what is the problem. Can you provide me please the HTML comment of the pytest-coverage-comment output
image

Of course:

<!-- Pytest Coverage Comment: Lint-Test -->
<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/README.md"><img alt="Backend Unit Test Coverage" src="https://img.shields.io/badge/Backend Unit Test Coverage-30%25-red.svg" /></a><br/><details><summary>Backend Unit Test Coverage Report (files with 100% coverage not shown)</summary><table><tr><th>File</th><th>Stmts</th><th>Miss</th><th>Cover</th><th>Missing</th></tr><tbody><tr><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/app.py">app.py</a></td><td>39</td><td>39</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/app.py#L2-L57">2&ndash;57</a></td></tr><tr><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/config.py">config.py</a></td><td>19</td><td>1</td><td>95%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/config.py#L9">9</a></td></tr><tr><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/create_app.py">create_app.py</a></td><td>22</td><td>22</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/create_app.py#L2-L33">2&ndash;33</a></td></tr><tr><td colspan="5"><b>camunda</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/camunda/client.py">client.py</a></td><td>23</td><td>15</td><td>35%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/camunda/client.py#L9">9</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/camunda/client.py#L19">19</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/camunda/client.py#L30-L43">30&ndash;43</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/camunda/client.py#L52-L55">52&ndash;55</a></td></tr><tr><td colspan="5"><b>instance_router</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/instance_router_interface.py">instance_router_interface.py</a></td><td>16</td><td>9</td><td>44%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/instance_router_interface.py#L15">15</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/instance_router_interface.py#L25-L26">25&ndash;26</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/instance_router_interface.py#L36-L42">36&ndash;42</a></td></tr><tr><td colspan="5"><b>instance_router/private</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/camunda_collector.py">camunda_collector.py</a></td><td>17</td><td>11</td><td>35%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/camunda_collector.py#L15-L26">15&ndash;26</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py">controller.py</a></td><td>76</td><td>48</td><td>37%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L33">33</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L43-L49">43&ndash;49</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L58-L59">58&ndash;59</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L68">68</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L79-L85">79&ndash;85</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L94-L95">94&ndash;95</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L109-L111">109&ndash;111</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L122-L174">122&ndash;174</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py">rl_agent.py</a></td><td>81</td><td>54</td><td>33%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L46-L55">46&ndash;55</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L66-L78">66&ndash;78</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L88">88</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L101-L123">101&ndash;123</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L134-L165">134&ndash;165</a></td></tr><tr><td colspan="5"><b>models</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py">batch_policy.py</a></td><td>65</td><td>25</td><td>62%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L48-L49">48&ndash;49</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L95-L101">95&ndash;101</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L109-L110">109&ndash;110</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L119-L123">119&ndash;123</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L132-L138">132&ndash;138</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L147-L149">147&ndash;149</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py">batch_policy_proposal.py</a></td><td>99</td><td>72</td><td>27%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L36-L41">36&ndash;41</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L61-L82">61&ndash;82</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L98-L115">98&ndash;115</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L129-L140">129&ndash;140</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L160-L177">160&ndash;177</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L189-L199">189&ndash;199</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L211-L221">211&ndash;221</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L235-L241">235&ndash;241</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L251-L265">251&ndash;265</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py">process.py</a></td><td>120</td><td>63</td><td>48%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L79-L105">79&ndash;105</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L115-L117">115&ndash;117</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L126-L132">126&ndash;132</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L146-L148">146&ndash;148</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L162-L170">162&ndash;170</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L179">179</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L188">188</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L197">197</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L209-L214">209&ndash;214</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L224-L237">224&ndash;237</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process_instance.py">process_instance.py</a></td><td>19</td><td>1</td><td>95%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process_instance.py#L33">33</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/utils.py">utils.py</a></td><td>21</td><td>5</td><td>76%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/utils.py#L36-L40">36&ndash;40</a></td></tr><tr><td colspan="5"><b>rest</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/batch_policy.py">batch_policy.py</a></td><td>54</td><td>54</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/batch_policy.py#L2-L83">2&ndash;83</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/batch_policy_proposal.py">batch_policy_proposal.py</a></td><td>24</td><td>24</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/batch_policy_proposal.py#L2-L48">2&ndash;48</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/instance_router.py">instance_router.py</a></td><td>90</td><td>90</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/instance_router.py#L2-L211">2&ndash;211</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/meta.py">meta.py</a></td><td>25</td><td>25</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/meta.py#L2-L35">2&ndash;35</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py">process.py</a></td><td>185</td><td>136</td><td>26%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L74">74</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L84">84</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L93-L98">93&ndash;98</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L107-L119">107&ndash;119</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L137-L154">137&ndash;154</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L169-L222">169&ndash;222</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L231-L235">231&ndash;235</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L242-L243">242&ndash;243</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L253-L267">253&ndash;267</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L277-L296">277&ndash;296</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L308-L320">308&ndash;320</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L327-L334">327&ndash;334</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L344-L378">344&ndash;378</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/utils.py">utils.py</a></td><td>3</td><td>1</td><td>67%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/utils.py#L12">12</a></td></tr><tr><td colspan="5"><b>task_scheduler</b></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/task_scheduler/celery_app.py">celery_app.py</a></td><td>27</td><td>27</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/task_scheduler/celery_app.py#L2-L53">2&ndash;53</a></td></tr><tr><td>&nbsp; &nbsp;<a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/task_scheduler/config.py">config.py</a></td><td>2</td><td>2</td><td>0%</td><td><a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/task_scheduler/config.py#L2-L3">2&ndash;3</a></td></tr><tr><td><b>TOTAL</b></td><td><b>1029</b></td><td><b>724</b></td><td><b>30%</b></td><td>&nbsp;</td></tr></tbody></table></details>

## Backend Unit Test Summary
| Tests | Skipped | Failures | Errors | Time |
| ----- | ------- | -------- | -------- | ------------------ |
| 14 | 0 :zzz: | 0 :x: | 0 :fire: | 1.896s :stopwatch: |

It leads to a page just saying 'Not Found' 😕 :

Screenshot 2022-03-08 at 23 32 54

Thanks for your help and effort already, though! 🙇

can you send me a proper link to your file app.py?

Yes, this is the proper link, of the latest commit to the PR: https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/source/backend/app.py

Ahhh, I see.. the source/backend/ is missing! It is probably because I run pytest in source/backend/? But it won't work how I want it if I run pytest on the root folder :/ Is there a way to add the missing part to the links automatically? If not, that would be a nice feature!

In case that it is not possible to generate correct links in that case, is there a possibility to disable to links? (I did not see anything about it in the documentation) 😄

I add some additional parameter (coverage-path-prefix) to support your case, can you please try my branch before I release this version?

- name: Comment unit test coverage
  if: ${{ github.event_name == 'pull_request'}}
  id: coverageComment
  uses: MishaKav/pytest-coverage-comment@links-in-comment
  with:
    pytest-coverage-path: ./source/backend/pytest-coverage.txt
    coverage-path-prefix: source/backend/
    junitxml-path: ./source/backend/pytest.xml
    junitxml-title: Backend Unit Test Summary
    title: Backend Unit Test Coverage Report (files with 100% coverage not shown)
    badge-title: Backend Unit Test Coverage

Awesome, I tested it and it works ✨ 🥳 Thanks so much!

The feature was released you can just run MishaKav/pytest-coverage-comment@main or use MishaKav/pytest-coverage-comment@v1.1.21
Thank you.