Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle reports with line 0 executed #73

Merged
merged 1 commit into from
Aug 22, 2023

Commits on Aug 21, 2023

  1. fix: handle reports with line 0 executed

    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.
    giovanni-guidini committed Aug 21, 2023
    Configuration menu
    Copy the full SHA
    6eefde5 View commit details
    Browse the repository at this point in the history