Show a helpful summary of test results in GitHub Actions CI/CD workflow runs

Overview

Test Summary

Test dashboard: 42 tests passed Test dashboard: 42 tests failed Test dashboard: 42 tests passed, 8 tests failed, 18 tests skipped

Produce an easy-to-read summary of your project's test data as part of your GitHub Actions CI/CD workflow. This helps you understand at-a-glance the impact to the changes in your pull requests, and see which changes are introducing new problems.

  • Integrates easily with your existing GitHub Actions workflow
  • Produces summaries from JUnit XML and TAP test output
  • Compatible with most testing tools for most development platforms
  • Customizable to show just a summary, just failed tests, or all test results.

Getting Started

To set up the test summary action, just add a few lines of YAML to your GitHub Actions workflow. For example, if your test harness produces JUnit XML outputs in the test/results/ directory, and you want to produce a test summary in a file named test-summary.md, add a new step to your workflow YAML after your build and test step:

- name: Test Summary
  uses: test-summary/action@v1
  with:
    paths: "test/results/**/TEST-*.xml"
  if: always()

Update paths to match the test output file(s) that your test harness produces. You can specify glob patterns, including ** to match the pattern recursively. In addition, you can specify multiple test paths on multiple lines. For example:

- name: Test Summary
  uses: test-summary/action@v1
  with:
    paths: |
      test-one/**/TEST-*.xml
      test-two/results/results.tap
  if: always()

Note the if: always() conditional in this workflow step: you should always use this so that the test summary creation step runs even if the previous steps have failed. This allows your test step to fail -- due to failing tests -- but still produce a test summary.

Upload the markdown

The prior "getting started" step generates a summary in GitHub-flavored Markdown (GFM). Once the markdown is generated, you can upload it as a build artifact, add it to a pull request comment, or add it to an issue. For example, to upload the markdown generated in the prior example as a build artifact:

- name: Upload test summary
  uses: actions/upload-artifact@v3
  with:
    name: test-summary
    path: test-summary.md
  if: always()

Examples

There are examples for setting up a GitHub Actions step with many different platforms in the examples repository.

Options

Options are specified on the with map of the action.

  • paths: the paths for input files (required)
    One or more file glob patterns that specify the test results files in JUnit XML or TAP format.

    • To specify a single file, provide it directly as a string value to the paths key. For example:

      - uses: test-summary/action@v1
        with:
          paths: "tests/results.xml"
    • To specify multiple files, provide them as a multi-line string value to the paths key. For example:

      - uses: test-summary/action@v1
        with:
          paths: |
            tests-one/results.xml
            tests-two/results.xml
            tests-three/results.xml
    • You can specify files as a glob patterns, allowing you to use wildcards to match multiple files. For example, to match all files named TEST-*.xml beneath the tests folder, recursively:

      - uses: test-summary/action@v1
        with:
          paths: "test/results/**/TEST-*.xml"
  • output: the output file to create (optional)
    This is the path to the output file to populate with the test summary markdown data. For example:

    - uses: test-summary/action@v1
      with:
        output: "test/results/summary.md"

    If this is not specified, the output will be to the workflow summary.

    This file is GitHub Flavored Markdown (GFM) and may include permitted HTML.

FAQ

  • How is the summary graphic generated? Does any of my data ever leave GitHub?
    None of your data ever leaves GitHub. Test results are read within GitHub Actions by the test-summary action, and a link to an SVG with the test results numbers is created. This the graphic is both fetched and subsequently cached by GitHub's image service. This service provides no referral information to remote hosts. This means that no information at all about your workflow - the repository name, test results, or other information - is available to the image generator service.

Questions / Help / Contact

Have questions? Need help? Visit the discussion forum.

Copyright (c) 2022 Edward Thomson. Available under the MIT license.

