Skip to content

Commit

Permalink
Bugfix/386 class summary min can be 0 (#387)
Browse files Browse the repository at this point in the history
* Class summary minimum times can be 0 incorrectly
- Fixed merge method to avoid unnecessary comparisons with null

Resolves #386
{patch}

Signed-off-by: Esta Nagy <[email protected]>

* Add total stats to the report
- Adds total stats to the bottom of the event log section

{patch}

Signed-off-by: Esta Nagy <[email protected]>

---------

Signed-off-by: Esta Nagy <[email protected]>
  • Loading branch information
nagyesta authored Jun 26, 2023
1 parent 23ca0cf commit 31bbda0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
border: 2px solid;
}

.total-stats {
padding-top: $padding-large;
padding-bottom: $padding-large;
}

.filter-module {
display: block;
vertical-align: top;
Expand Down
6 changes: 6 additions & 0 deletions mission-report/flight-evaluation-report/node/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ <h2>Event log</h2>
</tr>
</tbody>
</table>
<div class="total-stats center">
<span data-bind="text: 'Total success: ' + resultCounts.success"></span> / <span
data-bind="text: 'Total failure: ' + resultCounts.failure"></span> / <span
data-bind="text: 'Total abort: ' + resultCounts.abort"></span> / <span
data-bind="text: 'Total suppressed: ' + resultCounts.suppressed"></span>
</div>
</div>
</div>
<p class="footer center">Thank you for trusting Abort-Mission with your launch!</p>
Expand Down
3 changes: 3 additions & 0 deletions mission-report/flight-evaluation-report/node/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class FlightEvaluationReportInitializer {

addRun(run) {
this.rootModel.runs.push(run);
const result = run.result.toLowerCase();
this.rootModel.resultCounts[result] = (this.rootModel.resultCounts[result] || 0) + 1;
}

initStaticData() {
Expand Down Expand Up @@ -127,6 +129,7 @@ class FlightEvaluationReportModel {
this.results = [];
this.allRules = [];
this.runs = [];
this.resultCounts = {success: 0, failure: 0, abort: 0, suppressed: 0};
this.logViewTimeline = new LogViewTimelineModel(this);
this.detailView = new DetailViewModel(this);
this.filter = new TestRunFilter(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class DetailViewStatModel {
this.runs += other.runs;
this.start = this.start === null ? other.start : Math.min(other.start, this.start);
this.end = this.end === null ? other.end : Math.max(other.end, this.end);
this.min = Math.min(other.min, this.min);
this.max = Math.max(other.max, this.max);
this.min = this.min === null ? other.min : Math.min(this.min, other.min);
this.max = this.max === null ? other.max : Math.max(this.max, other.max);
this.sum += other.sum;
this.success += other.success;
this.failure += other.failure;
Expand Down

0 comments on commit 31bbda0

Please sign in to comment.