Skip to content

Commit 78113cf

Browse files
laltencricdecyan
andauthored
Show failed measurement-less phases as failed (#1020)
By adding `skip`, `error` states and using PhaseRecord.outcome instead of checking measurement.status. Co-authored-by: cpaulin <[email protected]>
1 parent 151e5c3 commit 78113cf

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

openhtf/output/web_gui/src/app/shared/models/phase.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export enum PhaseStatus {
1414
running,
1515
pass,
1616
fail,
17+
skip,
18+
error,
1719
}
1820

1921
export class Phase {

openhtf/output/web_gui/src/app/shared/models/station.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
export enum StationStatus {
6-
online = 7,
6+
online = 9,
77
unreachable,
88
}
99

openhtf/output/web_gui/src/app/shared/models/test-state.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Station } from './station.model';
1010
// Enum values must not overlap between any of the status enums.
1111
// See status-pipes.ts.
1212
export enum TestStatus {
13-
waiting = 9, // Corresponds to WAITING_FOR_TEST_START.
13+
waiting = 11, // Corresponds to WAITING_FOR_TEST_START.
1414
running,
1515
pass,
1616
fail,

openhtf/output/web_gui/src/app/shared/status-pipes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const statusToCategory = {
4343
[PhaseStatus.running]: StatusCategory.running,
4444
[PhaseStatus.pass]: StatusCategory.pass,
4545
[PhaseStatus.fail]: StatusCategory.fail,
46+
[PhaseStatus.skip]: StatusCategory.unreachable,
47+
[PhaseStatus.error]: StatusCategory.warning,
4648
[StationStatus.online]: StatusCategory.online,
4749
[StationStatus.unreachable]: StatusCategory.unreachable,
4850
[TestStatus.waiting]: StatusCategory.pending,
@@ -63,6 +65,8 @@ const statusToText = {
6365
[PhaseStatus.running]: 'Running',
6466
[PhaseStatus.pass]: 'Pass',
6567
[PhaseStatus.fail]: 'Fail',
68+
[PhaseStatus.skip]: 'Skip',
69+
[PhaseStatus.error]: 'Error',
6670
[StationStatus.online]: 'Online',
6771
[StationStatus.unreachable]: 'Unreachable',
6872
[TestStatus.waiting]: 'Waiting',

openhtf/output/web_gui/src/app/stations/station/station-data.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ const measurementStatusMap = {
3333
'PARTIALLY_SET': MeasurementStatus.unset,
3434
};
3535

36+
const phaseRecordOutcomeMap = {
37+
'PASS': PhaseStatus.pass,
38+
'FAIL': PhaseStatus.fail,
39+
'SKIP': PhaseStatus.skip,
40+
'ERROR': PhaseStatus.error,
41+
};
42+
3643
export interface RawTestState {
3744
plugs: RawPlugsInfo;
3845
running_phase_state: RawPhase|null;
@@ -78,6 +85,7 @@ export interface RawPhase {
7885
name: string;
7986
result?: {}; // Not present on running phase state.
8087
start_time_millis: number;
88+
outcome: string;
8189
}
8290

8391
export interface RawAttachment {
@@ -201,13 +209,7 @@ function makePhase(phase: RawPhase, running: boolean) {
201209
if (running) {
202210
status = PhaseStatus.running;
203211
} else {
204-
status = PhaseStatus.pass;
205-
for (const measurement of measurements) {
206-
if (measurement.status !== MeasurementStatus.pass) {
207-
status = PhaseStatus.fail;
208-
break;
209-
}
210-
}
212+
status = phaseRecordOutcomeMap[phase.outcome];
211213
}
212214
return new Phase({
213215
attachments,

0 commit comments

Comments
 (0)