* fix(ci): skip unrelated required checks cleanly Matrix jobs had to start no-op runners to preserve interpolated required-check names. Static named jobs let GitHub report genuine skipped conclusions while keeping those names stable. * fix(ci): gate changes to install patching script * fix(ci): route cross-package test contracts narrowly * fix(ci): keep routed contracts merge-blocking * fix(server): exclude nested test utilities from builds * fix(ci): cover app-owned native and browser domains * refactor(ci): align tests with runtime domains Own browser specs, desktop specs, and Electron-only app code by stable directories so PR routing does not depend on filename conventions. Keep desktop integration coverage inside the required desktop check. * fix(ci): keep routing and desktop suites isolated The routing regression must run before dependency installation, and desktop Vitest must not collect Playwright-owned specs. * fix(ci): isolate desktop e2e runtime * perf(test): isolate Playwright workers * perf(test): parallelize Playwright within specs * fix(test): keep Playwright file scheduling * fix(test): share dynamic Metro fixture * fix(test): preserve own-host restart fixtures * fix(ci): preserve routed contracts after rebase * Stabilize Playwright wheel-scroll assertions
89 lines
3.2 KiB
TypeScript
89 lines
3.2 KiB
TypeScript
import { existsSync } from "node:fs";
|
|
import { expect, test } from "../support/fixtures";
|
|
import { createTempGitRepo } from "../support/helpers/workspace";
|
|
import { clickNewTerminal } from "../support/helpers/launcher";
|
|
import { expectTerminalSurfaceVisible } from "../support/helpers/terminal-perf";
|
|
import {
|
|
connectWorkspaceSetupClient,
|
|
createWorkspaceThroughDaemon,
|
|
findWorktreeWorkspaceForProject,
|
|
navigateToWorkspaceViaSidebar,
|
|
openHomeWithProject,
|
|
seedProjectForWorkspaceSetup,
|
|
} from "../support/helpers/workspace-setup";
|
|
|
|
test.describe("Workspace setup runtime authority", () => {
|
|
test.describe.configure({ retries: 1 });
|
|
|
|
test("worktree workspace is created in its own directory", async ({ page }) => {
|
|
test.setTimeout(90_000);
|
|
|
|
const client = await connectWorkspaceSetupClient();
|
|
const repo = await createTempGitRepo("workspace-setup-chat-");
|
|
|
|
try {
|
|
await seedProjectForWorkspaceSetup(client, repo.path);
|
|
const workspace = await createWorkspaceThroughDaemon(client, {
|
|
cwd: repo.path,
|
|
worktreeSlug: `setup-chat-${Date.now()}`,
|
|
});
|
|
const workspaceId = workspace.id;
|
|
|
|
const wsInfo = await findWorktreeWorkspaceForProject(client, repo.path);
|
|
expect(wsInfo.workspaceDirectory).not.toBe(repo.path);
|
|
expect(existsSync(wsInfo.workspaceDirectory)).toBe(true);
|
|
|
|
await openHomeWithProject(page, repo.path);
|
|
await navigateToWorkspaceViaSidebar(page, workspaceId);
|
|
await expect(page).toHaveURL(/\/workspace\//, { timeout: 30_000 });
|
|
} finally {
|
|
await client.close();
|
|
await repo.cleanup();
|
|
}
|
|
});
|
|
|
|
test("first terminal opens in the created workspace directory", async ({ page }) => {
|
|
test.setTimeout(90_000);
|
|
|
|
const client = await connectWorkspaceSetupClient();
|
|
const repo = await createTempGitRepo("workspace-setup-terminal-");
|
|
|
|
try {
|
|
await seedProjectForWorkspaceSetup(client, repo.path);
|
|
|
|
// Create workspace via daemon API since the new workspace screen
|
|
// no longer has a standalone terminal button
|
|
const worktreeSlug = `setup-terminal-${Date.now()}`;
|
|
const result = await client.createPaseoWorktree({
|
|
cwd: repo.path,
|
|
worktreeSlug,
|
|
});
|
|
if (!result.workspace || result.error) {
|
|
throw new Error(result.error ?? "Failed to create workspace");
|
|
}
|
|
const workspaceDir = result.workspace.workspaceDirectory;
|
|
const workspaceId = result.workspace.id;
|
|
|
|
// Navigate to the worktree workspace via sidebar click (direct URL
|
|
// navigation for freshly created worktree workspaces can race with
|
|
// Expo Router hydration, so we use the sidebar which is authoritative).
|
|
await openHomeWithProject(page, repo.path);
|
|
await navigateToWorkspaceViaSidebar(page, workspaceId);
|
|
|
|
await clickNewTerminal(page);
|
|
await expectTerminalSurfaceVisible(page);
|
|
|
|
// Verify terminal is listed under the worktree directory, not the original repo
|
|
await expect
|
|
.poll(async () => (await client.listTerminals(workspaceDir)).terminals.length > 0, {
|
|
timeout: 30_000,
|
|
})
|
|
.toBe(true);
|
|
expect((await client.listTerminals(repo.path)).terminals.length).toBe(0);
|
|
} finally {
|
|
await client.close();
|
|
await repo.cleanup();
|
|
}
|
|
});
|
|
});
|