gapic-generator-python icon indicating copy to clipboard operation
gapic-generator-python copied to clipboard

Test coverage is incorrectly configured for gapic-generator-python, and is trying to ananlyze non-python files as if they are python code

Open agrawalradhika-cell opened this issue 2 months ago • 3 comments

Test coverage is incorrectly configured, and is trying to ananlyze non-python files as if they are python code

Environment details

  • gapic-generator version: pip show gapic-generator - https://github.com/googleapis/gapic-generator-python/actions/runs/19183909674/job/54846602382?pr=2472

Steps to reproduce

  1. Creating PR in gapic-generator-python - https://github.com/googleapis/gapic-generator-python/actions/runs/19183909674/job/54846602382?pr=2472

The error log shows that the coverage tool is attempting to parse a Jinja2 template file (feature_fragments.j2), which is not a Python file, and this is causing a SyntaxError ( source). This happens because a unit test is rendering a template that imports feature_fragments.j2, and the coverage tool is trying to follow this import and analyze the template file for test coverage.

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

agrawalradhika-cell avatar Nov 07 '25 23:11 agrawalradhika-cell

This is related to a recent release of coverage : https://pypi.org/project/coverage/7.11.1/. Let's exclude this version temporarily and see if it comes back. https://github.com/nedbat/coveragepy/issues/2077

parthea avatar Nov 08 '25 14:11 parthea

Closing as obsolete. https://github.com/coveragepy/coveragepy/issues/2077 was fixed

parthea avatar Nov 10 '25 19:11 parthea

Re-opening. This is still a problem. see build log https://github.com/googleapis/gapic-generator-python/actions/runs/19243623779/job/55012060872?pr=2482

parthea avatar Nov 10 '25 19:11 parthea