diff --git a/pom.xml b/pom.xml
index e8a0625..6f915d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,4 +67,19 @@
+
+
+
+
+ org.codehaus.mojo
+ findbugs-maven-plugin
+ 3.0.4
+
+ ${maven.findbugs.failure.strict}
+
+
+
+
+
+
diff --git a/src/main/resources/org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly b/src/main/resources/org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly
index 63753d4..d557a9a 100644
--- a/src/main/resources/org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly
+++ b/src/main/resources/org/jenkinsci/plugins/testresultsanalyzer/TestResultsAnalyzerAction/index.jelly
@@ -98,6 +98,9 @@ Search:
+ Show broken tests
+
' +
'{{> tableBodyTemplate}}' +
'\n' + '{{/each}}';
-var worstTestsTableBody = '
Top 10 Most Broken Tests
' +
+var worstTestsTableBody = '
Top {{this.length}} Most Broken Tests
' +
'\n' + '{{#if this.length}}' +
'
' +
'\n' + '
' +
diff --git a/src/main/webapp/js/testresult.js b/src/main/webapp/js/testresult.js
index 89306a4..058c882 100644
--- a/src/main/webapp/js/testresult.js
+++ b/src/main/webapp/js/testresult.js
@@ -50,6 +50,13 @@ function searchTests(){
}
}
+function showBroken() {
+ var count = $j("#brokencount").val();
+ if (!isNaN(count)) {
+ populateWorstTests(parseInt(count));
+ }
+}
+
function reset(){
reevaluateChartData = true;
$j(".test-history-table").html("");
@@ -57,6 +64,14 @@ function reset(){
resetCharts();
}
+function populateWorstTests(count) {
+ var items = populateWorstTests.items;
+ var worstTests = getWorstTests(items, count);
+ $j(".worst-tests-table").html(
+ analyzerWorstTestsTemplate(worstTests)
+ );
+}
+
function populateTemplate(){
reset();
displayValues = $j("#show-build-durations").is(":checked");
@@ -66,10 +81,10 @@ function populateTemplate(){
$j(".test-history-table").html(
analyzerTemplate(itemsResponse)
);
- var worstTests = getWorstTests(itemsResponse);
- $j(".worst-tests-table").html(
- analyzerWorstTestsTemplate(worstTests)
- );
+ $j(".show-after-loading").show();
+ /* Set the function's static variable */
+ populateWorstTests.items = itemsResponse;
+ populateWorstTests(20);
addEvents();
generateCharts();
$j("#table-loading").hide();