Skip to content
Merged
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
2 changes: 2 additions & 0 deletions openhtf/output/web_gui/src/app/shared/models/phase.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export enum PhaseStatus {
running,
pass,
fail,
skip,
error,
}

export class Phase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

export enum StationStatus {
online = 7,
online = 9,
unreachable,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Station } from './station.model';
// Enum values must not overlap between any of the status enums.
// See status-pipes.ts.
export enum TestStatus {
waiting = 9, // Corresponds to WAITING_FOR_TEST_START.
waiting = 11, // Corresponds to WAITING_FOR_TEST_START.
running,
pass,
fail,
Expand Down
4 changes: 4 additions & 0 deletions openhtf/output/web_gui/src/app/shared/status-pipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const statusToCategory = {
[PhaseStatus.running]: StatusCategory.running,
[PhaseStatus.pass]: StatusCategory.pass,
[PhaseStatus.fail]: StatusCategory.fail,
[PhaseStatus.skip]: StatusCategory.unreachable,
[PhaseStatus.error]: StatusCategory.warning,
[StationStatus.online]: StatusCategory.online,
[StationStatus.unreachable]: StatusCategory.unreachable,
[TestStatus.waiting]: StatusCategory.pending,
Expand All @@ -63,6 +65,8 @@ const statusToText = {
[PhaseStatus.running]: 'Running',
[PhaseStatus.pass]: 'Pass',
[PhaseStatus.fail]: 'Fail',
[PhaseStatus.skip]: 'Skip',
[PhaseStatus.error]: 'Error',
[StationStatus.online]: 'Online',
[StationStatus.unreachable]: 'Unreachable',
[TestStatus.waiting]: 'Waiting',
Expand Down
16 changes: 9 additions & 7 deletions openhtf/output/web_gui/src/app/stations/station/station-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ const measurementStatusMap = {
'PARTIALLY_SET': MeasurementStatus.unset,
};

const phaseRecordOutcomeMap = {
'PASS': PhaseStatus.pass,
'FAIL': PhaseStatus.fail,
'SKIP': PhaseStatus.skip,
'ERROR': PhaseStatus.error,
};

export interface RawTestState {
plugs: RawPlugsInfo;
running_phase_state: RawPhase|null;
Expand Down Expand Up @@ -78,6 +85,7 @@ export interface RawPhase {
name: string;
result?: {}; // Not present on running phase state.
start_time_millis: number;
outcome: string;
}

export interface RawAttachment {
Expand Down Expand Up @@ -201,13 +209,7 @@ function makePhase(phase: RawPhase, running: boolean) {
if (running) {
status = PhaseStatus.running;
} else {
status = PhaseStatus.pass;
for (const measurement of measurements) {
if (measurement.status !== MeasurementStatus.pass) {
status = PhaseStatus.fail;
break;
}
}
status = phaseRecordOutcomeMap[phase.outcome];
}
return new Phase({
attachments,
Expand Down