forgetest: the setup burns need two witnesses and record the beam sensor

setup.focus and setup.floor follow forgectrl: a burn counts on the tube
current and the kernel's LASER_ON samples, and its result records the
beam sensor's rise and beam_sensor_seen, never requiring a rise (a head
may give no output from the sensor). The check reads that both are
recorded and logs them; the descriptions name the two witnesses.

Proof: the setup host tests (74) and the manifest tests pass, two of
them new: a burn whose sensor gave no output passes, and a result that
does not record the sensor fails, each with the settings put back.

Acceptance: these are the tests.
This commit is contained in:
ScottW514
2026-10-12 16:15:24 -04:00
parent ecbfe64cef
commit 748d28686d
2 changed files with 27 additions and 7 deletions
+17 -1
View File
@@ -22,7 +22,8 @@ from forgetest.runner import Context, Failed, Run # noqa: E402
from forgetest.suite import setup_burns, setup_dark # noqa: E402
LIVE = ["laser.focus", "laser.floor"]
EMISSION = {"hv_max": 610, "laser_on_samples": 900, "thermopile_delta": 600, "lit_s": 30.0}
EMISSION = {"hv_max": 610, "laser_on_samples": 900, "thermopile_delta": 600, "beam_sensor_seen": True,
"lit_s": 30.0}
SPM = 2.922 # the lens screw, half-steps per mm ($102)
EDGE_DEFAULT = 3.35 # the edge's height while the setting is unset (lens.h)
@@ -368,6 +369,21 @@ class BurnRunTests(unittest.TestCase):
self.assertIn("the tube current never rose", str(cm.exception))
self.assert_found()
def test_a_burn_with_a_silent_beam_sensor_passes(self):
# A head whose beam sensor gives no output: the tube current and
# LASER_ON saw the beam, so the burn counts.
self.daemon.patch["laser.floor"] = {"emission": dict(EMISSION, thermopile_delta=0,
beam_sensor_seen=False)}
self.run_test("setup.floor")
self.assert_found()
def test_a_burn_that_does_not_record_the_beam_sensor_fails(self):
self.daemon.patch["laser.floor"] = {"emission": {"hv_max": 610, "laser_on_samples": 900}}
with self.assertRaises(Failed) as cm:
self.run_test("setup.floor")
self.assertIn("the result does not record the beam sensor", str(cm.exception))
self.assert_found()
def test_a_focus_burn_that_writes_the_window_fails(self):
# The focus burn writes the edge alone: the window is the Lens
# travel check's. A burn that moves it fails, and it goes back.