Skip to content

Commit 5307fa0

Browse files
committed
test(plugins): keep startup coverage within lint budget
1 parent 66ede59 commit 5307fa0

1 file changed

Lines changed: 11 additions & 30 deletions

File tree

‎src/plugins/bundled-plugin-metadata.test.ts‎

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { spawnSync } from "node:child_process";
33
import fs from "node:fs";
44
import path from "node:path";
55
import { toErrorObject as toLintErrorObject } from "@openclaw/normalization-core/error-coercion";
6-
import { beforeAll, describe, expect, it } from "vitest";
6+
import { assert, beforeAll, describe, expect, it } from "vitest";
77
import { expectNoReaddirSyncDuring } from "../test-utils/fs-scan-assertions.js";
88
import { listGitTrackedFiles, toRepoRelativePath } from "../test-utils/repo-files.js";
99
import { collectBundledChannelConfigsCore } from "./bundled-channel-config-metadata.js";
@@ -565,13 +565,21 @@ describe("bundled plugin metadata", () => {
565565

566566
it("keeps empty-config Gateway startup narrower than declared startup sidecars", () => {
567567
const manifestRegistry = createRepoBundledManifestRegistry();
568+
const linuxOnlyPlugin = manifestRegistry.plugins[0];
569+
assert(linuxOnlyPlugin, "expected bundled plugin manifest fixture");
570+
manifestRegistry.plugins.push({
571+
...linuxOnlyPlugin,
572+
id: "zz-linux-only-default-test",
573+
enabledByDefault: undefined,
574+
enabledByDefaultOnPlatforms: ["linux"],
575+
activation: { ...linuxOnlyPlugin.activation, onStartup: true },
576+
});
568577
const index = createInstalledPluginIndexForManifests(manifestRegistry);
569578
const expectedPluginIds = [
570579
...manifestRegistry.plugins
571580
.filter(
572581
(plugin) =>
573-
isPluginEnabledByDefaultForPlatform(plugin, "linux") &&
574-
plugin.activation?.onStartup === true,
582+
isPluginEnabledByDefaultForPlatform(plugin, "linux") && plugin.activation?.onStartup,
575583
)
576584
.map((plugin) => plugin.id),
577585
...EXPECTED_EMPTY_CONFIG_GATEWAY_STARTUP_EXTRAS,
@@ -588,33 +596,6 @@ describe("bundled plugin metadata", () => {
588596
).toEqual(expectedPluginIds);
589597
});
590598

591-
it("includes Linux-only default plugins in empty-config Gateway startup", () => {
592-
const manifestRegistry = createRepoBundledManifestRegistry();
593-
const seed = manifestRegistry.plugins[0];
594-
if (!seed) {
595-
throw new Error("expected bundled plugin manifest fixture");
596-
}
597-
manifestRegistry.plugins.push({
598-
...seed,
599-
id: "linux-only-default-test",
600-
name: "Linux-only default test",
601-
enabledByDefault: undefined,
602-
enabledByDefaultOnPlatforms: ["linux"],
603-
activation: { ...seed.activation, onStartup: true },
604-
});
605-
const index = createInstalledPluginIndexForManifests(manifestRegistry);
606-
607-
expect(
608-
resolveGatewayStartupPluginIdsFromRegistry({
609-
config: {},
610-
env: {},
611-
index,
612-
manifestRegistry,
613-
platform: "linux",
614-
}),
615-
).toContain("linux-only-default-test");
616-
});
617-
618599
it("auto-starts Bonjour for empty-config macOS Gateway startup", () => {
619600
const manifestRegistry = createRepoBundledManifestRegistry();
620601
const index = createInstalledPluginIndexForManifests(manifestRegistry);

0 commit comments

Comments
 (0)