mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
* chore(ci): audit packaging costs and repeated test execution Read-only audit: Linux packaging and smokes consume 12-14 minutes; all three CLI shards repeat the 294-test source suite and build the server twice. Preserve the 17 required contexts, move packaging to main, run CLI source tests once, and consolidate repeated E2E setup into journeys. Historical logs and the complete audit were reported outside the repository. * ci: move packaging to main and remove repeated CLI suites PR runners were rebuilding distribution artifacts and executing the entire CLI source suite on all three E2E shards. Keep packaging coverage after merge, let the local E2E runner own its dependency build, and execute source tests once in an existing required check. Root typecheck already validates plugin examples. * test(ci): consolidate journeys and remove repeated startup work Run user journeys with shared setup, retain one Hub CLI contract, and weight the existing Playwright shards using observed costs. Remove implementation-only and ad-hoc measurement checks. Await root-watch closure and publish creation failure commands atomically so teardown and failure injection have completion boundaries. * test(hub): remove incidental observation and speculative shutdown changes Hub control RPCs need a connected client without an agent observation. Preserve the failed-create subscription contract and remove product shutdown changes whose Windows cleanup cause was not reproduced. * fix(client): clear the scheduled retry when a connect attempt opens a transport An explicit connect() during reconnect backoff opened a new transport but left the scheduled retry armed. When it fired on the healthy connection it disposed the transport and reconnected, dropping requests in flight. This is why owned-subscriptions-old-daemon could still fail after #4858 added the explicit reconnect. attemptConnect now owns the rule ensureConnected already applied; the new unit test fails on the old client. * test(e2e): keep the completed-block, font-readiness, and live-page guards inside journeys - agent-stream-ui: the auto-scroll journey anchors on the completed intro block by content and requires its Markdown root to stay the same mounted node while later blocks stream (#1989 guard, reshaped off the tail block). - changes-pane: the code-typography journey holds font loads and requires no diff geometry before they resolve, then applies the font change. - agent-timeline-pagination: the live-output page load runs against a thirty-minute mock stream and gates the release on the running turn, so the status assertion no longer races a ten-second turn. * test(desktop): install the Electron binary once before the unit suite Electron 44 downloads its binary on the first Node require("electron") instead of at npm ci. Vitest workers importing electron-log/main raced that download and extraction (File exists on dist/electron, then "Electron failed to install correctly" in a sibling worker) on both Ubuntu and Windows desktop-tests jobs. Run the package's idempotent install-electron in one process before vitest forks. * ci(desktop-packages): pin actions and smoke packaging-path pull requests Pin checkout, setup-node, and upload-artifact to full commit SHAs. Keep packaging off ordinary PR CI, but run the Linux package smoke on pull requests that touch packages/desktop, nix, or the workflow so a packaging or sandbox regression cannot land on main unchecked. The desktop release workflow already builds and smokes its own artifacts on all platforms.
96 lines
3.4 KiB
TypeScript
96 lines
3.4 KiB
TypeScript
import { writeFile, rm, rename } from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { copyPluginExample } from "./helpers/plugin-fixture";
|
|
import { connectNewWorkspaceDaemonClient } from "./helpers/new-workspace";
|
|
import { test as base } from "./fixtures";
|
|
import {
|
|
createCreationScenario,
|
|
createPromptRetryScenario,
|
|
retryNextAgentCreation,
|
|
} from "./helpers/creation";
|
|
import { installDaemonWebSocketGate } from "./helpers/daemon-websocket-gate";
|
|
import { delayBrowserAgentCreatedStatus } from "./helpers/new-workspace";
|
|
|
|
export const test = base.extend<{
|
|
startup: { release(): Promise<void>; fail(): Promise<void> };
|
|
creation: Awaited<ReturnType<typeof createCreationScenario>>;
|
|
promptRetry: ReturnType<typeof createPromptRetryScenario>;
|
|
agentRetries: Awaited<ReturnType<typeof retryNextAgentCreation>>;
|
|
delayedCreation: Awaited<ReturnType<typeof delayBrowserAgentCreatedStatus>>;
|
|
}>({
|
|
startup: async ({ page }, provide) => {
|
|
void page;
|
|
const client = await connectNewWorkspaceDaemonClient();
|
|
const plugin = await copyPluginExample("lifecycle-logger");
|
|
const gate = path.join(plugin.directory, "startup.txt");
|
|
const failure = path.join(plugin.directory, "startup-failure.txt");
|
|
const previous = await client.getDaemonConfig();
|
|
try {
|
|
await writeFile(gate, "hold");
|
|
await writeFile(failure, "fail");
|
|
await writeFile(
|
|
path.join(plugin.directory, "index.server.ts"),
|
|
`
|
|
import { readFile, rm } from "node:fs/promises";
|
|
export default function contribute(server) {
|
|
return server.before("agent.session_open", async ({ request }) => {
|
|
if (request.reason !== "create") return request;
|
|
const gate = ${JSON.stringify(gate)};
|
|
let command = await readFile(gate, "utf8").catch(() => "release");
|
|
while (command === "hold") {
|
|
await new Promise(resolve => setTimeout(resolve, 20));
|
|
command = await readFile(gate, "utf8").catch(() => "release");
|
|
}
|
|
if (command === "fail") {
|
|
await rm(gate, { force: true });
|
|
throw new Error("Creation startup failed for test");
|
|
}
|
|
return request;
|
|
});
|
|
}
|
|
`,
|
|
);
|
|
await client.patchDaemonConfig({ pluginsEnabled: true });
|
|
await client.installDirectoryPlugin(plugin.directory);
|
|
await provide({
|
|
release: () => rm(gate, { force: true }),
|
|
// Replacing the command must not expose a truncated, empty file to the hook.
|
|
fail: () => rename(failure, gate),
|
|
});
|
|
} finally {
|
|
await rm(gate, { force: true });
|
|
await client.removePlugin("lifecycle-logger");
|
|
await client.patchDaemonConfig({ pluginsEnabled: previous.config.pluginsEnabled });
|
|
await plugin.cleanup();
|
|
await client.close();
|
|
}
|
|
},
|
|
creation: async ({ page }, provide) => {
|
|
const creation = await createCreationScenario(page);
|
|
try {
|
|
await provide(creation);
|
|
} finally {
|
|
await creation.cleanup();
|
|
}
|
|
},
|
|
promptRetry: async ({ page }, provide) => {
|
|
const gate = await installDaemonWebSocketGate(page);
|
|
try {
|
|
await provide(createPromptRetryScenario(page, gate));
|
|
} finally {
|
|
gate.restore();
|
|
}
|
|
},
|
|
agentRetries: async ({ page }, provide) => {
|
|
await provide(await retryNextAgentCreation(page));
|
|
},
|
|
delayedCreation: async ({ page }, provide) => {
|
|
const delayed = await delayBrowserAgentCreatedStatus(page);
|
|
try {
|
|
await provide(delayed);
|
|
} finally {
|
|
delayed.release();
|
|
}
|
|
},
|
|
});
|