Skip to content

The agent that grows with you

fix(install-e2e): settle OLD source desktop before launch

ethernet0c1b34826f11
diff --git a/tests-js/scripts/desktop-smoke.test.ts b/tests-js/scripts/desktop-smoke.test.ts
index 98525c6765a..5ef73fda5df 100644
--- a/tests-js/scripts/desktop-smoke.test.ts
+++ b/tests-js/scripts/desktop-smoke.test.ts
@@ -320,7 +320,8 @@ test('driver strips caller secrets and records missing executables as failure wi
} finally { fs.rmSync(home, { recursive: true, force: true }) }
})
-test.runIf(process.platform !== 'win32')('NEW source smoke settles the clean runtime before Electron launch', async (): Promise<void> => {
+test.runIf(process.platform !== 'win32')('OLD and NEW source smokes settle the clean runtime before Electron launch', async (): Promise<void> => {
+ for (const phase of ['old', 'new'] as const) {
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), 'smoke-source-settle-'))
const root = path.join(workspace, 'source')
const home = path.join(workspace, 'home')
@@ -355,13 +356,14 @@ printf 'clean source runtime settled\\n'
try {
await expect(runInstalledDesktopSmoke({ exe, root, origin: 'source', home, 'user-data': userData,
- out, phase: 'new', 'expect-commit': 'a'.repeat(40) }, refuseLaunch)).rejects.toThrow('launch observed settled runtime')
+ out, phase, 'expect-commit': 'a'.repeat(40) }, refuseLaunch)).rejects.toThrow('launch observed settled runtime')
} finally {
if (prior === undefined) { delete process.env.PM_E2E_LEAK } else { process.env.PM_E2E_LEAK = prior }
}
- expect(fs.readFileSync(path.join(out, 'desktop-source-settle-new.log'), 'utf8')).toContain('clean source runtime settled')
+ expect(fs.readFileSync(path.join(out, `desktop-source-settle-${phase}.log`), 'utf8')).toContain('clean source runtime settled')
} finally { fs.rmSync(workspace, { recursive: true, force: true }) }
+ }
})
test('Windows source settle bypasses the current cmd launcher beside a stale historical exe', (): void => {
diff --git a/tests/install/e2e-assets/desktop-smoke.ts b/tests/install/e2e-assets/desktop-smoke.ts
index 40be014251c..11d353f6983 100644
--- a/tests/install/e2e-assets/desktop-smoke.ts
+++ b/tests/install/e2e-assets/desktop-smoke.ts
@@ -200,7 +200,7 @@ function captureBackendLogs(homes: readonly string[], outDir: string, phase: str
* runtime before Electron starts, using the exact environment it will inherit.
*/
export function settleSourceDesktopRuntime(options: SmokeOptions, launch: Launch): void {
- if (options.origin !== 'source' || options.phase !== 'new') { return }
+ if (options.origin !== 'source' || (options.phase !== 'old' && options.phase !== 'new')) { return }
const invocation = sourceRuntimeSettleCommand(options.root, launch.env)
const result = spawnSync(invocation.command, invocation.args, {