added pending step to reports and charts and colour coded report level legend

This commit is contained in:
Kingsley Hendrickse 2012-05-26 08:09:05 +01:00
parent 23ca8f06a0
commit ccf909f856
10 changed files with 83 additions and 44 deletions

View File

@ -78,7 +78,8 @@ public class FeatureReportGenerator {
context.put("total_passes", getTotalPasses());
context.put("total_fails", getTotalFails());
context.put("total_skipped", getTotalSkipped());
context.put("chart_data", XmlChartBuilder.donutChart(getTotalPasses(), getTotalFails(), getTotalSkipped()));
context.put("total_pending", getTotalPending());
context.put("chart_data", XmlChartBuilder.donutChart(getTotalPasses(), getTotalFails(), getTotalSkipped(), getTotalPending()));
context.put("time_stamp", timeStamp());
context.put("total_duration", getTotalDuration());
context.put("jenkins_base", pluginUrlPath);
@ -139,6 +140,7 @@ public class FeatureReportGenerator {
context.put("total_passes", getTotalTagPasses());
context.put("total_fails", getTotalTagFails());
context.put("total_skipped", getTotalTagSkipped());
context.put("total_pending", getTotalTagPending());
context.put("chart_data", XmlChartBuilder.StackedColumnChart(allTags));
context.put("total_duration", getTotalTagDuration());
context.put("time_stamp", timeStamp());
@ -287,6 +289,10 @@ public class FeatureReportGenerator {
return Util.findStatusCount(totalSteps, Util.Status.SKIPPED);
}
private int getTotalPending(){
return Util.findStatusCount(totalSteps, Util.Status.UNDEFINED);
}
private int getTotalTagPasses() {
int passes = 0;
for (TagObject tag : allTags) {
@ -311,6 +317,14 @@ public class FeatureReportGenerator {
return skipped;
}
private int getTotalTagPending(){
int pending = 0;
for (TagObject tag : allTags) {
pending += tag.getNumberOfPending();
}
return pending;
}
private List<Util.Status> getAllStepStatuses() {
List<Util.Status> steps = new ArrayList<Util.Status>();
for (Feature feature : allFeatures) {

View File

@ -18,8 +18,8 @@ public class Runner {
FeatureReportGenerator featureReportGenerator = new FeatureReportGenerator(list,rd,"","7","cucumber-jvm",true,true);
featureReportGenerator.generateReports();
boolean result = featureReportGenerator.getBuildStatus();
System.out.println("status: " + result);
// boolean result = featureReportGenerator.getBuildStatus();
// System.out.println("status: " + result);
}
}

View File

@ -75,6 +75,10 @@ public class TagObject {
public int getNumberOfSkipped() {
return Util.findStatusCount(getStatuses(), Util.Status.SKIPPED);
}
public int getNumberOfPending() {
return Util.findStatusCount(getStatuses(), Util.Status.UNDEFINED);
}
private List<Util.Status> getStatuses(){
List<Util.Status> statuses = new ArrayList<Util.Status>();

View File

@ -4,13 +4,13 @@ import java.util.List;
public class XmlChartBuilder {
public static String donutChart(int total_passed, int total_failed, int total_skipped){
public static String donutChart(int total_passed, int total_failed, int total_skipped, int total_pending){
// I was going to use XMLBuilder to generate the chart - but it's so long and boring and I already have the xml so .....
return "<chart><chart_data><row><null/><string>Passed</string><string>Failed</string><string>Skipped</string></row><row><string></string><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_passed + "</number><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_failed + "</number><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_skipped + "</number></row></chart_data><chart_label shadow='low' color='ffffff' alpha='95' size='10' position='inside' as_percentage='true' /><chart_pref select='true' /><chart_rect x='90' y='85' width='300' height='175' /><chart_transition type='scale' delay='1' duration='.5' order='category' /><chart_type>donut</chart_type><draw><rect transition='dissolve' layer='background' x='60' y='100' width='360' height='150' fill_alpha='0' line_color='ffffff' line_alpha='25' line_thickness='40' corner_tl='40' corner_tr='40' corner_br='40' corner_bl='40' /><circle transition='dissolve' layer='background' x='240' y='150' radius='150' fill_color='ccddff' fill_alpha='100' line_thickness='0' bevel='bg' blur='blur1' /><rect transition='dissolve' layer='background' shadow='soft' x='80' y='10' width='320' height='35' fill_color='ddeeff' fill_alpha='90' corner_tl='10' corner_tr='10' corner_br='10' corner_bl='10' /></draw><filter><shadow id='low' distance='2' angle='45' color='0' alpha='40' blurX='5' blurY='5' /><shadow id='high' distance='5' angle='45' color='0' alpha='40' blurX='10' blurY='10' /><shadow id='soft' distance='2' angle='45' color='0' alpha='20' blurX='5' blurY='5' /><bevel id='data' angle='45' blurX='5' blurY='5' distance='3' highlightAlpha='15' shadowAlpha='25' type='inner' /><bevel id='bg' angle='45' blurX='50' blurY='50' distance='10' highlightAlpha='35' shadowColor='0000ff' shadowAlpha='25' type='full' /><blur id='blur1' blurX='75' blurY='75' quality='1' /></filter><context_menu full_screen='false' /><legend transition='dissolve' x='90' width='300' bevel='low' fill_alpha='0' line_alpha='0' bullet='circle' size='12' color='000000' alpha='100' /><series_color><color>88dd11</color><color>cc1134</color><color>88aaff</color></series_color><series_explode><number>25</number><number>0</number><number>0</number></series_explode><series transfer='true' /></chart>";
return "<chart><chart_data><row><null/><string>Passed</string><string>Failed</string><string>Skipped</string><string>Pending</string></row><row><string></string><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_passed + "</number><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_failed + "</number><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_skipped + "</number><number shadow='high' bevel='data' line_color='FFFFFF' line_thickness='3' line_alpha='75'>" + total_pending + "</number></row></chart_data><chart_label shadow='low' color='ffffff' alpha='95' size='10' position='inside' as_percentage='true' /><chart_pref select='true' /><chart_rect x='90' y='85' width='300' height='175' /><chart_transition type='scale' delay='1' duration='.5' order='category' /><chart_type>donut</chart_type><draw><rect transition='dissolve' layer='background' x='60' y='100' width='360' height='150' fill_alpha='0' line_color='ffffff' line_alpha='25' line_thickness='40' corner_tl='40' corner_tr='40' corner_br='40' corner_bl='40' /><circle transition='dissolve' layer='background' x='240' y='150' radius='150' fill_color='ccddff' fill_alpha='100' line_thickness='0' bevel='bg' blur='blur1' /><rect transition='dissolve' layer='background' shadow='soft' x='65' y='10' width='350' height='35' fill_color='ddeeff' fill_alpha='90' corner_tl='10' corner_tr='10' corner_br='10' corner_bl='10' /></draw><filter><shadow id='low' distance='2' angle='45' color='0' alpha='40' blurX='5' blurY='5' /><shadow id='high' distance='5' angle='45' color='0' alpha='40' blurX='10' blurY='10' /><shadow id='soft' distance='2' angle='45' color='0' alpha='20' blurX='5' blurY='5' /><bevel id='data' angle='45' blurX='5' blurY='5' distance='3' highlightAlpha='15' shadowAlpha='25' type='inner' /><bevel id='bg' angle='45' blurX='50' blurY='50' distance='10' highlightAlpha='35' shadowColor='0000ff' shadowAlpha='25' type='full' /><blur id='blur1' blurX='75' blurY='75' quality='1' /></filter><context_menu full_screen='false' /><legend transition='dissolve' x='90' width='330' bevel='low' fill_alpha='0' line_alpha='0' bullet='circle' size='12' color='000000' alpha='100' /><series_color><color>88dd11</color><color>cc1134</color><color>88aaff</color><color>FBB917</color></series_color><series_explode><number>25</number><number>0</number><number>0</number><number>0</number></series_explode><series transfer='true' /></chart>";
}
public static String StackedColumnChart(List<TagObject> tagObjectList){
return "<chart><axis_category shadow='low' size='10' color='FFFFFF' alpha='75' orientation='diagonal_down' /><axis_ticks value_ticks='true' category_ticks='true' minor_count='1' /><axis_value shadow='low' size='10' color='FFFFFF' alpha='75' /><chart_border top_thickness='0' bottom_thickness='2' left_thickness='2' right_thickness='0' /><chart_data><row><null/>"+generateRowsForColumnChart(tagObjectList)+"</row>"+generateColumnsForColumnChart(tagObjectList)+"</chart_data><chart_grid_h thickness='1' type='solid' /><chart_grid_v thickness='1' type='solid' /><chart_rect x='80' y='30' width='470' height='150' positive_color='888888' positive_alpha='50' /><chart_pref rotation_x='15' rotation_y='0' min_x='0' max_x='80' min_y='0' max_y='60' /><chart_type>stacked 3d column</chart_type><filter><shadow id='high' distance='5' angle='45' alpha='35' blurX='15' blurY='15' /><shadow id='low' distance='2' angle='45' alpha='50' blurX='5' blurY='5' /></filter><legend shadow='high' x='75' y='270' width='470' height='50' margin='20' fill_color='000000' fill_alpha='7' line_color='000000' line_alpha='0' line_thickness='0' layout='horizontal' size='12' color='000000' alpha='50' /><tooltip color='ffffcc' alpha='80' size='12' background_color_1='444488' background_alpha='75' shadow='low' /><series_color><color>C5D88A</color><color>D88A8A</color><color>2DEAEC</color></series_color><series bar_gap='0' set_gap='20' /></chart>";
return "<chart><axis_category shadow='low' size='10' color='FFFFFF' alpha='75' orientation='diagonal_down' /><axis_ticks value_ticks='true' category_ticks='true' minor_count='1' /><axis_value shadow='low' size='10' color='FFFFFF' alpha='75' /><chart_border top_thickness='0' bottom_thickness='2' left_thickness='2' right_thickness='0' /><chart_data><row><null/>"+generateRowsForColumnChart(tagObjectList)+"</row>"+generateColumnsForColumnChart(tagObjectList)+"</chart_data><chart_grid_h thickness='1' type='solid' /><chart_grid_v thickness='1' type='solid' /><chart_rect x='80' y='30' width='470' height='150' positive_color='888888' positive_alpha='50' /><chart_pref rotation_x='15' rotation_y='0' min_x='0' max_x='80' min_y='0' max_y='60' /><chart_type>stacked 3d column</chart_type><filter><shadow id='high' distance='5' angle='45' alpha='35' blurX='15' blurY='15' /><shadow id='low' distance='2' angle='45' alpha='50' blurX='5' blurY='5' /></filter><legend shadow='high' x='75' y='270' width='470' height='50' margin='20' fill_color='000000' fill_alpha='7' line_color='000000' line_alpha='0' line_thickness='0' layout='horizontal' size='12' color='000000' alpha='50' /><tooltip color='ffffcc' alpha='80' size='12' background_color_1='444488' background_alpha='75' shadow='low' /><series_color><color>C5D88A</color><color>D88A8A</color><color>2DEAEC</color><color>ebcc81</color></series_color><series bar_gap='0' set_gap='20' /></chart>";
}
@ -39,12 +39,19 @@ public class XmlChartBuilder {
}
buffer.append("</row>");
buffer.append("<row>");
buffer.append("<string>Skipped</string>");
for(TagObject tag : tagObjectList){
buffer.append("<number tooltip='" +tag.getNumberOfSkipped()+"'>"+tag.getNumberOfSkipped()+"</number>");
buffer.append("<string>Skipped</string>");
for(TagObject tag : tagObjectList){
buffer.append("<number tooltip='" +tag.getNumberOfSkipped()+"'>"+tag.getNumberOfSkipped()+"</number>");
}
}
buffer.append("</row>");
buffer.append("<row>");
buffer.append("<string>Pending</string>");
for(TagObject tag : tagObjectList){
buffer.append("<number tooltip='" +tag.getNumberOfPending()+"'>"+tag.getNumberOfPending()+"</number>");
}
buffer.append("</row>");
return buffer.toString();
}

View File

@ -119,6 +119,10 @@ public class Feature {
return Util.findStatusCount(lookUpSteps(), Util.Status.FAILED);
}
public int getNumberOfPending(){
return Util.findStatusCount(lookUpSteps(), Util.Status.UNDEFINED);
}
public int getNumberOfSkipped() {
return Util.findStatusCount(lookUpSteps(), Util.Status.SKIPPED);
}

View File

@ -144,6 +144,7 @@ if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
<th>Passed</th>
<th>Failed</th>
<th>Skipped</th>
<th>Pending</th>
<th>Duration</th>
<th>Status</th>
</tr>
@ -163,6 +164,7 @@ if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
<td>$feature.getNumberOfPasses()</td>
<td>$feature.getNumberOfFailures()</td>
<td>$feature.getNumberOfSkipped()</td>
<td>$feature.getNumberOfPending()</td>
<td>$feature.getDurationOfSteps()</td>
<td style="background-color: $bgcolour;">$feature.getRawStatus()</td>
</tr>
@ -175,6 +177,7 @@ if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
<td style="background-color:lightgray;font-weight:bold;">$total_passes</td>
<td style="background-color:lightgray;font-weight:bold;">$total_fails</td>
<td style="background-color:lightgray;font-weight:bold;">$total_skipped</td>
<td style="background-color:lightgray;font-weight:bold;">$total_pending</td>
<td style="background-color:lightgray;font-weight:bold;">$total_duration</td>
<td style="background-color:lightgray;font-weight:bold;">Totals</td>
</tr></table>

View File

@ -119,9 +119,10 @@ table.data-table td {
<th>Feature</th>
<th>Scenarios</th>
<th>Steps</th>
<th>Passed</th>
<th>Failed</th>
<th>Skipped</th>
<th style="background-color:#C5D88A;">Passed</th>
<th style="background-color:#D88A8A;">Failed</th>
<th style="background-color:#2DEAEC;">Skipped</th>
<th style="background-color:#ebcc81;">Pending</th>
<th>Duration</th>
<th>Status</th>
</tr>
@ -133,6 +134,7 @@ table.data-table td {
<td>$feature.getNumberOfPasses()</td>
<td>$feature.getNumberOfFailures()</td>
<td>$feature.getNumberOfSkipped()</td>
<td>$feature.getNumberOfPending()</td>
<td>$feature.getDurationOfSteps()</td>
<td style="background-color: $report_status_colour;">$feature.getRawStatus()</td></tr>

View File

@ -209,6 +209,7 @@
<th>Passed</th>
<th>Failed</th>
<th>Skipped</th>
<th>Pending</th>
<th>Duration</th>
<th>Status</th>
</tr>
@ -230,6 +231,7 @@
<td>$tag.getNumberOfPasses()</td>
<td>$tag.getNumberOfFailures()</td>
<td>$tag.getNumberOfSkipped()</td>
<td>$tag.getNumberOfPending()</td>
<td>$tag.getDurationOfSteps()</td>
<td style="background-color: $bgcolour;">$tag.getRawStatus()</td>
</tr>
@ -242,6 +244,7 @@
<td style="background-color:lightgray;font-weight:bold;">$total_passes</td>
<td style="background-color:lightgray;font-weight:bold;">$total_fails</td>
<td style="background-color:lightgray;font-weight:bold;">$total_skipped</td>
<td style="background-color:lightgray;font-weight:bold;">$total_pending</td>
<td style="background-color:lightgray;font-weight:bold;">$total_duration</td>
<td style="background-color:lightgray;font-weight:bold;">Totals</td>
</tr>

View File

@ -119,9 +119,10 @@ table.data-table td {
<th>Tag</th>
<th>Scenarios</th>
<th>Steps</th>
<th>Passed</th>
<th>Failed</th>
<th>Skipped</th>
<th style="background-color:#C5D88A;">Passed</th>
<th style="background-color:#D88A8A;">Failed</th>
<th style="background-color:#2DEAEC;">Skipped</th>
<th style="background-color:#ebcc81;">Pending</th>
<th>Duration</th>
<th>Status</th>
</tr>
@ -133,6 +134,7 @@ table.data-table td {
<td>$tag.getNumberOfPasses()</td>
<td>$tag.getNumberOfFailures()</td>
<td>$tag.getNumberOfSkipped()</td>
<td>$tag.getNumberOfPending()</td>
<td>$tag.getDurationOfSteps()</td>
<td style="background-color: $report_status_colour;">$tag.getRawStatus()</td></tr>

View File

@ -1,28 +1,28 @@
Fri May 25 22:39:04 BST 2012 [debug] AvalonLogChute initialized using file 'velocity.log'
Fri May 25 22:39:04 BST 2012 [trace] *******************************************************************
Fri May 25 22:39:04 BST 2012 [debug] Starting Jakarta Velocity v1.5-SNAPSHOT (compiled: 2006-07-21 06:25:35)
Fri May 25 22:39:04 BST 2012 [trace] RuntimeInstance initializing.
Fri May 25 22:39:04 BST 2012 [debug] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
Fri May 25 22:39:04 BST 2012 [debug] Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
Fri May 25 22:39:04 BST 2012 [debug] Using logger class org.apache.velocity.runtime.log.AvalonLogChute
Fri May 25 22:39:04 BST 2012 [debug] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
Fri May 25 22:39:04 BST 2012 [debug] ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Fri May 25 22:39:04 BST 2012 [trace] ClasspathResourceLoader : initialization complete.
Fri May 25 22:39:04 BST 2012 [debug] ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
Fri May 25 22:39:04 BST 2012 [trace] Default ResourceManager initialization complete.
Fri May 25 22:39:04 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
Fri May 25 22:39:04 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
Fri May 25 22:39:04 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
Fri May 25 22:39:04 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Include
Fri May 25 22:39:04 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
Fri May 25 22:39:04 BST 2012 [debug] Created '20' parsers.
Fri May 25 22:39:04 BST 2012 [trace] Velocimacro : initialization starting.
Fri May 25 22:39:04 BST 2012 [debug] Velocimacro : "velocimacro.library" is not set. Trying default library: VM_global_library.vm
Fri May 25 22:39:04 BST 2012 [debug] Velocimacro : Default library not found.
Fri May 25 22:39:04 BST 2012 [debug] Velocimacro : allowInline = true : VMs can be defined inline in templates
Fri May 25 22:39:04 BST 2012 [debug] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
Fri May 25 22:39:04 BST 2012 [debug] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
Fri May 25 22:39:04 BST 2012 [debug] Velocimacro : autoload off : VM system will not automatically reload global library macros
Fri May 25 22:39:04 BST 2012 [trace] Velocimacro : initialization complete.
Fri May 25 22:39:04 BST 2012 [trace] RuntimeInstance successfully initialized.
Fri May 25 22:39:04 BST 2012 [debug] ResourceManager : found templates/tagOverview.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Sat May 26 08:06:54 BST 2012 [debug] AvalonLogChute initialized using file 'velocity.log'
Sat May 26 08:06:54 BST 2012 [trace] *******************************************************************
Sat May 26 08:06:54 BST 2012 [debug] Starting Jakarta Velocity v1.5-SNAPSHOT (compiled: 2006-07-21 06:25:35)
Sat May 26 08:06:54 BST 2012 [trace] RuntimeInstance initializing.
Sat May 26 08:06:54 BST 2012 [debug] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
Sat May 26 08:06:54 BST 2012 [debug] Trying to use logger class org.apache.velocity.runtime.log.AvalonLogChute
Sat May 26 08:06:54 BST 2012 [debug] Using logger class org.apache.velocity.runtime.log.AvalonLogChute
Sat May 26 08:06:54 BST 2012 [debug] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
Sat May 26 08:06:54 BST 2012 [debug] ResourceLoader instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Sat May 26 08:06:54 BST 2012 [trace] ClasspathResourceLoader : initialization complete.
Sat May 26 08:06:54 BST 2012 [debug] ResourceCache: initialized (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
Sat May 26 08:06:54 BST 2012 [trace] Default ResourceManager initialization complete.
Sat May 26 08:06:54 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
Sat May 26 08:06:54 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
Sat May 26 08:06:54 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
Sat May 26 08:06:54 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Include
Sat May 26 08:06:54 BST 2012 [debug] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
Sat May 26 08:06:54 BST 2012 [debug] Created '20' parsers.
Sat May 26 08:06:54 BST 2012 [trace] Velocimacro : initialization starting.
Sat May 26 08:06:54 BST 2012 [debug] Velocimacro : "velocimacro.library" is not set. Trying default library: VM_global_library.vm
Sat May 26 08:06:54 BST 2012 [debug] Velocimacro : Default library not found.
Sat May 26 08:06:54 BST 2012 [debug] Velocimacro : allowInline = true : VMs can be defined inline in templates
Sat May 26 08:06:54 BST 2012 [debug] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
Sat May 26 08:06:54 BST 2012 [debug] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
Sat May 26 08:06:54 BST 2012 [debug] Velocimacro : autoload off : VM system will not automatically reload global library macros
Sat May 26 08:06:54 BST 2012 [trace] Velocimacro : initialization complete.
Sat May 26 08:06:54 BST 2012 [trace] RuntimeInstance successfully initialized.
Sat May 26 08:06:54 BST 2012 [debug] ResourceManager : found templates/tagOverview.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader