Commits

Chris Doble  committed 8ee6f37

Change failure rate to success rate.

  • Participants
  • Parent commits ec147fe

Comments (0)

Files changed (3)

File src/main/java/com/atlassian/bamboo/plugins/failureleaderboard/ViewFailureLeaderboard.java

     }
 
     /**
-     * Returns a human-readable description of a test case's failure rate.
+     * Returns a human-readable description of a test case's success rate.
      *
      * @param testCaseFailures The test case failures to be described.
      * @return A human-readable description of {@code testCaseFailures}.
      */
-    public String getFailureRateText(TestCaseFailures testCaseFailures) {
+    public String getSuccessRateText(TestCaseFailures testCaseFailures) {
         int buildCount = resultsList.size();
         int failureCount = testCaseFailures.getFailedTestCaseResults().size();
         return String.format("This test has failed %d time%s over %d build%s.",

File src/main/resources/css/styles.css

     top: 6px;
 }
 
-div.failure-leaderboard table td.failure-rate {
+div.failure-leaderboard table td.success-rate {
     text-align: right;
-    width: 6em;
+    width: 7em;
 }
 
 div.failure-leaderboard table p.test-name {

File src/main/resources/templates/viewFailureLeaderboard.ftl

                 <thead>
                     <tr>
                         <th></th>
-                        <th>Failure Rate</th>
+                        <th>Success Rate</th>
                         <th>Test</th>
                     </tr>
                 </thead>
                     [#list pager.page.list as testCaseFailures]
                         <tr>
                             [#assign testCase = testCaseFailures.testCase/]
-                            [#assign failureRate = testCaseFailures.failedTestCaseResults.size() * 100.0 / buildCount/]
+                            [#assign successRate = (buildCount - testCaseFailures.failedTestCaseResults.size()) * 100.0 / buildCount/]
                             <td class="twixie"><span class="icon icon-expand" title="Expand">Expand</span></td>
-                            <td class="failure-rate" title="${action.getFailureRateText(testCaseFailures)}"">${failureRate?string("0")}%</td>
+                            <td class="success-rate" title="${action.getSuccessRateText(testCaseFailures)}"">${successRate?string("0.##")}%</td>
                             <td>
                                 <p class="test-name">${testCase.testClass.shortName} ${testCase.name}</p>
                                 [#if !action.isTestCaseFailing(testCase)]