molecule-core/workspace/tests
Molecule AI Core-BE 76ac5a88dc
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
sop-tier-check / tier-check (pull_request) Failing after 4s
[core-be-agent]
fix(tests): clear platform_auth cache before each test

Fixes issue #160: workspace tests fail when MOLECULE_WORKSPACE_TOKEN
is set in the environment.

The bug: platform_auth._cached_token is populated at module import or
first get_token() call and persists for the process lifetime. Tests
that use monkeypatch.delenv("MOLECULE_WORKSPACE_TOKEN") to simulate "no
token in env" were failing because delenv removes the env var but not
the module-level cache — subsequent get_token() calls returned the
stale cached value.

Fix: add a function-scoped autouse fixture in conftest.py that calls
platform_auth.clear_cache() before every test. The import is inside the
fixture to avoid collection-time import issues when platform_auth is
not yet available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 22:16:11 +00:00
..
adapters
snapshots feat(mcp): cross-workspace delegation routing (multi-ws PR-2) 2026-05-04 08:32:24 -07:00
__init__.py
_signature_snapshot.py test(runtime_wedge): module-functions signature snapshot drift gate 2026-04-30 07:01:10 -07:00
conftest.py [core-be-agent] 2026-05-09 22:16:11 +00:00
test_a2a_cli.py
test_a2a_client.py test(e2e): Phase 3.5 — wheel parser classifies real server response (#2967) 2026-05-05 17:31:45 -07:00
test_a2a_executor.py fix(a2a): route terminal Message via TaskUpdater.complete/failed in task mode 2026-05-03 04:06:45 -07:00
test_a2a_mcp_server.py docs(a2a-mcp): close three contract gaps codex agents inherit out-of-the-box 2026-05-05 02:26:35 -07:00
test_a2a_multi_workspace.py fix(tests): retarget get_peers_with_diagnostic patches to a2a_tools_messaging (RFC #2873 iter 4d) 2026-05-05 09:52:15 -07:00
test_a2a_response.py fix(a2a): SSOT response parser — handle poll-mode queued envelope (#2967) 2026-05-05 17:21:28 -07:00
test_a2a_tools_delegation.py refactor(workspace): extract delegation handlers from a2a_tools.py to a2a_tools_delegation.py (RFC #2873 iter 4b) 2026-05-05 05:00:52 -07:00
test_a2a_tools_impl.py refactor(workspace): extract messaging tools from a2a_tools.py to a2a_tools_messaging.py (RFC #2873 iter 4d) 2026-05-05 09:50:47 -07:00
test_a2a_tools_inbox_enrichment.py fix(tests): drop unused json + pytest imports 2026-05-05 13:26:49 -07:00
test_a2a_tools_inbox_split.py refactor(workspace): extract inbox tools from a2a_tools.py (RFC #2873 iter 4e) 2026-05-05 14:28:58 -07:00
test_a2a_tools_inbox_wrappers.py test(a2a_tools): cover inbox tool wrappers to restore 75% per-file floor 2026-05-05 13:59:58 -07:00
test_a2a_tools_memory.py refactor(workspace): extract memory tools from a2a_tools.py to a2a_tools_memory.py (RFC #2873 iter 4c) 2026-05-05 09:50:39 -07:00
test_a2a_tools_messaging.py refactor(workspace): extract messaging tools from a2a_tools.py to a2a_tools_messaging.py (RFC #2873 iter 4d) 2026-05-05 09:50:47 -07:00
test_a2a_tools_module.py
test_a2a_tools_rbac.py refactor(workspace): extract RBAC helpers from a2a_tools.py to a2a_tools_rbac.py (RFC #2873 iter 4a) 2026-05-05 04:43:16 -07:00
test_adapter_base_event_log.py feat(workspace): wire EventLog into adapter base (#119 PR-3b) 2026-05-03 01:18:19 -07:00
test_adapter_base_signature.py test: extract shared signature-snapshot helpers + skill_loader gate 2026-04-30 06:27:20 -07:00
test_agent_card_well_known_path.py fix(workspace): use SDK constant for agent-card readiness probe 2026-04-27 16:43:32 -07:00
test_agent.py
test_agents_md.py
test_approval.py
test_audit_ledger.py
test_audit.py
test_awareness_client_full.py
test_boot_routes.py test(runtime): pin PR #2756's card-vs-setup decoupling with build_routes helper 2026-05-04 14:59:56 -07:00
test_card_helpers.py fix(runtime): isolate card-skill enrichment + transcript handler from adapter shape mismatch 2026-05-04 14:15:27 -07:00
test_compliance.py
test_config.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_configs_dir.py fix(runtime): auto-fallback CONFIGS_DIR for non-container hosts (closes #2458) 2026-05-01 13:07:55 -07:00
test_consolidation.py
test_coordinator_parent.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_coordinator_routing.py feat(platform): single-source-of-truth tool registry — adapters consume, no drift 2026-04-28 17:11:36 -07:00
test_delegation_sync_via_polling.py fix(a2a): SSOT response parser — handle poll-mode queued envelope (#2967) 2026-05-05 17:21:28 -07:00
test_delegation.py feat(platform): single-source-of-truth tool registry — adapters consume, no drift 2026-04-28 17:11:36 -07:00
test_dispatcher_schema_drift.py test(mcp): structural gate — schema↔dispatcher drift catches dropped kwargs 2026-05-04 16:29:54 -07:00
test_event_log.py feat(workspace): event_log module + EventLogConfig (#119 PR-2) 2026-05-03 00:17:12 -07:00
test_events.py
test_executor_helpers.py fix(a2a): send v1 file Part shape; tolerate v1 server-side 2026-05-02 00:58:05 -07:00
test_gh_wrapper.sh
test_governance.py
test_heartbeat_runtime_metadata.py
test_heartbeat.py feat(workspace): wire observability config into heartbeat + uvicorn (#119 PR-3a) 2026-05-03 01:01:57 -07:00
test_hitl.py
test_inbox_uploads.py fix(inbox-uploads): cancel BatchFetcher futures on wait_all timeout 2026-05-05 12:34:41 -07:00
test_inbox.py test(inbox): clean up daemon poller thread to prevent test cross-talk 2026-05-05 11:47:14 -07:00
test_internal_chat_uploads.py fix(workspace): surface errno + path on chat-upload mkdir failure 2026-05-01 11:47:53 -07:00
test_internal_file_read.py feat(chat_files): rewrite Download as HTTP-forward (RFC #2312, PR-D) 2026-04-29 15:19:02 -07:00
test_jsonrpc_wire_role_format.py
test_load_skills_call_sites.py chore(workspace): remove dead defensive block in load_skills AST gate 2026-05-03 01:30:05 -07:00
test_main_initial_prompt.py
test_mcp_cli_multi_workspace.py fix(tests): isolate token resolution from real .auth_token on disk 2026-05-09 21:55:29 +00:00
test_mcp_cli_split.py mcp: surface specific TOKEN_FILE errors + link follow-ups (#2934) 2026-05-05 15:07:15 -07:00
test_mcp_cli.py refactor(workspace): split mcp_cli.py (626 LOC) into focused modules (RFC #2873 iter 3) 2026-05-05 04:33:06 -07:00
test_mcp_doctor.py fix(tests): isolate token resolution from real .auth_token on disk 2026-05-09 21:55:29 +00:00
test_mcp_memory.py fix(tests): patch a2a_tools_memory.httpx, not a2a_tools.httpx 2026-05-05 13:25:06 -07:00
test_memory.py feat(platform): single-source-of-truth tool registry — adapters consume, no drift 2026-04-28 17:11:36 -07:00
test_molecule_ai_status.py
test_namespaces.py
test_not_configured_handler.py fix(runtime): decouple agent-card readiness from adapter.setup() 2026-05-04 10:22:31 -07:00
test_openclaw_adapter.py
test_platform_auth_signature.py test(platform_auth): module-functions signature snapshot drift gate 2026-04-30 08:41:42 -07:00
test_platform_auth.py fix(runtime): auto-fallback CONFIGS_DIR for non-container hosts (closes #2458) 2026-05-01 13:07:55 -07:00
test_platform_inbound_auth.py fix(runtime): auto-fallback CONFIGS_DIR for non-container hosts (closes #2458) 2026-05-01 13:07:55 -07:00
test_platform_tools.py chore(registry): snapshot tests + CLI-block alignment for #2240 2026-04-28 20:42:15 -07:00
test_plugins_builtins.py
test_plugins_registry.py
test_plugins.py
test_pre_stop.py
test_preflight.py fix(preflight): downgrade required_env + auth_token failures to warnings 2026-05-04 12:20:34 -07:00
test_prompt.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_routing_policy.py
test_runtime_capabilities.py
test_runtime_wedge_signature.py test(runtime_wedge): module-functions signature snapshot drift gate 2026-04-30 07:01:10 -07:00
test_runtime_wedge.py chore(tests): drop redundant local _reset fixture from test_runtime_wedge 2026-05-01 18:31:21 -07:00
test_safe_env.py
test_sandbox.py
test_secret_redact.py fix(tests): patch a2a_tools_memory.httpx, not a2a_tools.httpx 2026-05-05 13:25:06 -07:00
test_secret_redactor.py fix(runtime): redact secret-shaped tokens from JSON-RPC error.data 2026-05-04 15:07:53 -07:00
test_security_scan.py
test_shared_runtime_peer_summary.py fix(workspace): keep peers visible in coordinator prompt when agent_card is null 2026-04-28 14:10:29 -07:00
test_skill_loader_signature.py test: extract shared signature-snapshot helpers + skill_loader gate 2026-04-30 06:27:20 -07:00
test_skills_loader.py
test_skills_watcher.py
test_smoke_mode.py chore(smoke): runtime_wedge follow-ups from PR #2473 review 2026-05-01 18:01:51 -07:00
test_snapshot_scrub.py
test_telemetry.py
test_temporal_workflow.py
test_transcript_auth.py tech-debt: rename molecule-monorepo-net -> molecule-core-net 2026-05-09 20:51:48 +00:00
test_watcher.py