From 1c9f4148d000891bd3e8c089cea720eb16c9799b Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 27 Mar 2026 00:56:55 +0900 Subject: [PATCH] fix(publish-ci): sync mock-heavy test isolation with ci.yml Apply the same mock.module() isolation fixes to publish.yml: - Move shared and session-recovery mock-heavy tests to isolated section - Use dynamic find + exclusion for remaining src/shared tests - Include session-recovery tests in remaining batch Ensures publish workflow has the same test config as main CI run. --- .github/workflows/publish.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8a6f6e50d..1c90014f7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -61,16 +61,31 @@ jobs: bun test src/features/opencode-skill-loader/loader.test.ts bun test src/hooks/anthropic-context-window-limit-recovery/recovery-hook.test.ts bun test src/hooks/anthropic-context-window-limit-recovery/executor.test.ts + # src/shared mock-heavy files (mock.module pollutes connected-providers-cache and legacy-plugin-warning) + bun test src/shared/model-capabilities.test.ts + bun test src/shared/log-legacy-plugin-startup-warning.test.ts + bun test src/shared/model-error-classifier.test.ts + bun test src/shared/opencode-message-dir.test.ts + # session-recovery mock isolation (recover-tool-result-missing mocks ./storage) + bun test src/hooks/session-recovery/recover-tool-result-missing.test.ts - name: Run remaining tests run: | # Enumerate subdirectories/files explicitly to EXCLUDE mock-heavy files # that were already run in isolation above. + # Excluded from src/shared: model-capabilities, log-legacy-plugin-startup-warning, model-error-classifier, opencode-message-dir # Excluded from src/cli: doctor/formatter.test.ts, doctor/format-default.test.ts # Excluded from src/tools: call-omo-agent/sync-executor.test.ts, call-omo-agent/session-creator.test.ts, session-manager (all) # Excluded from src/hooks/anthropic-context-window-limit-recovery: recovery-hook.test.ts, executor.test.ts + # Build src/shared file list excluding mock-heavy files already run in isolation + SHARED_FILES=$(find src/shared -name '*.test.ts' \ + ! -name 'model-capabilities.test.ts' \ + ! -name 'log-legacy-plugin-startup-warning.test.ts' \ + ! -name 'model-error-classifier.test.ts' \ + ! -name 'opencode-message-dir.test.ts' \ + | sort | tr '\n' ' ') bun test bin script src/config src/mcp src/index.test.ts \ - src/agents src/shared \ + src/agents $SHARED_FILES \ src/cli/run src/cli/config-manager src/cli/mcp-oauth \ src/cli/index.test.ts src/cli/install.test.ts src/cli/model-fallback.test.ts \ src/cli/config-manager.test.ts \ @@ -83,6 +98,7 @@ jobs: src/tools/call-omo-agent/background-executor.test.ts \ src/tools/call-omo-agent/subagent-session-creator.test.ts \ src/hooks/anthropic-context-window-limit-recovery/empty-content-recovery-sdk.test.ts src/hooks/anthropic-context-window-limit-recovery/parser.test.ts src/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.test.ts src/hooks/anthropic-context-window-limit-recovery/recovery-deduplication.test.ts src/hooks/anthropic-context-window-limit-recovery/storage.test.ts \ + src/hooks/session-recovery/detect-error-type.test.ts src/hooks/session-recovery/index.test.ts src/hooks/session-recovery/recover-empty-content-message-sdk.test.ts src/hooks/session-recovery/resume.test.ts src/hooks/session-recovery/storage \ src/hooks/claude-code-compatibility \ src/hooks/context-injection \ src/hooks/provider-toast \