feat: enhance desktop build process with artifact upload and download, and update server working directory resolution

This commit is contained in:
cita
2026-03-06 20:25:48 +08:00
parent 6c51801e50
commit 02bf0393e6
6 changed files with 54 additions and 5 deletions
+15
View File
@@ -3,6 +3,7 @@ import {
buildDesktopServerEnv,
createDesktopServerUrl,
isFatalServerExit,
resolveDesktopServerWorkingDir,
waitForServerReady,
} from './runtime.js';
@@ -30,6 +31,20 @@ describe('desktop runtime helpers', () => {
expect(createDesktopServerUrl(4312)).toBe('http://127.0.0.1:4312');
});
it('uses resources path as backend cwd for packaged desktop builds', () => {
expect(resolveDesktopServerWorkingDir({
appPath: 'C:/Users/test/AppData/Local/Programs/Metapi/resources/app.asar',
resourcesPath: 'C:/Users/test/AppData/Local/Programs/Metapi/resources',
isPackaged: true,
})).toBe('C:/Users/test/AppData/Local/Programs/Metapi/resources');
expect(resolveDesktopServerWorkingDir({
appPath: '/workspace/metapi',
resourcesPath: '/tmp/electron/resources',
isPackaged: false,
})).toBe('/workspace/metapi');
});
it('waits until the health probe returns ok', async () => {
const fetcher = vi.fn()
.mockRejectedValueOnce(new Error('offline'))