mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-25 17:58:01 +00:00
* Fix test suite: ESM loading and stub isolation (refs #605) Three targeted fixes to reduce suite failures from 9 → 1: 1. package.json: add "type": "module" so Node loads static/js/** as ES modules. Fixes 7 tests in test_compare_js.py and test_reply_recipients_js.py that fail with "SyntaxError: Unexpected token 'export'". 2. test_null_owner_gates.py: add Base and ChatMessage to the core.database stub. Without Base the scheduler test cannot import at collection time; without ChatMessage core/__init__.py fails mid-load when session_manager.py tries to import it, leaving core partially initialised in sys.modules and poisoning the auth manager migration test that runs later in the same file. 3. test_task_scheduler_session_delivery.py: skip gracefully when core.database is stubbed (Base is a MagicMock) rather than crashing. The test passes correctly when run in isolation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Scope ESM declaration to static/js/ and document isolation workaround Per review feedback on #844: 1. Move "type": "module" from root package.json to static/js/package.json. The root package.json had no type field (defaulted to CJS) and should stay that way — vendored UMD bundles in static/lib/ use require() internally and would break if Node ever tried to load them as ES modules. Node resolves the nearest package.json, so adding it in static/js/ scopes the ESM declaration to just the files the JS unit tests actually load (compare/state.js, emailLibrary/replyRecipients.js). 2. Expand the module-level skip comment in test_task_scheduler_session_delivery to document that it is a temporary isolation workaround, explain root cause (test_null_owner_gates installs a module-level sys.modules stub with no cleanup), record before/after suite numbers, and note the clean path (refactor to fixture-scoped stub). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bombadil-spec.ts | ||
| conftest.py | ||
| test_action_intents.py | ||
| test_agent_loop.py | ||
| test_app.py | ||
| test_app_static_mime.py | ||
| test_auth_event_loop.py | ||
| test_auth_regressions.py | ||
| test_auth_session_revocation.py | ||
| test_backup_cli_security.py | ||
| test_calendar_owner_scope.py | ||
| test_calendar_recurrence.py | ||
| test_chat_stream_scope.py | ||
| test_chroma_client.py | ||
| test_companion_readonly.py | ||
| test_compare_js.py | ||
| test_context_compactor.py | ||
| test_cookbook_helpers.py | ||
| test_deep_research_extraction_controls.py | ||
| test_document_tool_owner_scope.py | ||
| test_endpoint_resolver.py | ||
| test_esc_menu_stack_js.py | ||
| test_gallery_image_privileges.py | ||
| test_hwfit_macos.py | ||
| test_keybind_altgr_js.py | ||
| test_llm_core_anthropic_cache.py | ||
| test_llm_core_concurrency.py | ||
| test_llm_core_ollama.py | ||
| test_llm_core_sanitize_tool_calls.py | ||
| test_markitdown_runtime.py | ||
| test_memory_extractor_vector_degraded.py | ||
| test_model_context.py | ||
| test_model_routes.py | ||
| test_null_owner_gates.py | ||
| test_pdf_runtime.py | ||
| test_personal_docs_office_index.py | ||
| test_personal_docs_pdf_index.py | ||
| test_personal_upload_isolation.py | ||
| test_provider_detection.py | ||
| test_rate_limiter.py | ||
| test_reply_recipients_js.py | ||
| test_research_service.py | ||
| test_research_session_id_validation.py | ||
| test_research_utils.py | ||
| test_reserved_username_admin_escalation.py | ||
| test_review_regressions.py | ||
| test_search_cache_invalidation.py | ||
| test_search_query.py | ||
| test_search_ranking.py | ||
| test_security_regressions.py | ||
| test_session_mode_helpers.py | ||
| test_settings_scrub.py | ||
| test_setup_admin_user.py | ||
| test_shell_routes.py | ||
| test_skill_index_prompt_injection.py | ||
| test_skills_manager_owner_isolation.py | ||
| test_speech_service_toggles.py | ||
| test_task_scheduler_session_delivery.py | ||
| test_vision_model_detection.py | ||
| test_visual_report.py | ||
| test_webhook_trigger_auth_exempt.py | ||