Seamlessly send test reports to your preferred messaging platforms.
Webhook Reporter is a versatile GitHub Action designed to generate and send detailed test coverage and test result reports to multiple messaging platforms. It seamlessly parses coverage and test result data, standardizes the reports, and delivers them through webhooks to platforms such as Discord, Slack, or Microsoft Teams.
Development teams rely on test coverage and results to maintain code quality and catch issues early. However, this critical data often stays buried in CI/CD logs or requires team members to actively check dashboards. Webhook Reporter solves this by:
- π¬ Bringing insights where teams collaborate: Automatically delivers test results and coverage metrics directly to Slack, Discord, or Microsoft Teams - where your team already works
β οΈ Maintaining code quality standards: Instantly alerts teams when coverage drops below thresholds or tests fail, enabling quick responses to potential issues- π Simplifying complex data: Transforms various test report formats (Cobertura, JaCoCo, Clover) into clear, actionable summaries
- β Supporting confident releases: Provides immediate visibility into test health across your codebase after each commit or PR
- β³ Saving developer time: Eliminates manual checking of coverage reports and test results across different tools and formats
- Supports multiple platforms: Discord, Slack, Microsoft Teams
- Parses test results and coverage data: Compatible with JaCoCo, Cobertura, Clover, etc.
- Generates unified reports: Combines test results and coverage into a single output.
- Easy integration: Works with any GitHub Actions workflow.
Discord | Slack | Teams |
---|---|---|
Test and coverage summary delivered to Discord |
Test and coverage summary delivered to Slack |
Test and coverage summary delivered to Teams |
To use this action in your workflow add it like so:
steps:
- name: Webhook Reporter
uses: your-username/webhook-reporter@v1.0.0
with:
webhook_url: ${{ secrets.WEBHOOK_URL }}
provider: 'discord' # 'discord', 'slack', or 'teams'
coverage_file: 'path/to/coverage.xml'
test_results_file: 'path/to/test-results.xml'
# This action will parse the provided files and send a report to the specified webhook URL. Ensure the files are generated before this step.
# If any file is missing or an error occurs during processing, the action will log the issue for troubleshooting.
Note: π Ensure your webhook URL is stored securely as a GitHub Secret (e.g.,
WEBHOOK_URL
).
Input | Description | Required | Default |
---|---|---|---|
webhook_url |
Webhook URL for the target messaging platform | Yes | N/A |
provider |
Messaging platform (discord , slack , teams ) |
Yes | N/A |
coverage_file |
Path to the coverage report (e.g., coverage.xml ) |
Yes | N/A |
test_results_file |
Path to the test results report (e.g., test-results.xml ) |
No | N/A |
coverage_threshold |
The coverage threshold you want to mark against your tests | No | N/A |
Webhook Reporter works with any testing framework that produces standard coverage and test result formats. For comprehensive insights into your project's health, we'll help you generate both coverage and test results files.
Format | Description | Common Frameworks |
---|---|---|
Cobertura XML | Industry-standard coverage format | Pytest, Jest, .NET |
JaCoCo XML | Java-ecosystem coverage format | Java frameworks using JaCoCo |
Clover XML | Alternative coverage format | Jest, PHP frameworks |
Format | Description | Common Frameworks |
---|---|---|
JUnit XML | Universal test result format | Most testing frameworks |
JSON | Modern test output format | Jest, modern JavaScript frameworks |
JavaScript (Jest)
First, install the necessary dependencies:
npm install --save-dev jest-junit
Add to your package.json
:
"jest-junit": {
"outputDirectory": "./test-results",
"outputName": "test-results.xml"
}
jest --coverage --coverageReporters=cobertura --testResultsProcessor=jest-junit
This generates:
- Coverage report:
coverage/cobertura-coverage.xml
- Test results:
test-results/test-results.xml
Jest can also output coverage in Clover format:
jest --coverage --coverageReporters=clover
Note: You only need either Cobertura OR Clover format - pick the one that best suits your needs.
Python (Pytest)
pip install pytest-cov pytest-junit
pytest --cov=your_package --cov-report=xml:coverage.xml --junitxml=test-results.xml
This command:
- Runs pytest with coverage enabled
- Generates Cobertura-compatible coverage report (
coverage.xml
) - Outputs test results in JUnit format (
test-results.xml
)
The command will handle both coverage generation and test results output in formats that Webhook Reporter can process.
Java (JaCoCo)
Configure your Maven build tool for JaCoCo as follows:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
For test results, add the Surefire plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
mvn clean test
This will generate:
- Coverage report in JaCoCo's native XML format:
target/site/jacoco/jacoco.xml
- Test results in JUnit format:
target/surefire-reports/TEST-*.xml
.NET (Cobertura)
dotnet add package coverlet.collector
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
This generates:
- Coverage report in Cobertura format:
coverage.cobertura.xml
- Test results are typically generated in the Visual Studio Test Platform's TRX format
Other Frameworks
Your framework should output one of these formats:
- Coverage: Cobertura XML, JaCoCo XML, or Clover XML
- Test Results: JUnit XML or JSON
Many frameworks can output to these formats through plugins or configuration. If your framework doesn't support these formats directly, consider:
- Looking for coverage/reporting plugins that support these formats
- Using a format converter tool
- Creating a custom reporter that outputs in one of the supported formats
see: Contribution.md
This project is licensed under the MIT License - see the LICENSE file for details.