Comments
  • Switch to using NodeJS v16 as a action runtime

    Switch to using NodeJS v16 as a action runtime

    NodeJS v12 is EOL and it's been deprecated since April 2022. It will stop being available in GitHub Actions CI/CD workflows by the summer 2023. But it already triggers deprecation warnings that show up on the workflow summary page: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

    This patch fixes that.

    Resolves #15

    opened by webknjaz 5
  • NodeJS 12 deprecation warning pollutes workflow annotations when this action is used

    NodeJS 12 deprecation warning pollutes workflow annotations when this action is used

    $sbj. It is scheduled to stop working by summer 2023. Hopefully, switching the value in action.yml will be enough.

    Refs:

    • https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
    • https://github.com/ansible-community/ansible-test-gh-action/issues/41
    opened by webknjaz 4
  • v2 broken

    v2 broken

    Any attempt to use test-summary/action@v2 results in an error like the following:

    Error: File not found: '/home/runner/work/_actions/test-summary/action/v2/index.js'
    

    I am not an expert on how to release github actions, but I noticed a considerable difference between tags v2 and v2.0 and tags v1 and v1.0:

    https://github.com/test-summary/action/tree/v1

    vs

    https://github.com/test-summary/action/tree/v2

    opened by dil-gschreiber 2
  • An Empty Test File Causes an Error

    An Empty Test File Causes an Error

    I have a TestResults.xml file with empty results

    <testsuites />
    

    This causes the following error:

    Error: unknown test file type for './Artefacts/windows-latest/TestResults.xml'

    opened by RehanSaeed 0
  • More information in case of failures

    More information in case of failures

    Hey, I'm thinking of using the test summary page instead of going through the logs.

    In case of failure the table doesn't provide information enough data in my case. The test name alone is also not enough to understand what actually went wrong. Nesting levels are missing, the test on the screenshot is defined as Paginator - renders links for first page but somehow we get the actual title twice.

    Screenshot 2022-10-09 at 20 14 16

    The test

    describe('<Paginator>', () => {
      it('renders links for first page', () => {
         ...
      })
    

    The report

    <testsuite name="&lt;Paginator&gt;" errors="0" failures="1" skipped="0" timestamp="2022-10-09T18:08:21" time="1.64" tests="6">
        <testcase classname="&lt;Paginator&gt; renders links for first page" name="&lt;Paginator&gt; renders links for first page" time="0.031">
    

    What do you think about adding more info about failures to the output table?

    opened by ertrzyiks 0
  • Support

    Support "error" failures; add Github Actions outputs

    Bazel generates JUnit-like output, but it uses the error key instead of failure. It also does some other silly things with test aggregation, but I didn't dive into that with this PR.

    Also added some Github Actions outputs.

    Changes:

    • support the testsuites.testsuite[].testcase[].error XML node in addition to testsuites.testsuite[].testcase[].failure
    • add Github Actions outputs for passed/failed/skipped/total tests
    • added other outstanding features to the README
      • added the fact that the default output is now job summary
      • added docs for show
    • added docs for new outputs
    • added a Bazel Junit test output file
    • added test coverage for the above
    opened by jcourteau 3
  • `unknown test file type` error thrown

    `unknown test file type` error thrown

    I have a .NET framework project with unit tests running with NUnit. It generates a test result file as NUnitResults.xml. In my GitHub workflow file I have a step for test-summary after running the tests as follows -

    - name: Test Summary
      uses: test-summary/[email protected]
      if: always()
      with:
          paths: "./NUnitResults.xml"
    

    But this steps throws an error as unknown test file type for './NUnitResults.xml'

    Are NUnit Test Results not supported by this action yet?

    opened by Aanchal-Jain-Apica 0
  • [Feature] Support SpotBugs

    [Feature] Support SpotBugs

    SpotBugs can output it's results as XML that could be used for a report. The file looks something like this:

    <?xml version="1.0" encoding="UTF-8"?>
    
    <BugCollection version="4.7.1" sequence="0" timestamp="1660217986614" analysisTimestamp="1660217986614" release="">
      <Project projectName="app (spotbugsMain)">
        <Jar>/*path*/App.class</Jar>
        <Jar>/*path*/ExceptionHandler.class</Jar>
        <AuxClasspathEntry>/*path*/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-configuration-processor/2.7.2/12575686ba3820571ea79bfd08d6d27534b97a0e/spring-boot-configuration-processor-2.7.2.jar</AuxClasspathEntry>
        <AuxClasspathEntry>/*path*/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/4.7.1/50e29adaec8cf4299441a6786a909a0b105326ad/spotbugs-annotations-4.7.1.jar</AuxClasspathEntry>
        <SrcDir>/*path*/src/main/resources</SrcDir>
        <SrcDir>/*path*/src/main/java</SrcDir>
        <Plugin id="com.h3xstream.findsecbugs" enabled="true"/>
      </Project>
      <Errors errors="1" missingClasses="3">
        <Error>
          <ErrorMessage>Exception analyzing *class* using detector com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector</ErrorMessage>
          <Exception>java.lang.IllegalArgumentException: Invalid class name java/lang/String;Ljava/lang/Object</Exception>
          <StackTrace>edu.umd.cs.findbugs.classfile.ClassDescriptor.&lt;init&gt;(ClassDescriptor.java:59)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.classfile.DescriptorFactory.getClassDescriptor(DescriptorFactory.java:128)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.AnalysisCacheToRepositoryAdapter.loadClass(AnalysisCacheToRepositoryAdapter.java:90)</StackTrace>
          <StackTrace>org.apache.bcel.Repository.lookupClass(Repository.java:65)</StackTrace>
          <StackTrace>com.h3xstream.findsecbugs.spring.SignatureParserWithGeneric.typeToJavaClass(SignatureParserWithGeneric.java:75)</StackTrace>
          <StackTrace>com.h3xstream.findsecbugs.spring.SignatureParserWithGeneric.getReturnClasses(SignatureParserWithGeneric.java:60)</StackTrace>
          <StackTrace>com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector.analyzeMethod(SpringEntityLeakDetector.java:112)</StackTrace>
          <StackTrace>com.h3xstream.findsecbugs.spring.SpringEntityLeakDetector.visitClassContext(SpringEntityLeakDetector.java:69)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.FindBugs2.lambda$analyzeApplication$1(FindBugs2.java:1108)</StackTrace>
          <StackTrace>java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.CurrentThreadExecutorService.execute(CurrentThreadExecutorService.java:86)</StackTrace>
          <StackTrace>java.base/java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:242)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1118)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:395)</StackTrace>
          <StackTrace>edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1231)</StackTrace>
        </Error>
        <MissingClass>apply</MissingClass>
        <MissingClass>makeConcatWithConstants</MissingClass>
        <MissingClass>test</MissingClass>
      </Errors>
      <FindBugsSummary timestamp="Thu, 11 Aug 2022 14:39:46 +0300" total_classes="0" referenced_classes="0" total_bugs="0" total_size="0" num_packages="0" java_version="11.0.15" vm_version="11.0.15+0" cpu_seconds="10.43" clock_seconds="3.11" peak_mbytes="278.01" alloc_mbytes="4096.00" gc_seconds="0.05">
        <FindBugsProfile></FindBugsProfile>
      </FindBugsSummary>
      <ClassFeatures></ClassFeatures>
      <History></History>
    </BugCollection>
    
    opened by jtiala 0
