Home

Awesome

Qodo Cover GitHub Action

Currently in preview and available for free for a limited time for Python projects.

Automatically generate and enhance test coverage using AI-powered test generation. Qodo Cover analyzes your existing test coverage and intelligently generates additional tests to improve coverage while ensuring high-quality, meaningful test cases.

Features

Usage

Copy this working example or add the following to your workflow:

name: Run Qodo-Cover

on:
  pull_request:
    branches:
      - main
    types:
      - opened # Trigger only when a pull request is opened

permissions:
  pull-requests: write # Allows commenting on pull requests
  contents: write # Allows reading and writing files

jobs:
  run-qodo-cover:
    runs-on: ubuntu-22.04
    steps:
      
      ... # Set up your python test environment

      - name: qodo-cover
        uses: qodo-ai/qodo-ci/.github/actions/qodo-cover@v0.1.1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          project_language: python
          project_root: <path/to/your/python/project>
          code_coverage_report_path: <path/to/your/coverage.xml>
          test_command: "pytest --cov=. --cov-report=xml --cov-report=term"
          model: gpt-4o

        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Inputs

InputDescriptionRequiredDefault
github_tokenGitHub token for authenticationYesN/A
project_languageProgramming language of the projectNopython
project_rootRoot directory of the projectNo.
code_coverage_report_pathPath to the coverage.xml fileNo./coverage.xml
test_commandCommand to run tests (must generate coverage.xml)YesN/A
modelLLM model nameNogpt-4o
max_iterationsMaximum test generation attempts per fileNo3
desired_coverageTarget coverage percentageNo100

Repository secret

Add OPENAI_API_KEY to your repository secrets.

Note: This requirement is temporary. We will enable users to issue access tokens from their Qodo Portal in a future release.

Workflow permissions

For this action to work you must explicitly allow GitHub Actions to create pull requests. This setting can be found in a repository's settings under Actions > General > Workflow permissions.

Outputs

If the Qodo Cover agent succeeds in improving coverage it will comment on your PR with a link to a patch PR containing the new tests.

Qodo Cover PR Example

Limitations

Roadmap