How google/openhtf works
Project type and purpose
• OpenHTF is an open-source Python hardware-testing framework (a library/toolkit), not a monolithic web app.
• It provides:
– A core test execution engine (phases, test state, measurement/attachment APIs)
– A plugin system (“plugs”) to drive DUTs or test equipment
– Output channels (callbacks, servers, protobuf serializers)
– An optional real-time web UI (Angular + SockJS)
– CLI scripts (in bin/) and convenience utilities
File structure
• Top level:
– bin/: small Python CLIs (e.g. units_from_xls.py)
– docs/, examples/: usage guides and sample tests
– openhtf/: main code
• core/: test orchestration (TestDescriptor, PhaseExecutor, TestExecutor, TestState, etc.)
• plugs/: hardware-interaction plugins (USB, serial, user_input)
• util/: misc utilities (config, logging, threads, timeouts)
• output/: how test data is emitted
· callbacks/: in-process sinks (console_summary, json_factory, mfg_inspector)
· proto/: .proto definitions + converters
· servers/: long-running processes (dashboard_server, station_server, pub_sub, web_gui_server)
· web_gui/: Angular front end + static assets + web_launcher.py
• test/: unit tests mirroring core structure
• config/CI files: GitHub workflows, tox.ini, pyproject.toml
README for additional insights
• Core concepts: Test, test run/recipe/script, Station, Phase, Measurement, Attachment, Plug
• Workflow: user writes a Python test (phases + specs), instantiates Test, calls Execute() → engine handles sequencing & state → outputs pushed to callbacks/servers → optional web frontend displays station/test-run history