Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do show my tests passing/failing in Github?

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)?
like image 814
mikemaccana Avatar asked Nov 24 '12 22:11

mikemaccana


People also ask

How do I create a GitHub badge?

To generate a badge for your project, you first need to add the Depfu app to your GitHub account and then visit this link to generate the badge, as shown in the image below: Once all the needed badges are generated, you can copy the URLs' or the badges' markdown text and add it to the top of the readme file.

Should I test my repository?

Yes, you should test your repository layer. Although the majority of these tests fall into a different classification of tests. I usually refer to them as integration tests to distinguish them from my unit tests.


2 Answers

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.

like image 92
relekang Avatar answered Dec 06 '22 07:12

relekang


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.

like image 41
VonC Avatar answered Dec 06 '22 08:12

VonC