Open omercnet opened 10 months ago
Indeed, this is probably not a permission issue (this message is there because it used to be the case that most issues were permission issues, but it might not be the case anymore)
I'm not sure the truncating is by GitHub and not by someone else in the stack, but it's hard to say.
I guess one possible way to help debugging would be to output stderr before stdout when there's an issue.
I've made a PR that adds logs. You may need to activate debug mode.
Please let me know whether this gives you enough info to solve the issue on your side or if there still is a bug.
Note that I have no idea who ends up truncating the output.
https://github.com/descope/python-sdk/actions/runs/7086877486/job/19345603602
##[debug]Command failed: args=('coverage', 'json', '-o', '-') path=PosixPath('.') kwargs={} exc.stderr=''
still no idea 🤷♀️
Ok, so empty stderr, the command stops just like that. (or the stderr is entirely truncated, but... How ? Why ? Who ?)
Could it be a sigkill, like an OOM or something ? I should have displayed the exit code...
Made a second attempt. Should be merged in a few minutes. Let's see if the exit code gives us a bit of info on how the process exited. Hoping for a 137 or something. Or maybe a small number but maybe Coverage uses meaningful exit codes (we'll check if it's relevant)
So feel free to rerun the CI and check the debug message.
Hi, happy new year :) By lack of ideas, and input, I'm going to close this if it's ok with you. Please you or anyone else experiencing the issue: reopen or recreate if relevant. I'll be delighted to try and tackle this again if we have more input for investigating.
Hi there! I believe I have ran into the same issue.
##[debug]Command failed: args=('coverage', 'json', '-o', '-') path=PosixPath('.') kwargs={} exc.stderr='' exc.returncode=2
Please let me know what other information I could provide you.
Maybe bit of a hint: my source code is actually in src/
subdirectory, perhaps that's what the problem is?
I do see the output in form of json further down the log though:
coverage_comment.subprocess.SubProcessError:
{"meta": {"format": 2, "version": "7.4.4", "timestamp": "2024-04-11T09:20:51.821149", "branch_coverage": true, "show_contexts": false}, "files": [... continues here, but eventually gets truncated]
Can you share your configuration from the workflow files (just the relevant parts) ?
- name: Django Tests
run: coverage run src/manage.py test src/
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt
and the other workflow (to post comment) is just copy and paste from documentation.
Have you tried with:
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
COVERAGE_PATH: src/
?
Yes, I have. It fails with No data to report.
. Please note that previous configuration (without that parameter) finds coverage's data.
can you share the coverage configuration (from .coveragerc or pyproject.toml or setup.cfg)
Sure, version is coverage==7.4.4
.
[tool.coverage.run]
branch = true
omit = ['*/migrations/*', 'manage.py', 'wsgi.py']
relative_files = true
[tool.coverage.report]
fail_under = 100
show_missing = true
skip_covered = true
Ok, I'll try to reproduce on a small example and see if it fails the same way
For posterity, I hit this same error, I was just trying to run coverage against a single file in the root of the repo.. I moved it to a src folder, added a blank init.py file and added --cov=src/
to my pytest command and this action ran without error after that.
Wait, a __init__.py
in the src
? That's definitly not something expected. It means your top level package is src
(so if you were to import it, it would be import src
). It's strage you had to do that.
https://github.com/descope/python-sdk/actions/runs/7086877486/job/19288591568
I do not think this is a permission error, as permissions are there and it's been working well for a while
looks like the input is truncated by this might be github logs issue and not really