Phases

Structure your hardware tests with phases.

Phases section header showing test phase management whithin TofuPilot.

Overview

A test procedure in TofuPilot is made of sequential phases. These represent logical blocks of a test. Each phase performs a specific function and records its own start and end time, as well as its outcome.

Integration

TofuPilot tracks each phase with its name, outcome, and duration. With OpenHTF, you simply define the phases in the Test, and TofuPilot collects the information automatically.

import openhtf as htf
from tofupilot.openhtf import TofuPilot


def phase_one(test):  # Phase name is the function name
    return htf.PhaseResult.CONTINUE  # Pass status


def main():
    test = htf.Test(phase_one, procedure_id="FVT1", part_number="PCB1")

    with TofuPilot(test):
        # duration and start time are automatically set
        test.execute(lambda: "PCB1A001")


if __name__ == "__main__":
    main()

Phases properties

  • Name
    phases
    Type
    array
    Description

    List of phases.

  • Name
    name
    Type
    str
    Description

    The name of the phase.

  • Name
    outcome
    Type
    "PASS" | "FAIL" | "ERROR" | "SKIP"
    Description

    Result of the phase. Example: "PASS"

  • Name
    start_time_millis
    Type
    number (optional)
    Description

    Start time (Unix ms). Example: 1726147200000

  • Name
    end_time_millis
    Type
    number (optional)
    Description

    End time (Unix ms). Example: 1726147230000

  • Name
    measurements
    Type
    array (optional)
    Description

    List of measurements in the phase.

In-app view

Run page

Each test run shows a breakdown of all phases and their associated measurements.

Phases section header showing test phase management whithin TofuPilot.

Procedure Page

Clicking a phase in the Run page opens the Procedure page. You can analyze all historical data for that phase: average duration, yield, number of runs, and Cpk.

Phases section header showing test phase management whithin TofuPilot.

These features will be explained in more detail in the Test phases analysis section.

Was this page helpful?