test_gateway_image probes pre-refactor flat modules (import supervise) and fails when run #429

Closed
opened 2026-07-20 13:40:08 -04:00 by didericis · 0 comments
Owner

Problem

tests/integration/test_gateway_image.py::test_python_imports_supervise_module probes the image with:

"import supervise; import supervise_server; print('ok')"

Those are the pre-5ad3449 flat sibling modules. They now live in the installed package as bot_bottle.supervise and bot_bottle.supervise_server; there is no top-level supervise.py in the repo. Run against the current image the test fails:

ModuleNotFoundError: No module named 'supervise'

Why it hasn't been noticed

The whole TestGatewayImage class carries @unittest.skipIf(os.environ.get("GITEA_ACTIONS") == "true", ...) — it is marked interactive-only because the build pulls a large base and the runner's storage/time budget can't take it. So it never executes in CI and only fails for someone running the integration suite by hand.

This is the same stale-reference class as #427: the 5ad3449 refactor left assertions pointing at the old flat layout, and nothing executed them.

Fix

Probe the package imports instead. With that change all 4 tests in the class pass locally against a freshly built gateway image.

Out of scope

Whether this class should run in CI at all is a separate question — it overlaps #414 (per-backend skip visibility) and #426 (no macOS runner). This issue is only about the assertion being wrong.

## Problem `tests/integration/test_gateway_image.py::test_python_imports_supervise_module` probes the image with: ```python "import supervise; import supervise_server; print('ok')" ``` Those are the pre-`5ad3449` flat sibling modules. They now live in the installed package as `bot_bottle.supervise` and `bot_bottle.supervise_server`; there is no top-level `supervise.py` in the repo. Run against the current image the test fails: ``` ModuleNotFoundError: No module named 'supervise' ``` ## Why it hasn't been noticed The whole `TestGatewayImage` class carries `@unittest.skipIf(os.environ.get("GITEA_ACTIONS") == "true", ...)` — it is marked interactive-only because the build pulls a large base and the runner's storage/time budget can't take it. So it never executes in CI and only fails for someone running the integration suite by hand. This is the same stale-reference class as #427: the `5ad3449` refactor left assertions pointing at the old flat layout, and nothing executed them. ## Fix Probe the package imports instead. With that change all 4 tests in the class pass locally against a freshly built gateway image. ## Out of scope Whether this class should run in CI at all is a separate question — it overlaps #414 (per-backend skip visibility) and #426 (no macOS runner). This issue is only about the assertion being wrong.
didericis added the Kind/BugKind/Testing labels 2026-07-20 13:40:09 -04:00
gitea-actions bot added the Status/Needs Triage label 2026-07-20 13:40:13 -04:00
didericis added
Priority
High
2
and removed Status/Needs Triage labels 2026-07-20 13:42:17 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#429