Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a field on the page to show a custom amount of "broken test" #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,19 @@
</pluginRepository>
</pluginRepositories>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
<configuration>
<failOnError>${maven.findbugs.failure.strict}</failOnError>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ Search: <input id="filter" class="table-filter" type="text" placeholder="Test/Cl
</div>
<br/>

<div class="show-after-loading">
Show <input id="brokencount" type="text" value="20" onkeyup="showBroken()" /> broken tests
</div>
<div class="worst-tests-table">

</div>
Expand Down
7 changes: 6 additions & 1 deletion src/main/webapp/css/table-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,10 @@
margin-top: 10%;
}

.show-after-loading {
display: none;
}


#brokencount {
width: 3.5em;
}
2 changes: 1 addition & 1 deletion src/main/webapp/js/test-result-analyzer-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var tableBody = '<div class="heading">' +
'{{> tableBodyTemplate}}' +
'\n' + '{{/each}}';

var worstTestsTableBody = '<h2 align="center">Top 10 Most Broken Tests</h2>' +
var worstTestsTableBody = '<h2 align="center">Top {{this.length}} Most Broken Tests</h2>' +
'\n' + '{{#if this.length}}' +
'<div class=table>' +
'\n' + '<div class="heading">' +
Expand Down
23 changes: 19 additions & 4 deletions src/main/webapp/js/testresult.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,28 @@ function searchTests(){
}
}

function showBroken() {
var count = $j("#brokencount").val();
if (!isNaN(count)) {
populateWorstTests(parseInt(count));
}
}

function reset(){
reevaluateChartData = true;
$j(".test-history-table").html("");
$j(".worst-tests-table").html("");
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");
Expand All @@ -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();
Expand Down
Loading