Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle reports with line 0 executed (#73)
Recently when testing the docs for integrating ATS I did [this commit](https://app.codecov.io/gh/giovanni-guidini/ats-data/commit/c24c1db8aa27fcda2d311fdcd293c20697030389) for which processing failed. Checking the logs it failed because of ``` [... removed stack trace...] File "/worker/services/report/languages/pycoverage.py", line 56, in process report_file.append( File "/usr/local/lib/python3.10/site-packages/shared/reports/resources.py", line 341, in append raise ValueError("Line number must be greater then 0. Got %s" % ln) ValueError: Line number must be greater then 0. Got 0 ``` Indeed when I donwloaded and checked the uploaded files there were 3 of them with `executed_lines: [0]`. They were all `__init__.py` files. Idk why that happened, to be honest. It looks strange because the 3 files are empty. In any case it's an easy fix that will not hurt us. I think line 0 should not exist. It might indicate that when importing the code or something like that the file was executed somehow, but for `__init__.py` files with some content in them the list of lines executed is as expected.
- Loading branch information