No-HA end-to-end smoke test for the bundled core package (task 628473ad) #145

Member

Task 628473ad: No-HA end-to-end smoke test and integration import wiring.

Done-condition: a smoke test opens a fresh SQLite file, creates two children and a quest definition with a recurrence rule and a window, runs materialize over a 28-day window, completes an instance, and derives its state — ALL in a process with NO homeassistant installed. The HA integration still imports the moved modules from core/ and its existing tests pass.

The smoke test runs in a SUBPROCESS (sys.executable -c) so it is a real no-HA process, not the suite process (the suite conftest stubs homeassistant globally). The subprocess:

  • asserts homeassistant is not in sys.modules BEFORE importing core;
  • stubs the parent package custom_components.nestquest as a bare ModuleType whose path points at the real custom_components/nestquest directory, installed into sys.modules WITHOUT executing its HA-importing init;
  • installs a custom_components namespace entry so the subpackage resolves;
  • imports the core modules (db, migrations, children, quest_definitions, materialize, completion, recurrence);
  • asserts homeassistant is STILL not in sys.modules AFTER importing core;
  • opens a fresh SQLite file, applies migrations, creates two children and one daily quest definition with a morning window, runs materialize over a 28-day window, completes one instance via complete_instance(actor_source=panel, actor_child_id=), and derives the instance state asserting it is done;
  • prints NO-HA SMOKE TEST OK.

The pytest test asserts the subprocess exit code is 0 and the marker is printed, and fails with the subprocess stderr otherwise.

Invariants confirmed: no homeassistant import under core/; no top-level bare core import under the integration; no repo-root core/.

Suite: 1576 passed (1575 baseline + 1 new smoke test).

Task 628473ad: No-HA end-to-end smoke test and integration import wiring. Done-condition: a smoke test opens a fresh SQLite file, creates two children and a quest definition with a recurrence rule and a window, runs materialize over a 28-day window, completes an instance, and derives its state — ALL in a process with NO homeassistant installed. The HA integration still imports the moved modules from core/ and its existing tests pass. The smoke test runs in a SUBPROCESS (sys.executable -c) so it is a real no-HA process, not the suite process (the suite conftest stubs homeassistant globally). The subprocess: - asserts homeassistant is not in sys.modules BEFORE importing core; - stubs the parent package custom_components.nestquest as a bare ModuleType whose __path__ points at the real custom_components/nestquest directory, installed into sys.modules WITHOUT executing its HA-importing __init__; - installs a custom_components namespace entry so the subpackage resolves; - imports the core modules (db, migrations, children, quest_definitions, materialize, completion, recurrence); - asserts homeassistant is STILL not in sys.modules AFTER importing core; - opens a fresh SQLite file, applies migrations, creates two children and one daily quest definition with a morning window, runs materialize over a 28-day window, completes one instance via complete_instance(actor_source=panel, actor_child_id=<child>), and derives the instance state asserting it is done; - prints NO-HA SMOKE TEST OK. The pytest test asserts the subprocess exit code is 0 and the marker is printed, and fails with the subprocess stderr otherwise. Invariants confirmed: no homeassistant import under core/; no top-level bare core import under the integration; no repo-root core/. Suite: 1576 passed (1575 baseline + 1 new smoke test).
dev_agent added 1 commit 2026-09-21 15:58:18 -04:00
Run the storage/engines/business stack end-to-end in a subprocess that
has no homeassistant installed: open a fresh SQLite file, apply
migrations, create two children and a daily quest definition with a
morning window, materialize over 28 days, complete one instance via
the panel actor, and derive its state as 'done'.  The subprocess stubs
the parent custom_components.nestquest package (a bare ModuleType
whose __path__ points at the real directory) into sys.modules WITHOUT
executing its HA-importing __init__, so importing the core subpackage
is a genuine no-HA proof rather than one masked by conftest's global
HA mocks.

Guards the storage/engines/business extraction (tasks d0b691d8 /
510c1f78 / 4dd8f870) from regressing into a HA-coupled bundle.
dev_agent merged commit e78edbae3b into feature/a9513378-856c-4ced-8722-c99850d3a524-domain-core-extraction 2026-09-21 16:00:35 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/NestQuest#145