CodeAnt AI Coverage Upload for GitLab
Upload test coverage reports to CodeAnt AI for comprehensive analysis, visualization, and tracking of your code coverage metrics.Features
- 📊 Upload coverage reports in multiple formats (XML, JSON, LCOV, etc.)
- 🔍 Automatic coverage analysis and insights
- 📈 Track coverage trends over time
- 🎯 Integration with merge requests
- 🚀 Easy setup with minimal configuration
Usage
Basic Example
Advanced Example
Inputs
Variable | Description | Required | Default |
---|---|---|---|
ACCESS_TOKEN | GitLab Access Token for authentication | Yes | - |
COVERAGE_FILE | Path to the coverage file (e.g., coverage.xml, coverage.json) | Yes | coverage.xml |
API_BASE | CodeAnt AI API base URL | No | https://api.codeant.ai |
PLATFORM | Git platform (github, gitlab, bitbucket) | No | gitlab |
BASE_URL | Base URL of the git platform | No | $ |
Supported Coverage Formats
- Cobertura XML (.xml)
- JaCoCo XML
- LCOV (.lcov)
- JSON coverage reports
- And more…
Setup
1. Generate Coverage Report
First, ensure your test suite generates a coverage report. Here are examples for common languages: Python (pytest)2. Add CI/CD Variables
Add your CodeAnt AI access token to your GitLab project:- Go to your repository Settings
- Navigate to CI/CD > Variables
- Click “Add variable”
- Key:
ACCESS_TOKEN
- Value: Your CodeAnt AI access token
- Protected: Yes (recommended)
- Masked: Yes (recommended)
3. Configure Pipeline
Add the template to your.gitlab-ci.yml
as shown in the usage examples above.
How It Works
- The job fetches the latest coverage upload script from CodeAnt AI
- Decodes and prepares the script for execution
- Uploads your coverage report along with commit and branch information
- CodeAnt AI processes the report and provides analysis
Examples
Python Project
Node.js Project
Java Project
Multiple Coverage Files
Troubleshooting
Coverage file not found- Ensure the
COVERAGE_FILE
path is correct and the file exists as an artifact from a previous job.
- Verify that your
ACCESS_TOKEN
is valid and has the necessary permissions in GitLab CI/CD variables.
- Check that the CodeAnt AI API is accessible from your runner environment.
Contributing
Contributions are welcome! Please feel free to submit a Merge Request.License
This project is licensed under the MIT License - see the LICENSE file for details.Support
- 📧 Email: support@codeant.ai
- 📚 Documentation: https://docs.codeant.ai
- 🐛 Issues: https://gitlab.com/codeant-pipelines/code-coverage-gitlab
Related
- CodeAnt AI - AI-powered code analysis platform
- GitLab CI/CD Documentation