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 +
diff --git a/src/main/webapp/css/table-style.css b/src/main/webapp/css/table-style.css index 2cc96c7..6cad6b1 100644 --- a/src/main/webapp/css/table-style.css +++ b/src/main/webapp/css/table-style.css @@ -141,5 +141,10 @@ margin-top: 10%; } + .show-after-loading { + display: none; + } - + #brokencount { + width: 3.5em; + } diff --git a/src/main/webapp/js/test-result-analyzer-template.js b/src/main/webapp/js/test-result-analyzer-template.js index 54ab621..9fe3d49 100644 --- a/src/main/webapp/js/test-result-analyzer-template.js +++ b/src/main/webapp/js/test-result-analyzer-template.js @@ -50,7 +50,7 @@ var tableBody = '
' + '{{> 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();