Testing shell code and producing TAP using Jenkins?
Definitely reading Hacker News before going to bed is a bad idea :-) Same goes for Reddit. So, I found a link about Bats, a tool to execute tests in Shell and output TAP - Test Anything Protocol. Then I thought; why not ask the author to include Bats under the list of Producers in testanything.org?
But you know what? Why not execute execute locally first to check if that’s working… moreover, why not use Jenkins TAP Plug-in and see what happens?
Here’s what is necessary.
- Jenkins (duh)
- tap plug-in
- git plug-in
- Bats git repository URL
- Baden Baden Red Ale beer (it's Friday, almost new years' eve, c'mon)
Before executing the build, you have to check the option to publish TAP results in the end of the configuration screen. That’s it. Execute your job, chug the remaining of your beer and now you can go to bed… or just refresh Hacker News and Reddit once more…
Bats is a very nice TAP producer for Shell. Haven’t had time to play with the other producers for Shell, or explore Bats thoroughly, but it looks very promising. Hope to see more people writing tests for shell code.