File size: 13,914 Bytes
d197cf3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | // Windows CI scope tests cover paths with platform-specific runtime contracts.
import { describe, expect, it } from "vitest";
const { detectChangedScope } = await import("../../scripts/ci-changed-scope.mjs");
describe("detectChangedScope Windows routing", () => {
it("routes completion profile installation and its native proof to Windows", () => {
for (const profilePath of [
"src/cli/completion-runtime.ts",
"src/cli/completion-runtime.windows.test.ts",
]) {
expect(detectChangedScope([profilePath]), profilePath).toMatchObject({
runNode: true,
runWindows: true,
});
}
expect(detectChangedScope(["src/cli/completion-runtime-extra.ts"]).runWindows).toBe(false);
});
it("routes the Canvas pnpm runner and its native regression to Windows", () => {
for (const runnerPath of [
"extensions/canvas/scripts/pnpm-runner.mjs",
"extensions/canvas/scripts/pnpm-runner.test.ts",
]) {
expect(detectChangedScope([runnerPath]), runnerPath).toMatchObject({
runNode: true,
runWindows: true,
});
}
expect(detectChangedScope(["extensions/canvas/src/a2ui-jsonl.ts"]).runWindows).toBe(false);
});
it("routes source CLI invocation owners and their native proof to Windows", () => {
for (const sourceCliPath of [
"src/infra/openclaw-cli-invocation.ts",
"src/infra/openclaw-cli-invocation.test.ts",
"src/infra/openclaw-cli-invocation.test-support.ts",
"src/infra/openclaw-cli-shim.ts",
"src/infra/openclaw-cli-shim.test.ts",
"src/infra/openclaw-cli-shim.windows.test.ts",
]) {
expect(detectChangedScope([sourceCliPath]), sourceCliPath).toMatchObject({
runNode: true,
runWindows: true,
runMacos: false,
runAndroid: false,
});
}
for (const unrelatedPath of [
"src/infra/openclaw-root.ts",
"src/infra/openclaw-cli-other.test.ts",
"src/infra/openclaw-cli-shim-extra.ts",
]) {
expect(detectChangedScope([unrelatedPath]).runWindows, unrelatedPath).toBe(false);
}
});
for (const { name, paths } of [
{
name: "routes worker bundle producers, archives, installers, and regression coverage to Windows",
paths: [
"src/shared/worker-bundle-archive.ts",
"src/shared/worker-bundle-archive.test.ts",
"src/shared/worker-bundle-hash.ts",
"src/gateway/worker-environments/bundle.ts",
"src/gateway/worker-environments/bundle.test.ts",
"src/gateway/worker-environments/bundle-staging.ts",
"src/node-host/node-worker-bundle-installer.ts",
"src/node-host/node-worker-bundle-installer.test.ts",
],
},
{
name: "routes paired-worker workspace transfer owners and native regression coverage to Windows",
paths: [
"src/infra/git-exec.ts",
"src/infra/git-exec.test.ts",
"src/agents/worktrees/git.ts",
"src/agents/worktrees/git.test.ts",
"src/agents/worktrees/base-ref.ts",
"src/gateway/worker-environments/workspace-result-git.ts",
"src/gateway/worker-environments/workspace-result-git.test.ts",
"src/gateway/worker-environments/workspace-result-staging.ts",
"src/gateway/worker-environments/workspace-result-ref-mutation.test.ts",
"src/gateway/worker-environments/session-repository-checkpoints.ts",
"src/gateway/worker-environments/session-repository-checkpoints.test.ts",
"src/node-host/node-worker-transfer-client.ts",
"src/node-host/node-worker-transfer-client.test.ts",
"src/gateway/worker-environments/node-worker-tunnel.ts",
"src/gateway/worker-environments/node-worker-tunnel.test.ts",
"src/gateway/worker-environments/workspace-sync-scripts.ts",
"src/gateway/worker-environments/workspace-sync-manifest.test.ts",
],
},
{
name: "routes SQLite transcript archive changes to Windows",
paths: [
"src/config/sessions/session-accessor.sqlite-archive.ts",
"src/config/sessions/session-accessor.sqlite-archive.worker.test.ts",
"src/config/sessions/session-accessor.sqlite-archive.worker.ts",
],
},
{
// Native process identity proof must also run when its consumers change.
name: "routes process-start identity and every consumer of it to Windows",
paths: [
"src/shared/pid-alive.ts",
"src/gateway/gateway-cron-process-identity.windows.test.ts",
"src/infra/windows-process-start.ts",
"src/infra/gateway-lock.ts",
"src/node-host/node-worker-process-identity.ts",
"src/cron/store/run-receipt-store.ts",
],
},
{
name: "routes core SQLite state changes to Windows",
paths: [
"src/commands/doctor-sqlite-compact.ts",
"src/infra/node-sqlite.ts",
"src/infra/update-managed-service-handoff.ts",
"src/state/openclaw-state-db.ts",
],
},
{
name: "routes Windows SQLite path tests to Windows",
paths: [
"src/infra/update-managed-service-handoff-command.test.ts",
"src/infra/update-managed-service-handoff-lifecycle.test.ts",
"src/state/openclaw-database-paths.windows.test.ts",
],
},
{
name: "routes the OpenSSH resolver and its native proof to Windows",
paths: ["src/infra/ssh-client.ts", "src/infra/ssh-client.windows.test.ts"],
},
{
name: "routes port diagnostics and their native proof to Windows",
paths: ["src/infra/ports-inspect.ts", "src/infra/ports.test.ts"],
},
{
name: "routes LAN advertisement and its native PowerShell proof to Windows",
paths: [
"src/infra/advertised-lan-host.ts",
"src/infra/advertised-lan-host.test.ts",
"src/infra/advertised-lan-host.windows.test.ts",
],
},
{
name: "routes MXC runtime changes and Windows-only suites to Windows",
paths: [
"extensions/mxc/src/mxc-backend.ts",
"extensions/mxc/test/mxc-backend.test.ts",
"extensions/mxc/test/sandbox-policy-loader.test.ts",
],
},
{
name: "routes exec script preflight changes and Windows-only coverage to Windows",
paths: [
"src/agents/bash-tools.exec-script-preflight.ts",
"src/agents/bash-tools.exec-script-target.ts",
"src/agents/bash-tools.exec.script-preflight.test.ts",
],
},
{
name: "routes exec allowlist matcher changes and Windows-only coverage to Windows",
paths: ["src/infra/exec-allowlist-pattern.ts", "src/infra/exec-allowlist-pattern.test.ts"],
},
{
name: "routes safe removal changes and Windows-only coverage to Windows",
paths: ["src/infra/fs-safe-remove.ts", "src/infra/fs-safe-remove.test.ts"],
},
{
name: "routes web and Teams file URL handling to Windows",
paths: [
"src/agents/tools/media-tool-file-url.windows.test.ts",
"src/agents/tools/media-tool-shared.test.ts",
"src/agents/tools/media-tool-shared.ts",
"src/agents/tools/pdf-tool.test.ts",
"src/agents/tools/pdf-tool.ts",
"src/media/local-media-path.ts",
"src/media/local-media-path.windows.test.ts",
"src/media/local-roots.ts",
"src/media/local-roots.test.ts",
"src/media/web-media.ts",
"src/media/web-media.file-url.windows.test.ts",
"src/channels/inbound-event/media.ts",
"src/channels/inbound-event/media.test.ts",
"src/gateway/managed-image-attachments.ts",
"src/gateway/managed-image-attachments.test.ts",
"extensions/msteams/src/media-helpers.ts",
"extensions/msteams/src/media-helpers.test.ts",
"extensions/msteams/src/messenger.test.ts",
],
},
{
name: "routes sandbox media staging file URL handling to Windows",
paths: [
"src/auto-reply/reply/stage-sandbox-media.ts",
"src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts",
],
},
{
name: "routes usage footer template changes and native coverage to Windows",
paths: [
"src/auto-reply/usage-bar/template.ts",
"src/auto-reply/usage-bar/template.windows.test.ts",
],
},
{
name: "routes media-understanding file URL changes and native coverage to Windows",
paths: [
"src/media-understanding/attachments.cache.ts",
"src/media-understanding/attachments.cache.test.ts",
"src/media-understanding/attachments.normalize.ts",
"src/media-understanding/attachments.normalize.test.ts",
"src/media-understanding/attachments.file-url.windows.test.ts",
],
},
{
name: "routes shared home display owners and visible command coverage to Windows",
paths: [
"src/utils.ts",
"src/utils.test.ts",
"src/infra/home-display.ts",
"src/infra/path-guards.ts",
"src/commands/agents.commands.list.ts",
"src/commands/agents.commands.list.test.ts",
"src/cli/daemon-cli/status.print.ts",
"src/cli/daemon-cli/status.print.test.ts",
"packages/terminal-core/src/display-string.ts",
"packages/terminal-core/src/display-string.test.ts",
"src/agents/sandbox/fs-paths.ts",
"src/agents/sandbox/fs-paths.test.ts",
"src/agents/sessions/tools/render-utils.ts",
"src/agents/sessions/tools/render-utils.test.ts",
],
},
{
name: "routes OS-home path owners and native tool coverage to Windows",
paths: [
"src/infra/home-dir.ts",
"src/infra/home-dir.test.ts",
"src/agents/agent-tools.read.ts",
"src/agents/agent-tools.read.host-operations.test.ts",
"src/agents/agent-tools.read.windows.test.ts",
"src/agents/sessions/tools/path-utils.ts",
"src/agents/sessions/tools/path-utils.test.ts",
],
},
{
name: "routes child environment resolution and native doctor coverage to Windows",
paths: [
"src/agents/provider-local-service.ts",
"src/agents/provider-local-service.env-case.test.ts",
"src/cli/mcp-cli.ts",
"src/cli/mcp-cli.test.ts",
"src/cli/mcp-cli.path-case.windows.test.ts",
"src/infra/process-env.ts",
"src/infra/process-env.test.ts",
],
},
{
name: "routes node-host executable resolution and native coverage to Windows",
paths: [
"src/plugin-sdk/node-host.ts",
"src/plugin-sdk/node-host.test.ts",
"src/node-host/invoke-agent-cli-claude.test.ts",
"src/process/supervisor/supervisor.anchored-shell.real.test.ts",
"src/process/terminal-pty.test.ts",
"src/tui/tui.ts",
"src/tui/tui.resolve-codex-bin.test.ts",
],
},
{
name: "routes explicit memory extra-file owners and native coverage to Windows",
paths: [
"packages/memory-host-sdk/src/host/explicit-extra-markdown.ts",
"packages/memory-host-sdk/src/host/internal.ts",
"packages/memory-host-sdk/src/host/internal.test.ts",
"packages/memory-host-sdk/src/host/read-file.ts",
"extensions/memory-core/src/cli-runtime-common.ts",
"extensions/memory-core/src/memory-extra-file-path.windows.test.ts",
],
},
{
name: "routes workspace quiescence owners and native coverage to Windows",
paths: [
"src/gateway/worker-environments/workspace-quiescence.ts",
"src/gateway/worker-environments/workspace-quiescence-scripts.ts",
"src/gateway/worker-environments/workspace-quiescence.test.ts",
"src/gateway/worker-environments/workspace-quiescence.windows.test.ts",
],
},
{
name: "routes SecretRef path-security changes and focused owner coverage to Windows",
paths: [
"src/commands/doctor-gateway-auth-token.ts",
"src/commands/doctor-gateway-auth-token.windows.test.ts",
"src/flows/doctor-core-checks.ts",
"src/flows/doctor-health-contributions.ts",
"src/gateway/auth-token-resolution.ts",
"src/gateway/resolve-configured-secret-input-string.ts",
"src/infra/fs-safe.ts",
"src/infra/fs-safe-defaults.ts",
"src/infra/permissions.ts",
"src/secrets/resolve-errors.ts",
"src/secrets/resolve.ts",
"src/security/audit-fs.ts",
],
},
]) {
it(name, () => {
for (const changedPath of paths) {
expect(detectChangedScope([changedPath]), changedPath).toMatchObject({
runNode: true,
runWindows: true,
});
}
});
}
it("routes shared test-state and process fixture owners to Windows", () => {
for (const fixturePath of [
"src/test-utils/openclaw-test-state.ts",
"src/test-utils/openclaw-test-state.test.ts",
"test/helpers/openclaw-test-instance.ts",
"test/helpers/openclaw-test-instance.test.ts",
"test/helpers/openclaw-test-instance.cli.test-support.mjs",
"scripts/lib/managed-child-process.mts",
"scripts/lib/vitest-resource-ownership.mts",
]) {
expect(detectChangedScope([fixturePath]), fixturePath).toMatchObject({
runNode: true,
runWindows: true,
});
}
expect(detectChangedScope(["test/helpers/promise.ts"]).runWindows).toBe(false);
expect(
detectChangedScope(["test/helpers/openclaw-test-instance-extra.test.ts"]).runWindows,
).toBe(false);
});
it("does not route SecretRef tests owned by non-Windows lanes", () => {
for (const testPath of [
"src/gateway/resolve-configured-secret-input-string.test.ts",
"src/secrets/resolve.test.ts",
"test/e2e/qa-lab/runtime/doctor-auth-secretref-checks.e2e.test.ts",
]) {
expect(detectChangedScope([testPath]).runWindows, testPath).toBe(false);
}
});
});
|