Skip to content

Commit bf0fa8a

Browse files
authored
feat: add optional Parallels testing for Windows app (#992)
* improve: automate Parallels Windows baselines * refactor: layer Windows app Parallels setup * docs: make Parallels an optional proof backend
1 parent 47e4e64 commit bf0fa8a

4 files changed

Lines changed: 400 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Parallels Windows proof backend
2+
3+
Use this optional backend only from macOS when Parallels Desktop is installed and activated and a
4+
Windows 11 VM has already been downloaded. Run commands from the `openclaw-windows-node` repo root.
5+
6+
The sibling OpenClaw repo owns the general Windows VM lifecycle. Read
7+
`../../../../openclaw/.agents/skills/openclaw-parallels-smoke/SKILL.md` for `prlctl` transport,
8+
WSL/Git/Node provisioning, clean/E2E snapshots, OpenClaw smoke, and general troubleshooting. Keep
9+
the `openclaw` and `openclaw-windows-node` checkouts beside each other, or set `OPENCLAW_REPO`.
10+
11+
## Prepare the app layer
12+
13+
```bash
14+
./scripts/parallels-windows-vm.sh inventory
15+
./scripts/parallels-windows-vm.sh prepare
16+
./scripts/parallels-windows-vm.sh verify
17+
```
18+
19+
The wrapper restores the newest general `e2e` snapshot, then adds only the native app prerequisites:
20+
21+
1. .NET 10 SDK.
22+
2. Windows SDK 10.0.26100.
23+
3. WebView2 Runtime.
24+
4. A clean `openclaw-windows-node` checkout and `scripts/setup-dev.ps1 -CheckOnly`.
25+
5. A dated power-off `pre-openclaw-windows-app-e2e-*` snapshot.
26+
27+
When today's app snapshot exists, `prepare` restores and verifies it. This discards post-snapshot
28+
guest changes. Package installation reuses the OpenClaw controller's official WinGet manifest hash,
29+
Authenticode publisher, ACL-restricted staging, reboot handling, and bounded transport.
30+
31+
## Restore snapshots
32+
33+
- `clean`: newest raw Windows snapshot.
34+
- `e2e`: newest general OpenClaw Windows snapshot.
35+
- `app`: newest native Windows app snapshot.
36+
37+
```bash
38+
./scripts/parallels-windows-vm.sh restore --snapshot app
39+
./scripts/parallels-windows-vm.sh restore --snapshot "pre-openclaw-windows-app-e2e-<date>"
40+
```
41+
42+
Never restore while another developer or smoke lane owns the VM. Use an exact name or id for
43+
historical reproduction; aliases select the newest matching snapshot.
44+
45+
## Run required validation
46+
47+
```bash
48+
./scripts/parallels-windows-vm.sh run-tests
49+
./scripts/parallels-windows-vm.sh run-tests --ref <pushed-branch-or-full-sha>
50+
```
51+
52+
The default restores `app`. The controller copies the current
53+
`scripts/parallels-run-validation.ps1` into guest temp, launches it in the desktop session, polls
54+
with short host-bounded `prlctl exec` calls, stops the process tree at 90 minutes, and runs:
55+
56+
- `./build.ps1`
57+
- Shared tests
58+
- Tray tests
59+
60+
For an unpushed reviewed change, restore `app`, sync an isolated guest checkout, then use
61+
`run-tests --no-restore`. Never use `--no-restore` as clean-snapshot evidence.
62+
63+
Continue with the proof checklist in [SKILL.md](SKILL.md) when the change needs screenshots/video,
64+
`winnode` or raw MCP output, Gateway invocation, accessibility, permissions, Command Center,
65+
chat/canvas, or MXC evidence.
66+
67+
## Remote execution rules
68+
69+
- Use `--current-user` for checkout, app launch, tests, Git, and user state.
70+
- Use SYSTEM only for machine installers through the shared verified staging path.
71+
- Use explicit `.cmd` shims for `npm`, `pnpm`, and `openclaw` when resolution is ambiguous.
72+
73+
## Troubleshooting
74+
75+
- Missing .NET, Windows SDK, or WebView2: rerun `prepare`; do not add app prerequisites to the
76+
general `e2e` snapshot.
77+
- Missing `app` snapshot: run `prepare`; an older general E2E snapshot does not contain the native
78+
app layer.
79+
- Locked build output: stop the companion/WinUI process, restore `app`, and rerun all required
80+
suites.
81+
- Missing sibling controller/API: use an OpenClaw revision containing
82+
`scripts/e2e/parallels-windows-prepare.sh`.

‎.agents/skills/openclaw-proof-validation/SKILL.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ description: "Plan and collect OpenClaw Windows validation/proof: tests, rubber-
77

88
Use for changes that affect tray UX, Settings, onboarding, chat/canvas, Command Center, Windows node capabilities, local MCP, gateway connection/pairing, permissions, diagnostics, or agent-facing instructions.
99

10+
If the validation host is macOS, read [PARALLELS.md](PARALLELS.md) for the optional local Parallels Windows VM workflow.
11+
1012
## Rules
1113

1214
- Required automated/focused tests are mandatory. Do not ask to skip them.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
param(
2+
[Parameter(Mandatory = $true)]
3+
[string]$RepoRoot,
4+
[Parameter(Mandatory = $true)]
5+
[string]$LogPath,
6+
[Parameter(Mandatory = $true)]
7+
[string]$DonePath,
8+
[Parameter(Mandatory = $true)]
9+
[string]$PidPath
10+
)
11+
12+
$ErrorActionPreference = "Stop"
13+
$exitCode = 1
14+
15+
try {
16+
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $LogPath) | Out-Null
17+
Remove-Item -LiteralPath $LogPath, $DonePath, $PidPath -Force -ErrorAction SilentlyContinue
18+
Set-Content -LiteralPath $PidPath -Value $PID -Encoding ASCII
19+
Set-Location $RepoRoot
20+
$env:OPENCLAW_REPO_ROOT = $RepoRoot
21+
22+
& (Join-Path $RepoRoot "scripts\setup-dev.ps1") -RunValidation *> $LogPath
23+
$exitCode = $LASTEXITCODE
24+
if ($exitCode -ne 0) {
25+
throw "Required validation failed with exit code $exitCode."
26+
}
27+
} catch {
28+
$_ | Out-String | Add-Content -LiteralPath $LogPath -Encoding UTF8
29+
if ($exitCode -eq 0) {
30+
$exitCode = 1
31+
}
32+
} finally {
33+
Set-Content -LiteralPath $DonePath -Value $exitCode -Encoding ASCII
34+
}
35+
36+
exit $exitCode

0 commit comments

Comments
 (0)