From 0425326226771e8ab816e455696627e4267fb6dc Mon Sep 17 00:00:00 2001 From: Joshua Date: Mon, 21 Sep 2026 15:58:11 -0400 Subject: [PATCH] Add no-HA end-to-end smoke test for the bundled core package (task 628473ad) 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. --- tests/test_core_no_ha_smoke.py | 230 +++++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 tests/test_core_no_ha_smoke.py diff --git a/tests/test_core_no_ha_smoke.py b/tests/test_core_no_ha_smoke.py new file mode 100644 index 0000000..69a3dce --- /dev/null +++ b/tests/test_core_no_ha_smoke.py @@ -0,0 +1,230 @@ +"""No-HA end-to-end smoke test (task 628473ad). + +The bundled core package (``custom_components.nestquest.core``) is +self-contained and Home-Assistant-free, but the parent integration +package ``custom_components.nestquest`` is NOT: its ``__init__.py`` +imports ``homeassistant``. A genuine "core runs with no Home +Assistant installed" proof therefore cannot live inside the suite +process — the suite's ``conftest.py`` installs mock ``homeassistant`` +modules globally before any test imports the integration, so an +in-process exercise can never distinguish "core never touched HA" +from "conftest already stubbed HA for us". + +This module runs the smoke test in a SUBPROCESS (``sys.executable -c +