(command: string)
| 55 | const token = (): string => (os === "linux" ? "desktop-linux-e2e" : "desktop-macos-e2e"); |
| 56 | |
| 57 | const ssh = async (command: string): Promise<{ stdout: string; stderr: string; code: number }> => { |
| 58 | if (!guestIp) throw new Error("E2E_DESKTOP_VM_IP is not set"); |
| 59 | const wrapped = |
| 60 | os === "linux" ? `export XDG_RUNTIME_DIR=/run/user/$(id -u); ${command}` : command; |
| 61 | try { |
| 62 | const { stdout, stderr } = await execFileAsync( |
| 63 | process.env.E2E_SSHPASS_BIN ?? "/opt/homebrew/bin/sshpass", |
| 64 | ["-p", "admin", "ssh", ...SSH_OPTS, `admin@${guestIp}`, wrapped], |
| 65 | { maxBuffer: 64 * 1024 * 1024 }, |
| 66 | ); |
| 67 | return { stdout, stderr, code: 0 }; |
| 68 | } catch (error) { |
| 69 | const err = error as { stdout?: string; stderr?: string; code?: number }; |
| 70 | return { |
| 71 | stdout: err.stdout ?? "", |
| 72 | stderr: err.stderr ?? "", |
| 73 | code: typeof err.code === "number" ? err.code : 1, |
| 74 | }; |
| 75 | } |
| 76 | }; |
| 77 | |
| 78 | const fixturePath = (slug: string): string => |
| 79 | os === "linux" |
no outgoing calls
no test coverage detected