GitHub - ctrf-io/github-test-reporter: Publish and view test reporting directly in your GitHub Actions CI/CD workflow and Pull Requests with detailed test summaries, failed test analyses, and flaky test detection. (original) (raw)

Publish and View Test Results Reports in Github Actions

Integrate Test Reporting into Your GitHub Actions Workflow

A GitHub test reporting tool that supports all major testing frameworks. Generate, publish and alert your team with detailed test results, including summaries, in-depth reports, failed test analyses, flaky test detection and AI analyses directly within your GitHub Actions CI/CD workflow and Pull Requests.

Choose from a variety of pre-built reports or create custom reports tailored to your project's needs, ensuring that test results are always where you need them.

Support Us

GitHub Test Reporter is community-built and open source.

You can support the project by:

Key Features

🧩 Post anywhere: job summaries, pull requests, checks, issues, inline annotations, and other developer tools

📊 Built-in insights: failures, flaky tests, and duration trends across hundreds of runs

🧘 Super flexible: start fast with powerful built-in reports or go fully custom with your own templates

🤖 AI summary: summarize test results with AI and get explanations of them with contextual insights

🔌 Framework-agnostic: works with any testing tool

Table of Contents

  1. Basic Usage
  2. Insights Usage
  3. Pull Request Comment Usage
  4. Super Flexible Usage
  5. Report Showcase
  6. Generate a report
  7. Available Inputs
  8. Pull Requests
  9. Status Checks
  10. Build Your Own Report
  11. Customizing Report Order
  12. Community Reports
  13. GitHub Token
  14. Storing Artifacts
  15. Filtering
  16. Integrations
  17. What is CTRF?

Basic Usage

To get started quickly add the following to your workflow file:

Add upload-artifact: true, fetch-previous-results: true and a GITHUB_TOKEN to enable comparisons.

GitHub Test Reporter

Insights Usage

To get started with multi run insights on failures, flakiness and test duration, add the following to your workflow file:

This will create a job summary with insights on failures, flakiness and test duration.

GitHub Test Reporter

Pull Request Comment Usage

To get started with pull request comments, add the following to your workflow file:

Make sure your GitHub Token has pull request write permission.

This will create a pull request comment with a summary of the test results.

GitHub Test Reporter

GitHub Test Reporter

Super Flexible Usage

These are just a few examples of the many ways the GitHub Test Reporter can be used. It is super flexible and can be used in a variety of ways. Continue reading to learn more about the many features and options available.

Report Showcase

There are a variety of built-in reports to choose from. Checkout the built-in reports

Generate a report

You need a CTRF or JUnit report.

This reporter works best with CTRF as it's packed with modern properties. CTRF reporters are available for most testing frameworks and easy to install.

For more details on using JUnit, see JUnit integration instructions

Don't see a reporter for your testing framework? Consider contributing 💚

Available Inputs

For more advanced usage, there are several inputs available.

Only report-path is required.

You can add a pull request comment by using the pull-request-report input:

This uses the built-inpull request comment report.

Additionally, you can add any report to a pull request comment by adding thepull-request input:

The pull-request input works with all reports, including custom.

requires a GITHUB_TOKEN with pull request write permission.

Note: Special considerations apply to pull requests from forks. See Fork Pull Requests for details.

You can also comment on a specific issue or pull request by using the issueinput and providing the issue number ():

Requires a GITHUB_TOKEN with issue or pull request write permission.

Comment Management Inputs

update-comment An existing tagged comment is found, the new report is appended to it. Otherwise, a new comment is created.

overwrite-comment An existing tagged comment is found, that comment's entire content is replaced with the new report. Otherwise, a new comment is created.

always-latest-comment Create a new comment if the existing comment is not the latest in the thread. Use with update-comment or overwrite-comment. Default is false

comment-tag A unique identifier for comments posted. Used to find and update/overwrite existing comments.

For example, the following command creates or updates a comment tagged with the current workflow and job names:

Status Checks

The status-check input creates a status check for the workflow.

Requires a GITHUB_TOKEN with status check write permission.

Build Your Own Report

The custom-report input lets you build your own report using a Handlebars template. The template can include any markdown content and leverage data from your CTRF report and GitHub properties, allowing for dynamic and customizable report.

Add the following to your workflow file:

For detailed instructions on building your own report, see thedocumentation.

For inspiration, check out the built-in reports andcommunity reports

Community Reports

We welcome and encourage contributions of community-built reports. Community reports allow users to share custom reports designed for specific use cases.

To submit a community-built report create a Pull Request.

You can see available community built reports

Add the following to your workflow file:

Customizing Report Order

The GitHub Test Reporter allows you to customize the order in which reports appear in your job summary or pull request comments. This feature gives you complete control over how your test results are presented. To customize the order of reports, use the report-order parameter with a comma-separated list of report types:

If report-order is not provided, a default order is used.

GitHub Token

previous-results-report, insights-report, flaky-rate-report, fail-rate-report, and slowest-report need a GITHUB_TOKEN:

Storing Artifacts

Some reports require you to store CTRF reports as artifacts, use theupload-artifact input for full capabilities:

Filtering

previous-results-report, flaky-rate-report and fail-rate-report filter previous results as follows:

This ensures that you only see workflow runs that are related to your current branch or pull request

Baseline Reports

You can specify a baseline report to use for delta and metrics comparison using the baseline or baseline-report-path inputs.

Integrations

CTRF tooling offers seamless developer tool integration, allowing you to combine the GitHub Test Reporter with the following tools:

Integration Description Repository
Slack Test Reporter Send test results and notifications to Slack channels ctrf-io/slack-test-reporter
Microsoft Teams Test Reporter Post test results and alerts to Teams channels ctrf-io/teams-test-reporter
AI Test Reporter Intelligent test analysis using leading AI models ctrf-io/ai-test-reporter

For detailed information about configuring and using these integrations, see our Integrations Documentation.

Integrations are currently in beta. Please report any issues to the GitHub Test Reporter repository.

Generating an AI Report

You can generate human-readable AI report for your failed tests using models from the leading AI providers by using the AI Test Reporter integration or the AI Test Reporter directly.

Further Processing

You can further process the CTRF report by using the output report from the action or by using the write-ctrf-to-file input. For reports larger than 1MB, consider using the write-ctrf-to-file input.

This exposes the internal processed CTRF report that is enriched with properties used by the github test reporter.

What is CTRF?

A test results report schema that provides a standardized format for JSON test reports.

Consistency Across Tools: Different testing tools and frameworks often produce reports in varied formats. CTRF ensures a uniform structure, making it easier to understand and compare reports, regardless of the testing tool used.

Language and Framework Agnostic: It provides a universal reporting schema that works seamlessly with any programming language and testing framework.

Facilitates Better Analysis: With a standardized format, programatically analyzing test outcomes across multiple platforms becomes more straightforward.

Support Us

If you find this project useful, consider giving it a GitHub star ⭐ It means a lot to us.