The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(e2e): route managed Desktop checks to staged Git main
ethernet2120e8728d4b
diff --git a/apps/desktop/electron/updater/checkout-legacy.test.ts b/apps/desktop/electron/updater/checkout-legacy.test.tsindex 90333232701..0a376f26931 100644--- a/apps/desktop/electron/updater/checkout-legacy.test.ts+++ b/apps/desktop/electron/updater/checkout-legacy.test.ts@@ -82,6 +82,7 @@ it.skipIf(process.platform === 'win32')('uses the install-scoped PM launcher ratfs.mkdirSync(path.join(root, 'pm'))fs.mkdirSync(home)fs.writeFileSync(launcher, '#!/bin/sh\n[ "$1" = --run-module ] && [ "$2" = hermes_cli.source_check ] || exit 5\nprintf \'%s\\n\' \'{"supported":true,"channel":"stable","behind":-1}\'\n', { mode: 0o755 })+try {const probe = { python: '/nonexistent/system-python', git: 'git', updateRoot: root, hermesHome: home, channel: 'stable' as const }await expect(readSourceUpdate(probe)).resolves.toMatchObject({ supported: true, channel: 'stable', behind: null })diff --git a/apps/desktop/electron/updater/checkout-source.ts b/apps/desktop/electron/updater/checkout-source.tsindex 1214941010b..746c6339aef 100644--- a/apps/desktop/electron/updater/checkout-source.ts+++ b/apps/desktop/electron/updater/checkout-source.ts@@ -49,9 +49,11 @@ export async function readSourceUpdate(probe: SourceUpdateProbe): Promise<Source// existing path until that transport is migrated.const managed = process.platform !== 'win32' && existsSync(path.join(probe.updateRoot, 'pm'))const launcher = managed ? resolveInstallationLauncher(probe.updateRoot, false, probe.hermesHome) : null+if (managed && !launcher) {throw new Error('The source installation launcher is missing; repair this installation before checking updates.')}+if (!managed && !probe.python) {throw new Error('No Python interpreter is available to check the source update channel.')}diff --git a/tests-js/update-ui.test.mjs b/tests-js/update-ui.test.mjsindex 893eea66f8f..88ad3637a90 100644--- a/tests-js/update-ui.test.mjs+++ b/tests-js/update-ui.test.mjs@@ -90,8 +90,14 @@ test('test-only source probe pins staged main without changing other Python invoexpected[expected.indexOf('--git') + 1] = '/real/git'expected.push('--branch', 'main')expect(sourceBranchProbe.branchProbeArgs(probe, root, '/real/git')).toEqual(expected)+ const managed = ['--run-module', 'hermes_cli.source_check', ...probe.slice(2)]+ expect(sourceBranchProbe.branchProbeArgs(managed, root, '/real/git')).toEqual([+ '--run-module', 'hermes_cli.source_check', ...expected.slice(2),+ ])expect(sourceBranchProbe.branchProbeArgs(probe, '/other/install', '/real/git')).toBe(probe)+ expect(sourceBranchProbe.branchProbeArgs(managed, '/other/install', '/real/git')).toBe(managed)expect(sourceBranchProbe.branchProbeArgs(['-c', 'print("hermes_cli/source_check.py")'], root, '/real/git')).toEqual(['-c', 'print("hermes_cli/source_check.py")'])+ expect(sourceBranchProbe.branchProbeArgs(['--run-module', 'hermes_cli.config', ...managed.slice(2)], root, '/real/git')).toEqual(['--run-module', 'hermes_cli.config', ...managed.slice(2)])expect(sourceBranchProbe.branchProbeArgs([...probe, '--branch', 'topic'], root, '/real/git')).toEqual([...probe, '--branch', 'topic'])expect(sourceBranchProbe.branchProbeArgs(probe, root, '')).toBe(probe)})diff --git a/tests/install/e2e-assets/source-branch-probe.cjs b/tests/install/e2e-assets/source-branch-probe.cjsindex 40121ef9352..4c40052f893 100644--- a/tests/install/e2e-assets/source-branch-probe.cjs+++ b/tests/install/e2e-assets/source-branch-probe.cjs@@ -45,9 +45,11 @@ function prepareSourceBranchEnvironment(root, expectedSha, realGit, capturedEnv,}function branchProbeArgs(args, root, realGit) {- if (!root || !realGit || !Array.isArray(args) || args[0] !== '-c'- || !args[1]?.includes('runpy.run_path(str(p))')- || !args[1]?.includes('hermes_cli/source_check.py')+ if (!root || !realGit || !Array.isArray(args)) return args+ const legacy = args[0] === '-c' && args[1]?.includes('runpy.run_path(str(p))')+ && args[1]?.includes('hermes_cli/source_check.py')+ const managed = args[0] === '--run-module' && args[1] === 'hermes_cli.source_check'+ if (!(legacy || managed)|| args[args.indexOf('--install-root') + 1] !== root|| !args.includes('--git') || args.includes('--branch')) return argsconst selected = [...args]