mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-10-15 17:19:55 -07:00
forgetest: the gate test leaves the step lists to forgectrl's setup_test
setup.gate-blocks-controllers asserted on the machine which steps the image's table requires (GET /wiz's missing list) and recommends (each not run yet, never the gate's parts or the optional steps). Both are the setup table's decisions over a record, software with no hardware in them, and forgectrl's setup_test now proves both on the image's own table: the required steps in order (10b), the missing list emptying when they are done (4b), and the recommended steps in order, each not run yet (10b). The catalog keeps what needs the machine: the supervisor holding and spawning the controller, the process, and the Grbl port. - The two missing-list checks and the recommended-list check leave the test's body; its description says where they are proven. - RECOMMENDED_STEPS and NEVER_RECOMMENDED go with them (no test read them any more), and the meta-test case that only compared them. Proof: the forgetest host suite passes under Linux (test_setup_suite with the case removed among it); the coverage lint is unchanged. Acceptance: every setup.py test (the constants were the module's shared text), setup.gate-blocks-controllers among them.
This commit is contained in:
@@ -52,15 +52,6 @@ FORM_WIZARDS = ("advisories", "account", "preferences", "machine", "cloud")
|
|||||||
# the calibration among them, so the form steps are what they walk.
|
# the calibration among them, so the form steps are what they walk.
|
||||||
REQUIRED_FORM_STEPS = ("preferences", "machine", "cloud")
|
REQUIRED_FORM_STEPS = ("preferences", "machine", "cloud")
|
||||||
REQUIRED_STEPS = REQUIRED_FORM_STEPS + ("cooling.flow",)
|
REQUIRED_STEPS = REQUIRED_FORM_STEPS + ("cooling.flow",)
|
||||||
# What the image's step table recommends on a record with the required
|
|
||||||
# steps done and nothing else (setup.c): every step after them. The
|
|
||||||
# cloud header joins on a machine with cloud mode on. The gate's own
|
|
||||||
# parts (the advisories, the account, the required steps, the intake fan
|
|
||||||
# count) are never recommended as not run yet, and the laser floor and
|
|
||||||
# the bed size are offered, never recommended.
|
|
||||||
RECOMMENDED_STEPS = ("switches", "sensors", "airflow", "cooling.aa-offset", "motion",
|
|
||||||
"cameras", "lens.travel", "laser.focus")
|
|
||||||
NEVER_RECOMMENDED = ("advisories", "account", "airflow.intakes", "laser.floor", "motion.envelope")
|
|
||||||
# The setting that counts the intake fans: the gate holds without it.
|
# The setting that counts the intake fans: the gate holds without it.
|
||||||
INTAKE_KEY = "cool_intake_fans"
|
INTAKE_KEY = "cool_intake_fans"
|
||||||
ADVISORY_DOCS = ("safety-and-risk", "licenses", "privacy", "cloud-service")
|
ADVISORY_DOCS = ("safety-and-risk", "licenses", "privacy", "cloud-service")
|
||||||
@@ -393,10 +384,9 @@ _GATE_COVERS = [("forgectrl", "src/setup.*"), ("forgectrl", "src/super.c"),
|
|||||||
"the account and no step done, the same with the reason 'setup required: "
|
"the account and no step done, the same with the reason 'setup required: "
|
||||||
"preferences, machine, cloud, cooling.flow'. With those four done as well and "
|
"preferences, machine, cloud, cooling.flow'. With those four done as well and "
|
||||||
"no flag, the "
|
"no flag, the "
|
||||||
"gate is open with no reason: the supervisor spawns the controller, the Grbl "
|
"gate is open with no reason: the supervisor spawns the controller and the Grbl "
|
||||||
"port accepts, and GET /wiz recommends every other step as not run yet (never "
|
"port accepts. (Which steps the table requires, misses and recommends is "
|
||||||
"the advisories, the account, the four required steps, or the intake fan "
|
"forgectrl's setup_test, on the image's own table.) On that record the intake "
|
||||||
"count; not the optional laser floor or bed size). On that record the intake "
|
|
||||||
"fan count is cleared: the gate closes live with the reason naming the intake "
|
"fan count is cleared: the gate closes live with the reason naming the intake "
|
||||||
"fans, GET /wiz reports them not counted, and the supervisor stops the "
|
"fans, GET /wiz reports them not counted, and the supervisor stops the "
|
||||||
"controller; the count written back as found opens the gate again and the "
|
"controller; the count written back as found opens the gate again and the "
|
||||||
@@ -463,11 +453,6 @@ def gate_blocks_controllers(ctx):
|
|||||||
with ctx.takeover():
|
with ctx.takeover():
|
||||||
write_file(record_path(), encoded(record_without_wizards(record)))
|
write_file(record_path(), encoded(record_without_wizards(record)))
|
||||||
gated("required steps", "setup required: " + ", ".join(REQUIRED_STEPS))
|
gated("required steps", "setup required: " + ", ".join(REQUIRED_STEPS))
|
||||||
# The page opens the steps the gate waits for from this list.
|
|
||||||
w = wiz(fc)
|
|
||||||
ev["missing_none_done"] = w.get("missing")
|
|
||||||
ctx.check(w.get("missing") == list(REQUIRED_STEPS),
|
|
||||||
"GET /wiz does not name the required steps as missing: %s", w.get("missing"))
|
|
||||||
with ctx.takeover():
|
with ctx.takeover():
|
||||||
write_file(record_path(), encoded(record_with_required_steps(record)))
|
write_file(record_path(), encoded(record_with_required_steps(record)))
|
||||||
|
|
||||||
@@ -477,17 +462,7 @@ def gate_blocks_controllers(ctx):
|
|||||||
ev["open_wiz"] = wiz_summary(w)
|
ev["open_wiz"] = wiz_summary(w)
|
||||||
ctx.check(w.get("gate") == "open" and not w.get("why") and w.get("fans_counted") is True,
|
ctx.check(w.get("gate") == "open" and not w.get("why") and w.get("fans_counted") is True,
|
||||||
"the consent, the account, and the required steps do not open the gate: %s", wiz_summary(w))
|
"the consent, the account, and the required steps do not open the gate: %s", wiz_summary(w))
|
||||||
ctx.check(w.get("missing") == [], "GET /wiz names steps as missing with the required ones done: %s",
|
|
||||||
w.get("missing"))
|
|
||||||
running("with the required steps done")
|
running("with the required steps done")
|
||||||
recm = recommended(w)
|
|
||||||
missing = [s for s in RECOMMENDED_STEPS if s not in recm]
|
|
||||||
ctx.check(not missing, "GET /wiz does not recommend %s: %s", missing, recm)
|
|
||||||
stray = [s for s in recm if s in NEVER_RECOMMENDED + REQUIRED_STEPS]
|
|
||||||
ctx.check(not stray, "GET /wiz recommends %s", stray)
|
|
||||||
other = {k: v for k, v in recm.items() if v != "not run yet"}
|
|
||||||
ctx.check(not other, "with nothing else done, steps are recommended for another reason: %s", other)
|
|
||||||
ctx.log("recommended, each not run yet: %s", sorted(recm))
|
|
||||||
|
|
||||||
# the intake fan count holds the gate as the account does
|
# the intake fan count holds the gate as the account does
|
||||||
with Restore(ctx, [INTAKE_KEY]) as count:
|
with Restore(ctx, [INTAKE_KEY]) as count:
|
||||||
|
|||||||
@@ -76,13 +76,7 @@ class RegistrationTests(unittest.TestCase):
|
|||||||
"laser.focus": "the tray was replaced",
|
"laser.focus": "the tray was replaced",
|
||||||
"airflow": "not run yet"})
|
"airflow": "not run yet"})
|
||||||
|
|
||||||
def test_the_gate_parts_and_the_optional_steps_are_never_recommended(self):
|
def test_the_form_wizards_and_the_required_steps(self):
|
||||||
self.assertFalse(set(setup.RECOMMENDED_STEPS) & set(setup.NEVER_RECOMMENDED))
|
|
||||||
self.assertFalse(set(setup.RECOMMENDED_STEPS) & set(setup.REQUIRED_STEPS))
|
|
||||||
for wid in ("advisories", "account", "airflow.intakes", "laser.floor", "motion.envelope"):
|
|
||||||
self.assertIn(wid, setup.NEVER_RECOMMENDED)
|
|
||||||
for wid in ("lens.travel", "laser.focus", "airflow", "switches"):
|
|
||||||
self.assertIn(wid, setup.RECOMMENDED_STEPS)
|
|
||||||
self.assertEqual(setup.FORM_WIZARDS, ("advisories", "account", "preferences", "machine", "cloud"))
|
self.assertEqual(setup.FORM_WIZARDS, ("advisories", "account", "preferences", "machine", "cloud"))
|
||||||
# in the order the gate's reason names them
|
# in the order the gate's reason names them
|
||||||
self.assertEqual(setup.REQUIRED_FORM_STEPS, ("preferences", "machine", "cloud"))
|
self.assertEqual(setup.REQUIRED_FORM_STEPS, ("preferences", "machine", "cloud"))
|
||||||
|
|||||||
Reference in New Issue
Block a user