OpenHTF

Integrate your OpenHTF scripts with TofuPilot in a single line.

Overview

OpenHTF is an open-source Python framework for automating hardware tests. It makes writing and running tests easier with a modular design. Built at Google, it's now used by teams around the world.

By adding a single line to your OpenHTF script, TofuPilot's open-source Python client automatically creates a run on TofuPilot, capturing the test phases, measurements, and attachments, and storing the original OpenHTF JSON log for traceability.

Installation

  1. Create a TofuPilot account

  2. Install OpenHTF:

pip install openhtf six setuptools
  1. Install the TofuPilot open-source Python client:
pip install tofupilot

Add it to your test like this:

main.py

import openhtf as htf
from tofupilot.openhtf import TofuPilot # Import OpenHTF for TofuPilot

def phase_one(test):
    return htf.PhaseResult.CONTINUE

def main():
    test = htf.Test(phase_one)
    with TofuPilot(test):               # One-line integration
      test.execute(lambda: "PCB001")

if __name__ == '__main__':
    main()

Your OpenHTF reports are uploaded to your TofuPilot account using the Unit Under Test serial number dut_id (e.g., "PCB001"), which you can find on the Runs page.

Run page showing the different phases performed for a Unit Under Test (UUT) in OpenHTF with TofuPilot.

Supported features

We are continuously adding features to the integration. Below is a table of OpenHTF features currently supported by TofuPilot.

OpenHTF featuresTofuPilot support
PhasesPhases
Sub-phases
Skipped phases
MeasurementsNumeric measurement
Boolean measurement
String measurement
Arbitrary measurement
Limits
Units
Multiple measurements
AttachmentsFile
File from path
Output CallbackJSON Report

More documentation

Discover TofuPilot integrations in Test Runs sections and OpenHTF features in our dedicated documentation maintained by our team.

OpenHTF Documentation

Was this page helpful?