test: fix main ci shard routing

This commit is contained in:
Peter Steinberger
2026-04-28 10:48:23 +01:00
parent ae63f76bbd
commit 9207660c87
3 changed files with 9 additions and 1 deletions

View File

@@ -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<Parameters<typeof startGatewayPostAttac
describe("startGatewayPostAttachRuntime", () => {
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<string>(["chat.history", "models.list"]);
const onSidecarsReady = vi.fn();

View File

@@ -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) => {

View File

@@ -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,
});