mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 11:55:47 -06:00
0e8faacd71
* fix(scripts): size the tsdown heap from the build's own cgroup budget The build heap probe only read the cgroup root (/sys/fs/cgroup/memory.max and the v1 equivalent). Those files exist only when the process runs in a namespaced container cgroup; under systemd the budget lives on the process's own slice, and the v2 root carries no limit at all. So every systemd-managed build found no limit, fell back to /proc/meminfo MemTotal, and took the full 12288 MB default heap regardless of its actual budget. Observed on a 15.4 GiB host: openclaw-main-update.service ran tsdown with NODE_OPTIONS=--max-old-space-size=12288 while its user@999.service slice was bounded at 5 GiB, reaching 3.2 GB RSS and 6.25 GB peak before the host began OOM-killing unrelated services. Resolve the limit from /proc/self/cgroup and walk that chain instead, reading memory.high alongside memory.max (memory.high throttles reclaim rather than failing allocation, so a heap above it stalls the build instead of OOM-ing), and take the tightest bound found. Root paths stay as the container fallback, and an explicitly injected path list still disables detection. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): resolve the build heap budget from the v1 memory controller too The slice walk only accepted the unified 0:: record, so a legacy or hybrid systemd host fell back to the root probe and kept taking host memory. One resolver now walks both hierarchies leaf-to-root, which makes the static root list its own depth-0 case and removes it. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): read cgroup controller mounts instead of assuming their paths v1 controllers can be co-mounted at the cgroup root, where memory.limit_in_bytes sits under the slice with no per-controller directory, so the hardcoded /sys/fs/cgroup/memory probe missed the budget and the build took the full 12288MB default. Mount points now come from mountinfo. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): translate cgroup records through the mount root mountinfo field 4 is the subtree a cgroupfs mount exposes. Under a container mount the /proc/self/cgroup record stays host-absolute, so walking it verbatim probed paths below the visible mount and the build fell back to host memory. Records now translate through the mount root before the walk. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): skip cgroup mounts that cannot represent this process Falling back to the mount root for a record outside the mount's subtree sized the build from an unrelated cgroup: an inherited namespace clamped the heap to the 2048MB floor from a foreign 1GiB limit. Non-representable mounts are now skipped, and the blind root probe only runs when no memory record exists. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): keep every cgroup mount view, not just the last one seen One hierarchy can be visible through several mounts and only some expose a subtree containing this process. Retaining only the last view dropped the budget whenever a non-representable bind view came later, sending the build back to host MemTotal. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): decode octal-escaped mountinfo paths before matching cgroups ClawSweeper P2 on7e64ad61f7: the cgroup resolver compared mountinfo's mount root and mount point verbatim. The kernel escapes space, tab, newline, and backslash in those two fields, so any cgroup mounted under such a path never matched, the bounded slice was missed, and heap sizing silently fell back to host memory. Decode both fields before matching. The decoder lives in scripts/lib beside the other shared script helpers rather than inline, so the scripts program has one copy rather than a new ad hoc one. Regression test fails pre-fix: a v2 mount at "/sys/fs/cgroup\040dir" with a 5 GiB memory.high yields --max-old-space-size=12288 (host fallback) before the fix and 4352 after. Follow-up, deliberately not bundled here: src/infra/sqlite-wal.ts, src/commands/doctor-state-integrity.ts, and src/plugins/bundled-source-overlays.ts each carry their own private copy of this same decoder. Consolidating all four into @openclaw/normalization-core is the right end state, but it touches a shared package plus three core modules and belongs in its own reviewable change. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): resolve cgroup-namespace-relative records to their mount ClawSweeper P1 ond6fe49dd3f: inside a cgroup namespace /proc/self/cgroup reports the namespace root ("0::/") while mountinfo field 4 stays the host subtree the cgroupfs was mounted from ("/docker/<id>"). relativeCgroupPath then found no prefix match and returned null; because a memory record had already been seen, the root probe was skipped and the build fell back to host MemTotal. A constrained container therefore missed its own budget entirely. That namespace root is exactly what the mount exposes at its mount point, so it resolves to "/" rather than failing closed. Regression test fails pre-fix: a "0::/" record against a /docker/2f1a9c mount root with a 5 GiB memory.max yields --max-old-space-size=12288 before the fix and 4352 after. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): reject inherited cgroup mount views instead of guessing ClawSweeper P1 onb4d200c5d2: the previous commit resolved a namespace-relative record against any mount root, including the inherited views cgroup_namespaces(7) documents, whose field-4 root reads "/..". Which cgroup such a view exposes is not derivable from mountinfo, so probing it can size the build from an unrelated cgroup's limit. Reject non-canonical mount roots outright. An undecidable view now falls back to host sizing, which is current main's behavior, rather than silently adopting the wrong budget. Regression test covers the "/.." inherited mount: it must yield host MemTotal sizing, not the 5 GiB limit sitting behind that mount. Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(scripts): fail closed on namespace-root records against non-root mounts ClawSweeper P1 on731d3bbc8e: a "0::/" record does not prove that a mount rooted at some other subtree exposes this process's cgroup. Resolving that pair could cap the build heap from an unrelated cgroup's limit. Return no mapping for it. An undecidable pair now falls back to host sizing, which is current main's behavior, so the failure mode is a missed optimisation rather than a wrong budget. The "/.." inherited-mount rejection stays; this covers the broader ambiguous mapping it did not. The namespace-relative test is repointed accordingly: an unrelated mounted subtree must yield host sizing, not that subtree's limit. Net production change: none (4 lines swapped). Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> * fix(build): cap tsdown heap to the real budget and refuse hosts that cannot build The 2048MB floor was applied on top of a discovered cgroup limit, so a small container was handed a heap larger than it could honour. Measured in real cgroups, that does not OOM-kill, it thrashes: a 1500MiB container sat pinned at its ceiling for 10 minutes with oom_kill at 0, never finished the second of eleven invocations, and starved every other process on the host. Cap to the discovered budget, then refuse up front when that budget cannot hold the build. The threshold is the whole-build peak, not a single pass: a full eleven-invocation build peaks at 4730MiB, so a 5GiB slice completes while 4GiB and 2816MiB slices are both killed partway through the third invocation. The refusal runs before any output is cleaned, so a host that cannot rebuild does not also lose the build it has. * fix(build): harden tsdown heap admission * fix(build): guard the default tsdown plan * fix(build): preserve runtime-only Docker builds * fix(build): admit only declaration cache misses * fix(build): scope heap admission to real budgets * fix(build): guard direct unified declarations * fix(build): guard the canonical tsdown config * fix(build): satisfy cache planning lint * fix(gateway): release empty orphan leases * fix(build): cap cgroup budget by host memory * fix(build): serialize the canonical tsdown config * test(build): freeze host memory fixtures * fix(build): honor cgroup v1 soft limits * fix(build): respect cgroup v1 hierarchy mode * fix(build): admit unified runtime plans * fix(build): admit every unified runtime path * fix(build): collect repeated tsdown filters * fix(build): ignore cgroup v1 soft limits * fix(build): use explicit heap override as opt-in * refactor(build): simplify memory admission * fix(build): harden constrained build recovery * fix(ci): prebuild runtime before real CLI shards * fix(build): honor runtime-only runner environment * fix(ci): satisfy tooling shard lint
431 lines
16 KiB
TypeScript
431 lines
16 KiB
TypeScript
// Package script tests validate root package script invariants.
|
|
import fs from "node:fs";
|
|
import { expectDefined } from "@openclaw/normalization-core";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
type RootPackageJson = {
|
|
scripts: Record<string, string>;
|
|
};
|
|
|
|
const ENV_ASSIGNMENT_RE = /^[A-Za-z_][A-Za-z0-9_]*=/u;
|
|
const NODE_OPTIONS_WITH_VALUE = new Set([
|
|
"--conditions",
|
|
"--env-file",
|
|
"--env-file-if-exists",
|
|
"--import",
|
|
"--loader",
|
|
"--max-old-space-size",
|
|
"--require",
|
|
"--test-name-pattern",
|
|
"--test-reporter",
|
|
"-C",
|
|
"-r",
|
|
]);
|
|
|
|
function readPackageJson(): RootPackageJson {
|
|
return JSON.parse(fs.readFileSync("package.json", "utf8")) as RootPackageJson;
|
|
}
|
|
|
|
function readWindowsCiPartScripts(): [string, string] {
|
|
const scripts = readPackageJson().scripts;
|
|
return [
|
|
expectDefined(scripts["test:windows:ci:1"], "Windows CI part 1 script"),
|
|
expectDefined(scripts["test:windows:ci:2"], "Windows CI part 2 script"),
|
|
];
|
|
}
|
|
|
|
function readWindowsCiCoverageScript(): string {
|
|
return readWindowsCiPartScripts().join(" ");
|
|
}
|
|
|
|
function readWindowsCiTargets(script: string): string[] {
|
|
const tokens = tokenizeCommand(script);
|
|
const runnerIndex = tokens.indexOf("scripts/test-projects.mts");
|
|
return runnerIndex < 0 ? [] : tokens.slice(runnerIndex + 1);
|
|
}
|
|
|
|
function tokenizeCommand(command: string): string[] {
|
|
return (
|
|
command
|
|
.match(/"[^"]*"|'[^']*'|[^\s]+/gu)
|
|
?.map((token) => token.replace(/^(['"])(.*)\1$/u, "$2")) ?? []
|
|
);
|
|
}
|
|
|
|
function extractNodeScriptTargets(script: string): string[] {
|
|
return script.split(/\s*(?:&&|\|\||;)\s*/u).flatMap((command) => {
|
|
const tokens = tokenizeCommand(command);
|
|
let index = tokens[0] === "env" ? 1 : 0;
|
|
|
|
while (ENV_ASSIGNMENT_RE.test(tokens[index] ?? "")) {
|
|
index += 1;
|
|
}
|
|
|
|
if (tokens[index] !== "node") {
|
|
return [];
|
|
}
|
|
|
|
for (let tokenIndex = index + 1; tokenIndex < tokens.length; tokenIndex += 1) {
|
|
const token = tokens[tokenIndex];
|
|
if (!token) {
|
|
continue;
|
|
}
|
|
if (token.startsWith("scripts/")) {
|
|
return [token];
|
|
}
|
|
if (token === "--") {
|
|
continue;
|
|
}
|
|
if (token.startsWith("--") && token.includes("=")) {
|
|
continue;
|
|
}
|
|
if (NODE_OPTIONS_WITH_VALUE.has(token)) {
|
|
tokenIndex += 1;
|
|
continue;
|
|
}
|
|
if (token.startsWith("-")) {
|
|
continue;
|
|
}
|
|
|
|
return [];
|
|
}
|
|
|
|
return [];
|
|
});
|
|
}
|
|
|
|
describe("package scripts", () => {
|
|
it("finds node script targets after env assignments and valued node options", () => {
|
|
expect(
|
|
extractNodeScriptTargets(
|
|
"FOO=1 node --import tsx scripts/release-check.ts && node --max-old-space-size=8192 --import tsx scripts/plugin-sdk-surface-report.mts && env BAR=1 node -r tsx scripts/check.ts",
|
|
),
|
|
).toEqual([
|
|
"scripts/release-check.ts",
|
|
"scripts/plugin-sdk-surface-report.mts",
|
|
"scripts/check.ts",
|
|
]);
|
|
});
|
|
|
|
it("keeps direct node script targets present in the source checkout", () => {
|
|
const packageJson = readPackageJson();
|
|
const missingTargets = Object.entries(packageJson.scripts).flatMap(([name, script]) =>
|
|
extractNodeScriptTargets(script)
|
|
.filter((target) => !fs.existsSync(target))
|
|
.map((target) => `${name}: ${target}`),
|
|
);
|
|
|
|
expect(missingTargets).toEqual([]);
|
|
});
|
|
|
|
it("keeps direct Node package scripts off POSIX-only env assignment prefixes", () => {
|
|
const packageJson = readPackageJson();
|
|
const directNodeEnvScripts = Object.entries(packageJson.scripts).flatMap(([name, script]) =>
|
|
script
|
|
.split(/\s*(?:&&|\|\||;)\s*/u)
|
|
.filter((command) => {
|
|
const tokens = tokenizeCommand(command);
|
|
let index = tokens[0] === "env" ? 1 : 0;
|
|
const hasEnvPrefix = ENV_ASSIGNMENT_RE.test(tokens[index] ?? "");
|
|
while (ENV_ASSIGNMENT_RE.test(tokens[index] ?? "")) {
|
|
index += 1;
|
|
}
|
|
return hasEnvPrefix && tokens[index] === "node";
|
|
})
|
|
.map((command) => `${name}: ${command}`),
|
|
);
|
|
|
|
expect(directNodeEnvScripts).toEqual([]);
|
|
});
|
|
|
|
it.each([
|
|
{ scriptName: "build:docker", expectedCount: 2 },
|
|
{ scriptName: "build:plugin-sdk:strict-smoke", expectedCount: 1 },
|
|
{ scriptName: "build:strict-smoke", expectedCount: 1 },
|
|
])("runs TypeScript steps in $scriptName through tsx", ({ scriptName, expectedCount }) => {
|
|
const script = expectDefined(
|
|
readPackageJson().scripts[scriptName],
|
|
`package script ${scriptName}`,
|
|
);
|
|
|
|
expect(script).not.toContain("--experimental-strip-types");
|
|
expect(script.match(/node --import tsx scripts\/[^\s]+\.ts/gu)).toHaveLength(expectedCount);
|
|
});
|
|
|
|
it("enables live cache validation in the package script", () => {
|
|
expect(readPackageJson().scripts["test:live:cache"]).toBe(
|
|
"node --import tsx scripts/run-with-env.mts OPENCLAW_LIVE_TEST=1 OPENCLAW_LIVE_CACHE_TEST=1 -- node --import tsx scripts/check-live-cache.ts",
|
|
);
|
|
});
|
|
|
|
it("runs browser extension bootstrap E2E against real Chromium", () => {
|
|
expect(readPackageJson().scripts["test:e2e:browser-extension"]).toBe(
|
|
"node --import tsx scripts/run-with-env.mts PLAYWRIGHT_BROWSERS_PATH=.artifacts/playwright-browsers -- node --import tsx scripts/ensure-playwright-chromium.mts --require-playwright-chromium && node --import tsx scripts/run-with-env.mts PLAYWRIGHT_BROWSERS_PATH=.artifacts/playwright-browsers OPENCLAW_BROWSER_EXTENSION_E2E=1 OPENCLAW_E2E_WORKERS=1 -- node scripts/run-vitest.mjs extensions/browser/chrome-extension/bootstrap.chromium.test.ts",
|
|
);
|
|
});
|
|
|
|
it("gives the plugin SDK usage scan enough heap for repository-wide analysis", () => {
|
|
expect(readPackageJson().scripts["plugin-sdk:usage"]).toBe(
|
|
"node --max-old-space-size=8192 --import tsx scripts/analyze-plugin-sdk-usage.ts",
|
|
);
|
|
});
|
|
|
|
it("runs dead-code reports fail-fast", () => {
|
|
expect(readPackageJson().scripts["deadcode:report"]).toBe(
|
|
"pnpm deadcode:full && pnpm deadcode:exports",
|
|
);
|
|
});
|
|
|
|
it("runs runtime postbuild before plugin SDK strict export checks", () => {
|
|
expect(readPackageJson().scripts["build:plugin-sdk:strict-smoke"]).toBe(
|
|
"node --import tsx scripts/tsdown-build.mts && node scripts/runtime-postbuild.mjs && node --import tsx scripts/run-with-env.mts OPENCLAW_PLUGIN_SDK_CANONICAL_DTS=1 -- node --import tsx scripts/write-plugin-sdk-entry-dts.ts && node --import tsx scripts/check-plugin-sdk-exports.mts",
|
|
);
|
|
});
|
|
|
|
it("cleans package builds before validating release contents", () => {
|
|
const scripts = readPackageJson().scripts;
|
|
|
|
expect(scripts["build:package"]).toBe("node --import tsx scripts/build-all.mts package");
|
|
expect(scripts["release:check"]).toBe(
|
|
"pnpm build:package && pnpm release:generated:check && node --import tsx scripts/release-check.ts",
|
|
);
|
|
});
|
|
|
|
it("uses the shipped package launcher for npm start", () => {
|
|
expect(readPackageJson().scripts.start).toBe("node openclaw.mjs");
|
|
});
|
|
|
|
it("builds iOS against a generic simulator by default", () => {
|
|
const script = readPackageJson().scripts["ios:build"];
|
|
|
|
expect(script).toContain("${IOS_DEST:-generic/platform=iOS Simulator}");
|
|
expect(script).not.toContain("name=iPhone");
|
|
});
|
|
|
|
it("keeps the Wear app in the root Android contributor gates", () => {
|
|
const scripts = readPackageJson().scripts;
|
|
|
|
expect(scripts["android:assemble"]).toContain(":wear:assembleDebug");
|
|
expect(scripts["android:format"]).toContain(":wear:ktlintFormat");
|
|
expect(scripts["android:lint"]).toContain(":wear:ktlintCheck");
|
|
expect(scripts["android:lint:android"]).toContain(":wear:lintDebug");
|
|
expect(scripts["android:test"]).toContain(":wear:testDebugUnitTest");
|
|
});
|
|
|
|
it("partitions Windows CI coverage into two disjoint explicit test lists", () => {
|
|
const scripts = readPackageJson().scripts;
|
|
const partScripts = readWindowsCiPartScripts();
|
|
const partTargets = partScripts.map(readWindowsCiTargets);
|
|
|
|
// Blacksmith's Windows class admits exactly 2 concurrent jobs, so the split
|
|
// width is pinned here: a 3rd part queues and a single lane serializes.
|
|
expect(scripts["test:windows:ci"]).toBe("pnpm test:windows:ci:1 && pnpm test:windows:ci:2");
|
|
expect(scripts["test:windows:ci:3"]).toBeUndefined();
|
|
for (const [partIndex, targets] of partTargets.entries()) {
|
|
const laterTargets = new Set(partTargets.slice(partIndex + 1).flat());
|
|
expect(
|
|
targets.filter((target) => laterTargets.has(target)),
|
|
`Windows CI part ${partIndex + 1} overlaps a later part`,
|
|
).toEqual([]);
|
|
}
|
|
});
|
|
|
|
it("runs node workspace transfer coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/node-host/node-worker-transfer-client.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs generated module formatting coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("test/scripts/format-generated-module.test.ts");
|
|
});
|
|
|
|
it("runs direct-run entrypoint coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("test/scripts/direct-run-entrypoints.test.ts");
|
|
});
|
|
|
|
it("runs Docker package process-tree coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"test/e2e/qa-lab/runtime/package-openclaw-for-docker.e2e.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs the Doctor managed-service SecretRef renderer in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/commands/doctor-gateway-auth-token.windows.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs legacy session importer atomicity coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/infra/state-migrations.legacy-session-store.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs SQLite snapshot path coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/infra/sqlite-snapshot.test.ts");
|
|
});
|
|
|
|
it("runs shared-state ownership coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/state/openclaw-state-ownership.test.ts");
|
|
});
|
|
|
|
it("runs mixed-case local media file URL coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/media/local-media-path.windows.test.ts");
|
|
});
|
|
|
|
it("runs sandbox media staging file URL coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs the native OpenSSH resolver proof in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/infra/ssh-client.windows.test.ts");
|
|
});
|
|
|
|
it("runs native port diagnostics coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/infra/ports.test.ts");
|
|
});
|
|
|
|
it("runs native LAN advertisement coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/infra/advertised-lan-host.windows.test.ts",
|
|
);
|
|
});
|
|
|
|
it("keeps the native Scheduled Task lifecycle proof opt-in", () => {
|
|
const scripts = readPackageJson().scripts;
|
|
|
|
expect(readWindowsCiCoverageScript()).not.toContain("schtasks.integration.e2e.test.ts");
|
|
expect(scripts["test:windows:schtasks:integration"]).toContain(
|
|
"CI_WINDOWS_SCHTASKS_INTEGRATION=1",
|
|
);
|
|
expect(scripts["test:windows:schtasks:integration"]).toContain(
|
|
"src/daemon/schtasks.integration.e2e.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs shared test-state cleanup coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/test-utils/openclaw-test-state.test.ts");
|
|
});
|
|
|
|
it("runs snapshot repository verification coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/snapshot/local-repository.windows.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs backup verification coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/commands/backup-verify.test.ts");
|
|
});
|
|
|
|
it("runs SQLite transcript archive worker coverage in Windows CI", () => {
|
|
const windowsCi = readWindowsCiCoverageScript();
|
|
expect(windowsCi).toContain(
|
|
"src/config/sessions/session-accessor.sqlite-archive.worker.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs cross-OS installer behavior coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"test/scripts/openclaw-cross-os-installer.windows.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs env launcher coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("test/scripts/run-with-env.test.ts");
|
|
});
|
|
|
|
it("runs ts-topology entrypoint coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("test/scripts/ts-topology.test.ts");
|
|
});
|
|
|
|
it("runs Windows-only MXC backend coverage in Windows CI", () => {
|
|
const script = readWindowsCiCoverageScript();
|
|
|
|
expect(script).toContain("extensions/mxc/test/mxc-backend.test.ts");
|
|
expect(script).toContain("extensions/mxc/test/sandbox-policy-loader.test.ts");
|
|
});
|
|
|
|
it("runs Windows-only exec script preflight coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/agents/bash-tools.exec.script-preflight.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs Windows-only exec allowlist matching coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/infra/exec-allowlist-pattern.test.ts");
|
|
});
|
|
|
|
it("runs native executable resolution coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/infra/executable-path.test.ts");
|
|
});
|
|
|
|
it("runs node-host npm shim and PTY launcher coverage in Windows CI", () => {
|
|
const script = readWindowsCiCoverageScript();
|
|
|
|
expect(script).toContain("src/plugin-sdk/node-host.test.ts");
|
|
expect(script).toContain("src/process/terminal-pty.test.ts");
|
|
expect(script).toContain("src/tui/tui.resolve-codex-bin.test.ts");
|
|
});
|
|
|
|
it("runs Windows-only safe removal coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain("src/infra/fs-safe-remove.test.ts");
|
|
});
|
|
|
|
it("runs web and Teams file URL coverage in Windows CI", () => {
|
|
const script = readWindowsCiCoverageScript();
|
|
|
|
expect(script).toContain("src/agents/tools/media-tool-file-url.windows.test.ts");
|
|
expect(script).toContain("src/media/web-media.file-url.windows.test.ts");
|
|
expect(script).toContain("extensions/msteams/src/media-helpers.test.ts");
|
|
expect(script).toContain("extensions/msteams/src/messenger.test.ts");
|
|
});
|
|
|
|
it("runs native usage footer home-path coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/auto-reply/usage-bar/template.windows.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs native media-understanding file URL coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"src/media-understanding/attachments.file-url.windows.test.ts",
|
|
);
|
|
});
|
|
|
|
it("runs shared home display and visible command coverage in Windows CI", () => {
|
|
const script = readWindowsCiCoverageScript();
|
|
|
|
expect(script).toContain("src/utils.test.ts");
|
|
expect(script).toContain("src/commands/agents.commands.list.test.ts");
|
|
expect(script).toContain("src/cli/daemon-cli/status.print.test.ts");
|
|
expect(script).toContain("packages/terminal-core/src/display-string.test.ts");
|
|
expect(script).toContain("src/agents/sandbox/fs-paths.test.ts");
|
|
expect(script).toContain("src/agents/sessions/tools/render-utils.test.ts");
|
|
});
|
|
|
|
it("runs native OS-home path tool coverage in Windows CI", () => {
|
|
const script = readWindowsCiCoverageScript();
|
|
|
|
expect(script).toContain("src/agents/agent-tools.read.windows.test.ts");
|
|
expect(script).toContain("src/agents/agent-tools.read.host-operations.test.ts");
|
|
expect(script).toContain("src/agents/sessions/tools/path-utils.test.ts");
|
|
});
|
|
|
|
it("runs child environment and native doctor coverage in Windows CI", () => {
|
|
const script = readWindowsCiCoverageScript();
|
|
|
|
expect(script).toContain("src/agents/provider-local-service.env-case.test.ts");
|
|
expect(script).toContain("src/infra/process-env.test.ts");
|
|
expect(script).toContain("src/cli/mcp-cli.path-case.windows.test.ts");
|
|
});
|
|
|
|
it("runs explicit memory extra-file casing coverage in Windows CI", () => {
|
|
expect(readWindowsCiCoverageScript()).toContain(
|
|
"extensions/memory-core/src/memory-extra-file-path.windows.test.ts",
|
|
);
|
|
});
|
|
});
|