test: trim import-heavy startup paths

This commit is contained in:
Peter Steinberger
2026-03-22 16:32:45 +00:00
parent 3fa2300ba1
commit 1d2dff0c4e
4 changed files with 5 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ import { buildPluginSdkEntrySources, pluginSdkEntrypoints } from "./entrypoints.
const require = createRequire(import.meta.url);
const tsdownModuleUrl = pathToFileURL(require.resolve("tsdown")).href;
const bundledRepresentativeEntrypoints = ["outbound-runtime", "matrix-runtime-heavy"] as const;
const bundledRepresentativeEntrypoints = ["matrix-runtime-heavy"] as const;
const bundledCoverageEntrySources = buildPluginSdkEntrySources(bundledRepresentativeEntrypoints);
describe("plugin-sdk bundled exports", () => {

View File

@@ -49,14 +49,7 @@ const ROOT_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const PLUGIN_SDK_DIR = resolve(ROOT_DIR, "plugin-sdk");
const requireFromHere = createRequire(import.meta.url);
const sourceCache = new Map<string, string>();
const representativeRuntimeSmokeSubpaths = [
"channel-runtime",
"conversation-runtime",
"provider-auth",
"provider-setup",
"setup",
"webhook-ingress",
] as const;
const representativeRuntimeSmokeSubpaths = ["channel-runtime", "conversation-runtime"] as const;
const importResolvedPluginSdkSubpath = async (specifier: string) =>
import(pathToFileURL(requireFromHere.resolve(specifier)).href);

View File

@@ -4,7 +4,6 @@ import * as tar from "tar";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { safePathSegmentHashed } from "../infra/install-safe-path.js";
import { runCommandWithTimeout } from "../process/exec.js";
import * as skillScanner from "../security/skill-scanner.js";
import {
expectSingleNpmInstallIgnoreScriptsCall,
expectSingleNpmPackIgnoreScriptsCall,
@@ -14,6 +13,7 @@ import {
expectIntegrityDriftRejected,
mockNpmPackMetadataResult,
} from "../test-utils/npm-spec-install-test-helpers.js";
import * as installSecurityScan from "./install-security-scan.js";
import {
installPluginFromArchive,
installPluginFromDir,
@@ -689,7 +689,7 @@ describe("installPluginFromArchive", () => {
it("continues install when scanner throws", async () => {
const scanSpy = vi
.spyOn(skillScanner, "scanDirectoryWithSummary")
.spyOn(installSecurityScan, "scanPackageInstallSource")
.mockRejectedValueOnce(new Error("scanner exploded"));
const { pluginDir, extensionsDir } = setupPluginInstallDirs();

View File

@@ -5,7 +5,7 @@ import { afterAll, afterEach, describe, expect, it } from "vitest";
import { emitDiagnosticEvent, resetDiagnosticEventsForTest } from "../infra/diagnostic-events.js";
import { buildMemoryPromptSection, registerMemoryPromptSection } from "../memory/prompt-section.js";
import { withEnv } from "../test-utils/env.js";
import { clearPluginCommands, getPluginCommandSpecs } from "./commands.js";
import { clearPluginCommands, getPluginCommandSpecs } from "./command-registry-state.js";
import { getGlobalHookRunner, resetGlobalHookRunner } from "./hook-runner-global.js";
import { createHookRunner } from "./hooks.js";
import { __testing, clearPluginLoaderCache, loadOpenClawPlugins } from "./loader.js";