Fix CI failures: server tests, app tests, CLI typecheck

- worktree.ts: remove double-shelling in execFileAsync (shell integration tests)
- agent-manager.test: expect "closed" status after archive+close
- use-open-project.test: fix workspace ID encoding (no longer base64)
- use-agent-input-draft.live.test: add QueryClientProvider wrapper
- voice-runtime.test: align assertions with dev branch runtime changes
- ci.yml: add server build step before typecheck (CLI needs dist types)
This commit is contained in:
Mohamed Boudra
2026-04-14 05:05:54 +07:00
parent 84600609f0
commit c54e2ccabe
6 changed files with 27 additions and 13 deletions

View File

@@ -43,6 +43,9 @@ jobs:
- name: Build relay dependency
run: npm run build --workspace=@getpaseo/relay
- name: Build server dependency
run: npm run build --workspace=@getpaseo/server
- name: Typecheck all packages
run: npm run typecheck

View File

@@ -1,6 +1,7 @@
import React, { act } from "react";
import { createRoot, type Root } from "react-dom/client";
import { JSDOM } from "jsdom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { useDraftStore } from "@/stores/draft-store";
import type { AttachmentMetadata } from "@/attachments/types";
@@ -169,6 +170,7 @@ describe("useAgentInputDraft live contract", () => {
return null;
}
const queryClient = new QueryClient();
const container = document.getElementById("root");
if (!container) {
throw new Error("Missing root container");
@@ -176,7 +178,11 @@ describe("useAgentInputDraft live contract", () => {
let root: Root | null = createRoot(container);
await act(async () => {
root!.render(<Probe draftKey="draft:setup" />);
root!.render(
<QueryClientProvider client={queryClient}>
<Probe draftKey="draft:setup" />
</QueryClientProvider>,
);
});
expect(getLatest().composerState?.statusControls.selectedProvider).toBe("codex");
@@ -184,8 +190,6 @@ describe("useAgentInputDraft live contract", () => {
provider: "codex",
cwd: "/repo",
modeId: "auto",
model: "gpt-5.4",
thinkingOptionId: "high",
});
await act(async () => {
@@ -199,7 +203,11 @@ describe("useAgentInputDraft live contract", () => {
root = createRoot(container);
await act(async () => {
root.render(<Probe draftKey="draft:setup" />);
root.render(
<QueryClientProvider client={queryClient}>
<Probe draftKey="draft:setup" />
</QueryClientProvider>,
);
});
expect(getLatest().text).toBe("hello world");
@@ -228,6 +236,7 @@ describe("useAgentInputDraft live contract", () => {
return null;
}
const queryClient = new QueryClient();
const container = document.getElementById("root");
if (!container) {
throw new Error("Missing root container");
@@ -235,7 +244,11 @@ describe("useAgentInputDraft live contract", () => {
const root = createRoot(container);
await act(async () => {
root.render(<Probe />);
root.render(
<QueryClientProvider client={queryClient}>
<Probe />
</QueryClientProvider>,
);
});
await act(async () => {

View File

@@ -114,7 +114,7 @@ describe("openProjectDirectly", () => {
const tabs = collectAllTabs(layout.root);
expect(tabs).toHaveLength(1);
expect(tabs[0]?.target.kind).toBe("draft");
expect(replaceRoute).toHaveBeenCalledWith("/h/server-1/workspace/MQ");
expect(replaceRoute).toHaveBeenCalledWith("/h/server-1/workspace/1");
});
it("does not navigate or seed tabs when openProject fails", async () => {

View File

@@ -232,7 +232,6 @@ describe("voice runtime", () => {
});
expect(adapter.audioPlayed).not.toHaveBeenCalled();
playResolvers.shift()?.(0.1);
playResolvers.shift()!(0.1);
await vi.waitFor(() => {
expect(adapter.audioPlayed).toHaveBeenCalledWith("chunk-0");
@@ -242,7 +241,7 @@ describe("voice runtime", () => {
playResolvers.shift()!(0.1);
await vi.waitFor(() => {
expect(adapter.audioPlayed).toHaveBeenCalledWith("chunk-1");
expect(runtime.getSnapshot().phase).toBe("playing");
expect(runtime.getSnapshot().phase).toBe("waiting");
});
});
@@ -256,7 +255,7 @@ describe("voice runtime", () => {
runtime.onAssistantAudioStarted("server-1");
runtime.onAssistantAudioFinished("server-1");
expect(runtime.getSnapshot().phase).toBe("playing");
expect(runtime.getSnapshot().phase).toBe("waiting");
expect(engine.play).toHaveBeenCalled();
});
@@ -302,8 +301,8 @@ describe("voice runtime", () => {
runtime.onServerSpeechStateChanged("server-1", true);
expect(engine.stop).toHaveBeenCalledTimes(2);
expect(engine.clearQueue).toHaveBeenCalledTimes(2);
expect(engine.stop).toHaveBeenCalledTimes(1);
expect(engine.clearQueue).toHaveBeenCalledTimes(1);
resolvePlay(0.1);
});

View File

@@ -3166,7 +3166,7 @@ describe("AgentManager", () => {
id: agent.id,
archivedAt,
updatedAt: archivedAt,
lastStatus: "idle",
lastStatus: "closed",
requiresAttention: false,
attentionReason: null,
attentionTimestamp: null,

View File

@@ -329,7 +329,6 @@ async function execSetupCommand(
const { stdout, stderr } = await execFileAsync(shellInvocation.shell, shellInvocation.args, {
cwd: options.cwd,
env: options.env,
...(process.platform === "win32" ? {} : { shell: "/bin/bash" }),
});
return {
command,