Links in comment lead to 404
aaronkurz opened this issue · 11 comments
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?
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–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–33</a></td></tr><tr><td colspan="5"><b>camunda</b></td></tr><tr><td> <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–43</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/camunda/client.py#L52-L55">52–55</a></td></tr><tr><td colspan="5"><b>instance_router</b></td></tr><tr><td> <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–26</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/instance_router_interface.py#L36-L42">36–42</a></td></tr><tr><td colspan="5"><b>instance_router/private</b></td></tr><tr><td> <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–26</a></td></tr><tr><td> <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–49</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L58-L59">58–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–85</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L94-L95">94–95</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L109-L111">109–111</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/controller.py#L122-L174">122–174</a></td></tr><tr><td> <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–55</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L66-L78">66–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–123</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/instance_router/private/rl_agent.py#L134-L165">134–165</a></td></tr><tr><td colspan="5"><b>models</b></td></tr><tr><td> <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–49</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L95-L101">95–101</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L109-L110">109–110</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L119-L123">119–123</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L132-L138">132–138</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy.py#L147-L149">147–149</a></td></tr><tr><td> <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–41</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L61-L82">61–82</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L98-L115">98–115</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L129-L140">129–140</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L160-L177">160–177</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L189-L199">189–199</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L211-L221">211–221</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L235-L241">235–241</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/batch_policy_proposal.py#L251-L265">251–265</a></td></tr><tr><td> <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–105</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L115-L117">115–117</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L126-L132">126–132</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L146-L148">146–148</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L162-L170">162–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–214</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/models/process.py#L224-L237">224–237</a></td></tr><tr><td> <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> <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–40</a></td></tr><tr><td colspan="5"><b>rest</b></td></tr><tr><td> <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–83</a></td></tr><tr><td> <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–48</a></td></tr><tr><td> <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–211</a></td></tr><tr><td> <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–35</a></td></tr><tr><td> <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–98</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L107-L119">107–119</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L137-L154">137–154</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L169-L222">169–222</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L231-L235">231–235</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L242-L243">242–243</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L253-L267">253–267</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L277-L296">277–296</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L308-L320">308–320</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L327-L334">327–334</a>, <a href="https://github.com/Ultimate-Storm/sbe_prototyping/blob/fd5c17b15191cfb13bf065a24f977e337a73d5d6/rest/process.py#L344-L378">344–378</a></td></tr><tr><td> <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> <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–53</a></td></tr><tr><td> <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–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> </td></tr></tbody></table></details>
## Backend Unit Test Summary
| Tests | Skipped | Failures | Errors | Time |
| ----- | ------- | -------- | -------- | ------------------ |
| 14 | 0 :zzz: | 0 :x: | 0 :fire: | 1.896s :stopwatch: |
Can you check if this link points to the right file?
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.