mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +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 {
|
||||
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();
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user