How do show my tests passing/failing in Github?

Unit TestingGithubContinuous Integration

Unit Testing Problem Overview


I have a project on github that has extensive unit tests (using mocha for node.js).

I'd like to show off by showing those tests passing/failing on each page. I notice other projects on Github are doing this.

enter image description here

I've been unable to find any documentation on how to make the test status display.

  • How can I make Github show unit test output?
  • Does Github run the tests or do you need to hook up with an external webapp?
  • Is there a free webservice to do this (my app is Open Source)?

Unit Testing Solutions


Solution 1 - Unit Testing

Take a look at Travis CI. You can use it with GitHub.

They have docs on using NodeJS

Those badges you see are called "status images" and Travis provides MarkDown that you can insert into your project's README.md file.

Solution 2 - Unit Testing

Note that since April 26th 2013, you can see the build status on your GitHub repo branch page:

build status on GitHub repo branches

The Commit Status API allows you to use that elsewhere: see " Repo Statuses API".

Starting April 30th, 2013, the API endpoint for commit statuses has been extended to allow branch and tag names, as well as commit SHAs.

Solution 3 - Unit Testing

CircleCI the status badges are also simply images that you can drop into your README.md file with the markdown. For example:

![Build Status](https://circleci.com/gh/<your github name>/<repo name>.png?circle-token=:circle-token)

or

![Build Status](https://circleci.com/gh/<your github name>/<repo name>.svg?style=shield&circle-token=:circle-token)

Solution 4 - Unit Testing

Yes I'm quite sure you mean something like Jenkins or Travis-CI. They work on your github account! On every commit the tests are executed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmikemaccanaView Question on Stackoverflow
Solution 1 - Unit TestingrelekangView Answer on Stackoverflow
Solution 2 - Unit TestingVonCView Answer on Stackoverflow
Solution 3 - Unit TestingmjhmView Answer on Stackoverflow
Solution 4 - Unit TestingcruxiView Answer on Stackoverflow