From 31bbda056bd81f49a784b3a018176d1ff2e80e98 Mon Sep 17 00:00:00 2001 From: Esta Nagy Date: Mon, 26 Jun 2023 22:17:38 +0200 Subject: [PATCH] Bugfix/386 class summary min can be 0 (#387) * 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 * Add total stats to the report - Adds total stats to the bottom of the event log section {patch} Signed-off-by: Esta Nagy --------- Signed-off-by: Esta Nagy --- .../flight-evaluation-report/node/css/30-layout-common.scss | 5 +++++ mission-report/flight-evaluation-report/node/report.html | 6 ++++++ mission-report/flight-evaluation-report/node/src/app.js | 3 +++ .../flight-evaluation-report/node/src/detail-view-model.js | 4 ++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mission-report/flight-evaluation-report/node/css/30-layout-common.scss b/mission-report/flight-evaluation-report/node/css/30-layout-common.scss index fe20aaea..f3f8045e 100644 --- a/mission-report/flight-evaluation-report/node/css/30-layout-common.scss +++ b/mission-report/flight-evaluation-report/node/css/30-layout-common.scss @@ -16,6 +16,11 @@ border: 2px solid; } +.total-stats { + padding-top: $padding-large; + padding-bottom: $padding-large; +} + .filter-module { display: block; vertical-align: top; diff --git a/mission-report/flight-evaluation-report/node/report.html b/mission-report/flight-evaluation-report/node/report.html index 6117403a..991576e2 100644 --- a/mission-report/flight-evaluation-report/node/report.html +++ b/mission-report/flight-evaluation-report/node/report.html @@ -350,6 +350,12 @@

Event log

+
+ / / / +
diff --git a/mission-report/flight-evaluation-report/node/src/app.js b/mission-report/flight-evaluation-report/node/src/app.js index 979f4109..c8182584 100644 --- a/mission-report/flight-evaluation-report/node/src/app.js +++ b/mission-report/flight-evaluation-report/node/src/app.js @@ -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() { @@ -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); diff --git a/mission-report/flight-evaluation-report/node/src/detail-view-model.js b/mission-report/flight-evaluation-report/node/src/detail-view-model.js index 8a7374ee..5d0b8a1d 100644 --- a/mission-report/flight-evaluation-report/node/src/detail-view-model.js +++ b/mission-report/flight-evaluation-report/node/src/detail-view-model.js @@ -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;