Skip to content

Python Code Coverage

Code Quality (Embold) enables users to include coverage data as part of the analysis for Python projects. However, Code Quality itself does not generate coverage reports. To incorporate coverage information, users must first use a third-party tool to create the coverage report. Once the report is ready, users need to configure Code Quality to locate and retrieve it. This ensures that the coverage data is displayed alongside other analysis results within the Code Quality UI.

Pre-requisites:

  • The Code Quality (Embold) Server must be running and properly configured. (version 1.9.26.4 or later)
  • The user needs to have a build for their Python project, which includes coverage data as part of the test runs.
  • The user should run the Code Quality scan on the same host where the Python project was built and the coverage data was generated.
  • The reports should be in LCOV format.

Running Remote Scan for Coverage

To include Python coverage data in your analysis, run a remote scan using the CLI scanner. Full setup and execution instructions are in the Remote Scan (CLI Analysis) guide.

Coverage-specific config: In your repository-configuration.json, the coveragepy module is enabled by default and reportDir defaults to baseDir. To use a different location for your LCOV reports, set reportDir to the parent directory of the report files.

Once the scan completes, navigate to the Coverage section in the Code Quality UI to view the results.

Running Coverage in CI/CD

To automate coverage analysis as part of your pipeline (GitHub Actions, Azure DevOps, Jenkins, GitLab CI, etc.), see the CI/CD Integration guide.