mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
test: fix main ci shard routing
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import type {
|
import type {
|
||||||
PluginHookGatewayContext,
|
PluginHookGatewayContext,
|
||||||
PluginHookGatewayStartEvent,
|
PluginHookGatewayStartEvent,
|
||||||
@@ -184,6 +184,8 @@ type PostAttachRuntimeDeps = NonNullable<Parameters<typeof startGatewayPostAttac
|
|||||||
|
|
||||||
describe("startGatewayPostAttachRuntime", () => {
|
describe("startGatewayPostAttachRuntime", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
vi.stubEnv("OPENCLAW_SKIP_CHANNELS", "0");
|
||||||
|
vi.stubEnv("OPENCLAW_SKIP_PROVIDERS", "0");
|
||||||
hoisted.startPluginServices.mockClear();
|
hoisted.startPluginServices.mockClear();
|
||||||
hoisted.startGmailWatcherWithLogs.mockClear();
|
hoisted.startGmailWatcherWithLogs.mockClear();
|
||||||
hoisted.loadInternalHooks.mockClear();
|
hoisted.loadInternalHooks.mockClear();
|
||||||
@@ -215,6 +217,10 @@ describe("startGatewayPostAttachRuntime", () => {
|
|||||||
hoisted.ensureOpenClawModelsJson.mockResolvedValue(undefined);
|
hoisted.ensureOpenClawModelsJson.mockResolvedValue(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
vi.unstubAllEnvs();
|
||||||
|
});
|
||||||
|
|
||||||
it("re-enables startup-gated methods after post-attach sidecars start", async () => {
|
it("re-enables startup-gated methods after post-attach sidecars start", async () => {
|
||||||
const unavailableGatewayMethods = new Set<string>(["chat.history", "models.list"]);
|
const unavailableGatewayMethods = new Set<string>(["chat.history", "models.list"]);
|
||||||
const onSidecarsReady = vi.fn();
|
const onSidecarsReady = vi.fn();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ vi.mock("../channels/config-presence.js", () => ({
|
|||||||
env: NodeJS.ProcessEnv,
|
env: NodeJS.ProcessEnv,
|
||||||
options?: { includePersistedAuthState?: boolean },
|
options?: { includePersistedAuthState?: boolean },
|
||||||
) => listPotentialConfiguredChannelIds(config, env, options),
|
) => listPotentialConfiguredChannelIds(config, env, options),
|
||||||
|
listExplicitlyDisabledChannelIdsForConfig: () => [],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock("./manifest-registry-installed.js", async (importOriginal) => {
|
vi.mock("./manifest-registry-installed.js", async (importOriginal) => {
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ import { createUnitVitestConfigWithOptions } from "./vitest.unit.config.ts";
|
|||||||
export default createUnitVitestConfigWithOptions(process.env, {
|
export default createUnitVitestConfigWithOptions(process.env, {
|
||||||
name: "unit-security",
|
name: "unit-security",
|
||||||
includePatterns: ["src/security/**/*.test.ts"],
|
includePatterns: ["src/security/**/*.test.ts"],
|
||||||
|
passWithNoTests: true,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user