test(gateway): isolate Matrix and Telegram fixture globals - #40697
test(gateway): isolate Matrix and Telegram fixture globals#40697c0nSpIc0uS7uRk3r wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating a difficult gateway-test-ordering issue. The patch needs re-scoping before it can apply to current main.
Problems
gateway/platforms/matrix.pywas moved toplugins/platforms/matrix/adapter.pyby560010547; the PR's Matrix runtime changes target a removed path. Current rebinding is handled inplugins/platforms/matrix/adapter.py:665-721throughensure_and_bind().- The added
adapter.platform = Platform.TELEGRAMdoes not affect guest-mode gating:TelegramAdapter._telegram_guest_mode()readsconfig.extra/TELEGRAM_GUEST_MODEatplugins/platforms/telegram/adapter.py:6713-6720.
Suggested changes
- Revalidate the suite-order failure using the active
plugins.platforms.matrix.adapterandplugins.platforms.telegram.adapterimports, then port only the necessary test isolation. - Drop the guest-fixture platform assignment unless a current behavior depending on it is demonstrated by a regression test.
Automated hermes-sweeper review.
| @@ -709,6 +758,7 @@ async def _verify_device_keys_on_server(self, client: Any, olm: Any) -> bool: | |||
|
|
|||
There was a problem hiding this comment.
Current main moved this adapter to plugins/platforms/matrix/adapter.py in 560010547; this call targets a removed production path. Please revalidate and port any needed binding behavior to the active plugin adapter.
|
Thanks @strickvl — closing as resolved on main: the telegram half is superseded by @mehmetkr-31's #68873 (merged via PR #74576) — a PTB-faithful str-enum _FakeEnumMember in the shared gateway conftest, bound to both constants access paths; the matrix half patches gateway/platforms/matrix.py which has since moved to plugins/platforms/matrix/, and the single-process ordering failure mode is gone under the per-file-subprocess runner. Both target test files verified 141-pass hermetic on current main. |
Summary
This opens a separate gateway test-fixture cleanup workstream for broader Matrix/Telegram gateway failures that reproduced on
origin/mainindependently of HONCHO-KIMI26 PR #40668.Changes:
mautrix.typesglobals when lightweight test/runtime modules are installed late, preventing broad-suite Matrix module-global drift.ParseMode.MARKDOWN_V2remains string-compatible while preserving enum-style repr expectations.Platform.TELEGRAM, matching normal adapter initialization.Touched files:
gateway/platforms/matrix.pytests/gateway/conftest.pytests/gateway/test_telegram_format.pyBackground
Baseline broad gateway failures were reproduced on current
origin/mainwithout PR #40668, so this cleanup is intentionally separate from the HONCHO-KIMI26 webhook/status hardening branch.Prior origin/main baseline:
Verification
Final full gateway verification artifact:
Final result:
Additional hygiene:
Safety
No production memory, jarvis-memory, ChromaDB, or live/social gateway connections were touched. Verification used isolated artifact
HERMES_HOMEpaths.PR #40668 boundary
PR #40668 remains separate and draft/open. This PR should not merge or mark PR #40668 ready.