Skip to content

Rebase on google/openhtf and serve several executing tests per station - #5

Merged
jp-pino merged 0 commit into
masterfrom
blueye/rebase-on-upstream
Oct 7, 2026
Merged

jp-pino merged 0 commit into
masterfrom
blueye/rebase-on-upstream

Conversation

@jp-pino

@jp-pino jp-pino commented Oct 7, 2026 •

Copy link
Copy Markdown

Spike for the battery station (P2-functional-tests google#214 discussion): one OpenHTF test per fixture slot, four executing at once in one process, each with its own DUT id and record, all on one GUI.

Rebase

The branch starts at google/openhtf master (07cfec4, 2026-10-05) and replays the fork's two source changes on top: the phase measurements getter (Show measurements on running and failing tests) and the prompt image sizing (three commits squashed into one). Everything else our master, dev, js/rebase and jp-pino/upgrade branches carry is built bundles of those two changes, or the data.py warning fix that upstream has since made itself (9bfeea8). P2-functional-tests installs js/rebase, which is the same two changes on upstream from 2025-10-21; upstream has 70 commits since, among them the Angular 22 GUI, tornado 6.5.8 and a teardown deadlock fix.

Several executing tests

OpenHTF lets several Test objects execute at once (one thread each), but the station server, the GUI and the record log handler only expected one. Five commits change that:

  • Station server: serve every executing test: _get_executing_tests() returns every executing test; the watcher starts a TestWatcher per test; the pub/sub keeps the last message per test and sends all of them to a new subscriber; a final record is matched to its execution by identity; the phases, plugs and attachments endpoints look the test up by UID; publish() survives a closed subscriber. examples/parallel_tests.py runs four slots; test/output/servers/station_server_test.py covers the lookups, record matching, watchers and log separation.
  • UserInput: log prompts through the test's logger, so they land in that test's record only.
  • Web GUI: one panel per executing test, ordered by test name, as many per row as fit at 360px on the whole window width (four on a 1920px monitor), wrapping below. A completed test stays on screen until the next test starts on the station; history selection works as before. The dist bundle is rebuilt with Angular 22 on Node 24 and also carries the two replayed fork changes.
  • Keep framework logs with the test whose thread emitted them: the record handler kept every openhtf.* log except other tests' record loggers, so "Executing test", "outcome: PASS" and "Tearing down all plugs" went into all records. A thread is now marked as working for a test (threads.set_test_uid): Test.execute() marks the calling thread, the executor its own, and KillableThread inherits the mark from its creator. Threads outside any test (the server, user threads) behave as before.
  • Station server: publish from the server's loop: a final record published from the test's thread raised "There is no current event loop in thread"; the server hands its loop to the pub/sub and publishes from other threads are scheduled on it.

Verified in the browser with the example: four panels, a serial entered in one panel starts only that test, its prompt and completion logs show in its own panel, it completes to the history with its own DUT id and the slot restarts. The fork's suite: 576 passed; multicast_test fails on macOS for an IPv6 reason unrelated to this change.

On master

This PR targets master for review. Our master sits on upstream from 2020, so GitHub reports conflicts in the old dist/ layout; the cleaner end state is to make this branch the new master (force push, or a new default branch) once reviewed.

🤖 Generated with Claude Code

@coveralls

coveralls commented Oct 7, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 37591697030

Warning

No base build found for commit 6562c42 on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 66.318%

Details

  • Patch coverage: Could not be determined — this PR's diff is too large for GitHub to return (406 error at GitHub).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 7734
Covered Lines: 5129
Line Coverage: 66.32%
Coverage Strength: 3.32 hits per line

💛 - Coveralls

@jp-pino
jp-pino merged commit 24d55d7 into master Oct 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants