Skip to content

Commit d358294

Browse files
committed
test(plugins): anchor provider family inventory to source roots
1 parent 3480832 commit d358294

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/plugins/contracts/provider-family-plugin-tests.test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import fs from "node:fs";
2-
import { basename, dirname, resolve } from "node:path";
3-
import { fileURLToPath } from "node:url";
2+
import { basename, resolve } from "node:path";
43
import { beforeAll, describe, expect, it } from "vitest";
54
import { expectNoReaddirSyncDuring } from "../../test-utils/fs-scan-assertions.js";
65
import { listGitTrackedFiles, toRepoRelativePath } from "../../test-utils/repo-files.js";
@@ -19,8 +18,8 @@ type ExpectedSharedFamilyContract = {
1918
toolCompatFamilies?: readonly string[];
2019
};
2120

22-
const SRC_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
23-
const REPO_ROOT = resolve(SRC_ROOT, "..");
21+
const REPO_ROOT = resolve(process.cwd());
22+
const BUNDLED_SOURCE_EXTENSIONS_ROOT = resolve(REPO_ROOT, "extensions");
2423
const SHARED_FAMILY_HOOK_PATTERNS: ReadonlyArray<{
2524
kind: SharedFamilyHookKind;
2625
regex: RegExp;
@@ -111,7 +110,14 @@ function listBundledPluginRoots() {
111110
if (bundledPluginRootsCache) {
112111
return bundledPluginRootsCache;
113112
}
114-
bundledPluginRootsCache = loadPluginManifestRegistry({})
113+
bundledPluginRootsCache = loadPluginManifestRegistry({
114+
workspaceDir: REPO_ROOT,
115+
env: {
116+
...process.env,
117+
OPENCLAW_BUNDLED_PLUGINS_DIR: BUNDLED_SOURCE_EXTENSIONS_ROOT,
118+
OPENCLAW_TEST_TRUST_BUNDLED_PLUGINS_DIR: "1",
119+
},
120+
})
115121
.plugins.filter((plugin) => plugin.origin === "bundled")
116122
.map((plugin) => ({
117123
pluginId: plugin.id,

0 commit comments

Comments
 (0)