From 9207660c87b7bb077d41b9dc328a37ef9a526134 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 10:48:23 +0100 Subject: [PATCH] test: fix main ci shard routing --- src/gateway/server-startup-post-attach.test.ts | 8 +++++++- src/plugins/plugin-lookup-table.test.ts | 1 + test/vitest/vitest.unit-security.config.ts | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gateway/server-startup-post-attach.test.ts b/src/gateway/server-startup-post-attach.test.ts index d7fd1f1907a..ecd3114d309 100644 --- a/src/gateway/server-startup-post-attach.test.ts +++ b/src/gateway/server-startup-post-attach.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import type { PluginHookGatewayContext, PluginHookGatewayStartEvent, @@ -184,6 +184,8 @@ type PostAttachRuntimeDeps = NonNullable { beforeEach(() => { + vi.stubEnv("OPENCLAW_SKIP_CHANNELS", "0"); + vi.stubEnv("OPENCLAW_SKIP_PROVIDERS", "0"); hoisted.startPluginServices.mockClear(); hoisted.startGmailWatcherWithLogs.mockClear(); hoisted.loadInternalHooks.mockClear(); @@ -215,6 +217,10 @@ describe("startGatewayPostAttachRuntime", () => { hoisted.ensureOpenClawModelsJson.mockResolvedValue(undefined); }); + afterEach(() => { + vi.unstubAllEnvs(); + }); + it("re-enables startup-gated methods after post-attach sidecars start", async () => { const unavailableGatewayMethods = new Set(["chat.history", "models.list"]); const onSidecarsReady = vi.fn(); diff --git a/src/plugins/plugin-lookup-table.test.ts b/src/plugins/plugin-lookup-table.test.ts index af225416323..24bf9a86603 100644 --- a/src/plugins/plugin-lookup-table.test.ts +++ b/src/plugins/plugin-lookup-table.test.ts @@ -20,6 +20,7 @@ vi.mock("../channels/config-presence.js", () => ({ env: NodeJS.ProcessEnv, options?: { includePersistedAuthState?: boolean }, ) => listPotentialConfiguredChannelIds(config, env, options), + listExplicitlyDisabledChannelIdsForConfig: () => [], })); vi.mock("./manifest-registry-installed.js", async (importOriginal) => { diff --git a/test/vitest/vitest.unit-security.config.ts b/test/vitest/vitest.unit-security.config.ts index 2a3c4ef724c..c62a6f85446 100644 --- a/test/vitest/vitest.unit-security.config.ts +++ b/test/vitest/vitest.unit-security.config.ts @@ -3,4 +3,5 @@ import { createUnitVitestConfigWithOptions } from "./vitest.unit.config.ts"; export default createUnitVitestConfigWithOptions(process.env, { name: "unit-security", includePatterns: ["src/security/**/*.test.ts"], + passWithNoTests: true, });