Automatically enhance test coverage as part of your CI pipelines using Sectum AI Cover's GitHub Action.
Run Sectum AI Cover to extend existing test suites throughout the repository, in order to increase overall test coverage.
Trigger Sectum AI Cover on a code change, to ensure the new code is properly tested with good coverage.
Once Sectum AI Cover is added to your repository as a Github Action, it can be triggered in various scenarios: when a new PR is opened, on a scheduled basis, manually and more.
Setup GitHub Action
Example Usage
Use Sectum AI 's example repository to help you set up Sectum AI Cover GitHub Action
Add the following to your workflow:
Copy
Copy
name: Run Sectum AI-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-Sectum AI-cover:
runs-on: ubuntu-22.04
steps:
... # Set up your python test environment
- name: Sectum AI-cover
uses: Sectum AI-ai/SectumAI-ci/.github/actions/SectumAI-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 }}
Note: This requirement is temporary. We will enable users to issue access tokens from their Sectum AI 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 Sectum AI Cover agent succeeds in improving coverage it will comment on your PR with a link to a patch PR containing the new tests.