mirror of
https://github.com/agent0ai/a0-launcher.git
synced 2026-12-04 09:20:21 +00:00
Run WSL feature setup from a temporary RemoteSigned PowerShell file in a visible elevated window. Advance past approval only after launch, wait for the setup process itself, and retain bounded output and actionable timeout diagnostics. Preserve runtime failure messages and error codes through Docker Manager, remove checklist-based ETAs, and wrap multiline diagnostics inside the modal without displacing its footer. Cover script exit codes, output, approval failures, timeout cleanup, and renderer behavior. Validation: 252 tests passed with 3 Windows-only skips, syntax and diff checks passed, and local Electron UI checks covered runtime recovery and compact error layout. Native Windows UAC remains unverified.
32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
const assert = require('node:assert/strict');
|
|
const { test } = require('node:test');
|
|
|
|
const { toErrorResponse } = require('./errors');
|
|
|
|
test('runtime setup preserves the provisioner failure instead of replacing it with generic copy', () => {
|
|
for (const code of ['RUNTIME_PROVISION_FAILED', 'RUNTIME_START_FAILED']) {
|
|
const error = Object.assign(new Error('Windows WSL Setup did not complete.\nWSL_E_INSTALL_PROCESS_FAILED'), { code });
|
|
assert.deepEqual(toErrorResponse(error), { code, message: error.message });
|
|
}
|
|
});
|
|
|
|
test('Docker pull rate limit maps to actionable install guidance', () => {
|
|
const error = new Error('Docker Hub pull rate limit exceeded');
|
|
error.code = 'DOCKER_PULL_RATE_LIMIT';
|
|
|
|
assert.deepEqual(toErrorResponse(error), {
|
|
code: 'DOCKER_PULL_RATE_LIMIT',
|
|
message: 'Docker Hub pull limit reached. Sign in to Docker or try again later.'
|
|
});
|
|
});
|
|
|
|
test('workspace cleanup failure reports that the Instance was already deleted', () => {
|
|
const error = new Error('cleanup failed');
|
|
error.code = 'INSTANCE_DELETED_STORAGE_REMAINS';
|
|
|
|
assert.deepEqual(toErrorResponse(error), {
|
|
code: 'INSTANCE_DELETED_STORAGE_REMAINS',
|
|
message: 'Instance deleted, but its /a0/usr folder could not be removed.'
|
|
});
|
|
});
|