hermes-agent/tests/install/e2e-assets/mock-provider.mjs
ethernet bf75bc2516 feat(ci): require desktop chat after bundle and install builds
Share the real composer, provider-witness and completed-reply check across
post-build bundle smoke and desktop-bearing install/update checkpoints.
Keep native automatic-relaunch proof separate from post-update chat.

Download receipt-bound artifacts without release credentials and install
DMG, ZIP, MSIX and universal MSIXBUNDLE on each native architecture.
Split Windows assembly from feed publication; publish tested bytes only.
Bind candidate smoke results into the manifest used by stable promotion.

Verify historical/source provenance without assuming a version IPC commit,
strip CI identity from source build children, and use the actual Electron
PID rather than Playwright's Windows launcher wrapper.

Validation: real Linux Electron chat and sequential OLD/NEW source smoke
with preserved history; 145 targeted Python tests and 14 JS tests passed;
TypeScript, shell/PowerShell parsing and workflow checks passed.
Native macOS/Windows deployment and historical upgrades need Actions proof.
2026-09-13 19:57:38 -04:00

32 lines
1.1 KiB
JavaScript

// Driver-side wrapper around tests-js/scripts/mock-server.ts (the desktop
// E2E suite's OpenAI-compatible mock): starts the server as a LIBRARY
// (importing, not executing, so the dev-launcher block never runs) and
// publishes its URL to a file for the shell driver to consume.
//
// Usage: node mock-provider.mjs <url-file>
// Writes "<url-file>" with the base URL (http://127.0.0.1:<port>) once
// the server is listening, then stays alive until SIGINT or SIGTERM.
// @ts-check
import fs from 'node:fs';
import process from 'node:process';
import { startMockServer } from '../../../tests-js/scripts/mock-server.ts';
const urlFile = process.argv[2];
if (!urlFile) {
console.error('usage: node mock-provider.mjs <url-file>');
process.exit(1);
}
const mock = await startMockServer();
fs.writeFileSync(urlFile, mock.url);
console.log(`[mock-provider] listening at ${mock.url}`);
for (const signal of ['SIGINT', 'SIGTERM']) {
process.once(signal, async () => {
await mock.close();
process.exit(0);
});
}
// A background shell starts with stdin at EOF; signals own this lifetime.
await new Promise(() => {});