Releases(v2.0)
  • v2.0(Oct 14, 2022)

    What's Changed

    • Switch to using NodeJS v16 as a action runtime by @webknjaz in https://github.com/test-summary/action/pull/17
    • Use HTTPS to link SVG images by @webknjaz in https://github.com/test-summary/action/pull/16

    New Contributors

    • @webknjaz made their first contribution in https://github.com/test-summary/action/pull/17

    Full Changelog: https://github.com/test-summary/action/commits/v2.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0(May 9, 2022)

    Initial release of Test Summary Action

    Test dashboard: 42 tests passed Test dashboard: 42 tests failed Test dashboard: 42 tests passed, 8 tests failed, 18 tests skipped

    Produce an easy-to-read summary of your project's test data as part of your GitHub Actions CI/CD workflow. This helps you understand at-a-glance the impact to the changes in your pull requests, and see which changes are introducing new problems.

    • Integrates easily with your existing GitHub Actions workflow
    • Produces summaries from JUnit XML and TAP test output
    • Compatible with most testing tools for most development platforms
    • Customizable to show just a summary, just failed tests, or all test results.

    For more information, and how to get started, visit https://github.com/test-summary/action.

    Source code(tar.gz)
    Source code(zip)
Owner
Test Summary
Test results summaries for GitHub Actions CI/CD workflows
Test Summary
Create a badge using GitHub Actions and GitHub Workflow CPU time

Generated Badges Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers) Install $ npm i generated-badges -g Command

小弟调调™ 9 Dec 30, 2022
Re-run failed GitHub Workflow runs on PRs by commenting "/retest".

Retest GitHub Action If you run GitHub Actions Workflows on your PRs, install this action to re-run failed workflow runs for the latest commit by comm

JP Simard 5 Aug 24, 2022
Deploy an Architect project from GitHub Actions with keys gathered from aws-actions/configure-aws-credentials

