{"id":29,"date":"2007-02-05T16:49:47","date_gmt":"2007-02-05T15:49:47","guid":{"rendered":"http:\/\/blogs.igalia.com\/itoral\/?p=29"},"modified":"2007-02-05T16:49:47","modified_gmt":"2007-02-05T15:49:47","slug":"gnome-buildbot-and-integration-of-unit-tests","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/itoral\/2007\/02\/05\/gnome-buildbot-and-integration-of-unit-tests\/","title":{"rendered":"Gnome buildbot and integration of unit tests"},"content":{"rendered":"<p>Using <a title=\"Buildbot\" target=\"_blank\" href=\"http:\/\/buildbot.sourceforge.net\/\">buildbot<\/a> you can include a &#8220;make check&#8221; step in your automatic build process.This way you can realize if your tests succeed or fail on each automatic build. This is very useful, along with the option to include references to the commits made to the projet repository, to find out what commit broke something.<\/p>\n<p>When something goes wrong with the tests, the first step is to find out what is actually failing. To do this, buildbot provides a complete text log with all the stdout generated by the &#8220;make check&#8221; command. Although this may be enough for developers, it is not very confortable, you have to explore by hand a complete text log looking for the test(s) that have failed, skipping passed tests and any other kind of (maybe) irrelevant output generated by the tests.<br \/>\nIn order to make this easier, I&#8217;ve playing a little with the <a title=\"Dape's post about a prototype for a Gnome buildbot\" target=\"_blank\" href=\"http:\/\/blogs.igalia.com\/dape\/2006\/10\/03\/first-jhbuild-buildbot-prototypes-online\/\">gnome-buildbot<\/a> setup by <a title=\"Dape's blog\" target=\"_blank\" href=\"http:\/\/blogs.igalia.com\/dape\">Dape<\/a> some time ago, trying to add the capability to parse the tests output and generate a more visual and efficient html report with a summary of the tests and the error messages.<\/p>\n<p>This parser looks for strings like: &#8220;PASS: &#8221; or &#8220;FAIL: &#8220;, which are the regular automake output for each test program executed. Besides, I&#8217;ve also included support for <a title=\"Check's home page\" target=\"_blank\" href=\"http:\/\/check.sourceforge.net\/\">Check<\/a> based unit tests, so you can get a detail of each unit tests done for each test program.<\/p>\n<p>Let&#8217;s see this with an example, in the following image one can see the buildbot automated building of the <a title=\"GTK+ home page\" target=\"_blank\" href=\"http:\/\/www.gtk.org\">gtk+<\/a> project. In orange you can see the tests phase, which is actually the result of executing &#8220;make check&#8221;, previously, I&#8217;ve added a set of Check based tests to the project. The orange color of that phase means there are failed tests. Besides the number of passed and failed tests one can see a link to the buildbot plain text stdout log and a link to access the html summary report.<\/p>\n<p align=\"left\">\n<div style=\"text-align: center\"><img decoding=\"async\" alt=\"Waterfall view with tests phase\" src=\"http:\/\/blogs.igalia.com\/itoral\/files\/2007\/02\/waterfall.png\" \/><\/div>\n<p>In the next image one can see a piece of the html report with the tests summary, which shows one table per test done. The table title is the name of the test as prompted by automake and each table row is a single test (done with Check) in that test program. If you do not use Check for your unit tests, then you&#8217;d only get the table titles. Of course, green means test passed, red means test failed ;). In case a test fails, the error message is shown too.<\/p>\n<div style=\"text-align: center\"><img decoding=\"async\" alt=\"Tests summary report\" src=\"http:\/\/blogs.igalia.com\/itoral\/files\/2007\/02\/testsdetail.png\" \/><\/div>\n<p>Finally, for an easy access to the tests of interest, I&#8217;ve added a header table with links to each test detail in the report:<\/p>\n<div style=\"text-align: center\"><img decoding=\"async\" alt=\"Tests summary report header\" src=\"http:\/\/blogs.igalia.com\/itoral\/files\/2007\/02\/testsdetailheader.png\" \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Using buildbot you can include a &#8220;make check&#8221; step in your automatic build process.This way you can realize if your tests succeed or fail on each automatic build. This is very useful, along with the option to include references to the commits made to the projet repository, to find out what commit broke something. When &hellip; <a href=\"https:\/\/blogs.igalia.com\/itoral\/2007\/02\/05\/gnome-buildbot-and-integration-of-unit-tests\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Gnome buildbot and integration of unit tests&#8221;<\/span><\/a><\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":0,"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/itoral\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}