|
QuickBuild 2.0 Documentation
|
Variation renderer is used to compare to the report generated from the previous build. For example, for test reports, we want to know how many tests have been added, how many tests have been fixed, and how many tests still haven't been fixed. ScreenShot: JUnit Overview Following is a common variation definition which is part of the JUnit plugin setting: <renderer type="variation" title="Overview" source="testcase" lastSuccessful="false"> <status>currentStatus = current.getValue("status"); previousStatus = previous.getValue("status"); if (!currentStatus.equals(previousStatus)) { if (currentStatus.equals("success")) return "Fixed Tests" else return "New Failed Tests"; } else { if (!currentStatus.equals("success")) return "Not Fixed Tests"; else return null; } </status> <childTitle>${if (status.equals("New")) return "New Added Tests"; else if (status.equals("Removed")) return "Removed Tests"; else return status;}</childTitle> <field source="name" title="Total Tests"/> <field source="time" title="Total Duration"/> <renderer type="table"> <column type="Id"/> <column type="Enum" title="Status" sortBy="status"> <field source="status" title="Status"/> </column> <column type="Text" title="Test Case" sortBy="classname" escape="false"> <field> <expression><![CDATA[ <h3 style="color:#333;">${getValue("name")}</h3> <p style="color:#666;">In: ${getValue("classname")}</p> ]]></expression> </field> </column> <column type="Text" title="Duration" sortBy="time"> <field source="time" title="Duration"/> <dropdown type="stats" source="time" maxBuilds="10"/> </column> </renderer> </renderer> 'status' ElementThe 'status' element is the core for variation renderer which tell the renderer how to distinguish the difference between current report and previous report. By default, QuickBuild only has "New", "Removed", and "Changed" and "UnChanged" status of each row. And via 'status' element, arbitary status can be set via expression. The context of the expression is 'current' and 'previous' which means the row of current report and previous report. <status>if (current.getValue("status").equals(previous.getValue("status")) return null; else return "Status Changed"; </status> 'showStatus'The attribute(/element) in the renderer is used to detect which status will be rendered. For example: <renderer type="variation" showStatus="New Added Tests, Fixed Tests, Not Fixed Tests"> ... </renderer> When there are multiple status should be displayed, use comma ',' to separate them. 'childTitle' ElementThe variation renderer will render different sections by iterating all displayable status. By default, the title will use the status. By defining the 'childTitle' element, arbitrary title can be specified via using interpolate string. 'field' ElementThe 'field' element is used to add a statistics scorecard item. The 'source' attribute should be defined in the report meta data. 'renderer' ElementVariation renderer need one 'renderer' element to render the each section. |
8.3.5 Variation Renderer
(None)