Deploy an Architect project from GitHub Actions with keys gathered from a specific AWS IAM Role federated by an IAM OIDCProvider. CloudFormation to cr

Taylor Beseda 4 Apr 6, 2022
An API that allows you to scrape blog posts and articles and get a list of notes or a summary back.

EZAI-Web-Scraper An API that allows you to scrape blog posts and articles and get a list of notes or a summary back. Recommendations Use browserless.i

null 9 Dec 8, 2022
A list of helpful front-end related questions you can use to interview potential candidates, test yourself or completely ignore.

Front-end Developer Interview Questions This repository contains a number of front-end interview questions that can be used when vetting potential can

H5BP 56.1k Jan 4, 2023
Workflow to re-trigger workflow of all open PRs when base updates

Workflow to re-trigger workflow of all open PRs when base updates

James Tan 4 Aug 28, 2022
🔎 (Draft!) VSCode extension to show the search results in a tree view

vscode-search-tree ?? (Draft!) VSCode extension to show the search results in a tree view The work on this extension is on-pause for now since VSCode

Oleksii Trekhleb 16 Sep 7, 2022
This repository contains a basic example on how to set up and run test automation jobs with CircleCI and report results to Testmo.

CircleCI test automation example This repository contains a basic example on how to set up and run test automation jobs with CircleCI and report resul

Testmo 2 Dec 23, 2021
Example-browserstack-reporting - This repository contains an example of running Selenium tests and reporting BrowserStack test results, including full CI pipeline integration.

BrowserStack reporting and Selenium test result example This repository contains an example of running Selenium tests and reporting BrowserStack test

Testmo 1 Jan 1, 2022
A Docusaurus website deployed to GitHub Pages using GitHub Actions.

Deploy Docusaurus website to GitHub Pages using GitHub Actions This repository is an example of deploying a Docusaurus website to GitHub Pages using G

Lars Gyrup Brink Nielsen 18 Dec 26, 2022
TVMAZE API-based webapp, receives TV show episodes with all data about that TV show.

TVMAZE API-based webapp, receives TV show episodes with all data about that TV show. The Webapp has two interfaces: A home page, showing a list of Tv show episodes you can like. And a popup window with more data about the TV show that you can comment on.

Yasin Warsame 4 Aug 9, 2022
🎤Rickroll in style - This uses a GitHub action that runs a NodeJS script, found in src.

This uses a GitHub action that runs a NodeJS script, found in src. This then commits the finished HTML to index.html, and then GitHub Pages will build that HTML file, allowing you to rickroll your friends.

Blue 5 Sep 25, 2022
Helpful for-loop shorthands in JavaScript

Optimized.JS This package aims to optimize your JavaScript where speed it critical. It has long been known that the JS for-loop is the fastest method

E 1 Jan 21, 2022
VSCode extension with helpful code snippets for SolidJS.

Solid Snippets VSCode extension with helpful code snippets for SolidJS. GET THE EXTENSION Snippets Trigger Content Languages JSX sinput→ Input two-way

SolidJS Community 11 Dec 8, 2022
A community-led experiment to build better docs and helpful content :)

Website This website is built using Docusaurus 2, a modern static website generator. Installation $ npm Local Development $ npm start This command s

Battlesnake Official 9 Jan 1, 2023
Statistics plugin for RemNote that will give you some helpful numbers, charts and heatmap for your knowledge base.

RemNote statistics plugin Features This plugin will give you the following statistics: Retention rate Number of cards due in future Type of buttons yo

Henrik 3 Sep 9, 2022
An interactive Bitcoin tutorial for orange-pilled beginners. Illustrates technical Bitcoin concepts using JavaScript and some Bitcoin Core RPC commands. Programming experience is helpful, but not required.

Try Bitcoin Try Bitcoin is an interactive Bitcoin tutorial inspired by and forked from Try Regex, which is inspired by Try Ruby and Try Haskell. It il

Stacie Waleyko 33 Nov 25, 2022
This is my first website. It has helpful information, games, lots of pages & more.

Mitko.Vtori World This is my first website. It has helpful information, games, lots of pages & more. ?? Presentation & Introduction Here's link to my

Dimitar Dimitrov 29 Dec 30, 2022
An example implementation of the slack-gpt starter which ingests confluence pages to create a helpful slack bot

Slack-GPT (HR bot example implementation) Table of Contents Introduction Prerequisites Creating and installing the application Configuration Starting

Martin Hunt 17 Jul 31, 2023