mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-05 16:04:43 +00:00
style: autoformat with biome to fix 195 formatting errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
be88ddbce1
commit
13de7d197b
@@ -53,9 +53,7 @@ let claudeModelsFromJson: ProviderModel[] = [];
|
||||
|
||||
const ctx = await createE2ETestContext({ timeout: 120000 });
|
||||
|
||||
async function runProviderModelsJson(
|
||||
provider: string,
|
||||
): Promise<ProviderModel[]> {
|
||||
async function runProviderModelsJson(provider: string): Promise<ProviderModel[]> {
|
||||
const transientNeedles = ["transport closed", "timed out", "timeout", "socket", "econn"];
|
||||
|
||||
for (let attempt = 1; attempt <= 3; attempt++) {
|
||||
|
||||
@@ -122,22 +122,18 @@ let recentSupervisorLogs = "";
|
||||
try {
|
||||
console.log("Test 1: start supervisor-entrypoint in dev mode with isolated PASEO_HOME");
|
||||
|
||||
supervisorProcess = spawn(
|
||||
"npx",
|
||||
["tsx", "../server/scripts/supervisor-entrypoint.ts", "--dev"],
|
||||
{
|
||||
cwd: cliRoot,
|
||||
env: {
|
||||
...process.env,
|
||||
...testEnv,
|
||||
PASEO_HOME: paseoHome,
|
||||
PASEO_LISTEN: `127.0.0.1:${port}`,
|
||||
PASEO_RELAY_ENABLED: "false",
|
||||
CI: "true",
|
||||
},
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
supervisorProcess = spawn("npx", ["tsx", "../server/scripts/supervisor-entrypoint.ts", "--dev"], {
|
||||
cwd: cliRoot,
|
||||
env: {
|
||||
...process.env,
|
||||
...testEnv,
|
||||
PASEO_HOME: paseoHome,
|
||||
PASEO_LISTEN: `127.0.0.1:${port}`,
|
||||
PASEO_RELAY_ENABLED: "false",
|
||||
CI: "true",
|
||||
},
|
||||
);
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
});
|
||||
|
||||
supervisorProcess.stdout?.on("data", (chunk) => {
|
||||
recentSupervisorLogs = (recentSupervisorLogs + chunk.toString()).slice(-8000);
|
||||
@@ -165,8 +161,7 @@ try {
|
||||
const command = readProcessCommand(daemonPid);
|
||||
assert(command !== null, "pid lock pid should resolve to a running process command");
|
||||
assert(
|
||||
command.includes("supervisor-entrypoint.ts") ||
|
||||
command.includes("supervisor-entrypoint.js"),
|
||||
command.includes("supervisor-entrypoint.ts") || command.includes("supervisor-entrypoint.js"),
|
||||
`pid lock pid should be supervisor-entrypoint process, got: ${command}`,
|
||||
);
|
||||
console.log(`✓ dev daemon started with daemon pid ${daemonPid}\n`);
|
||||
|
||||
@@ -133,23 +133,19 @@ let recentSupervisorLogs = "";
|
||||
try {
|
||||
console.log("Test 1: start supervisor-entrypoint in dev mode with isolated PASEO_HOME");
|
||||
|
||||
supervisorProcess = spawn(
|
||||
"npx",
|
||||
["tsx", "../server/scripts/supervisor-entrypoint.ts", "--dev"],
|
||||
{
|
||||
cwd: cliRoot,
|
||||
env: {
|
||||
...process.env,
|
||||
...testEnv,
|
||||
PASEO_HOME: paseoHome,
|
||||
PASEO_LISTEN: `127.0.0.1:${port}`,
|
||||
PASEO_RELAY_ENABLED: "false",
|
||||
CI: "true",
|
||||
},
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
detached: process.platform !== "win32",
|
||||
supervisorProcess = spawn("npx", ["tsx", "../server/scripts/supervisor-entrypoint.ts", "--dev"], {
|
||||
cwd: cliRoot,
|
||||
env: {
|
||||
...process.env,
|
||||
...testEnv,
|
||||
PASEO_HOME: paseoHome,
|
||||
PASEO_LISTEN: `127.0.0.1:${port}`,
|
||||
PASEO_RELAY_ENABLED: "false",
|
||||
CI: "true",
|
||||
},
|
||||
);
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
detached: process.platform !== "win32",
|
||||
});
|
||||
|
||||
supervisorProcess.stdout?.on("data", (chunk) => {
|
||||
recentSupervisorLogs = (recentSupervisorLogs + chunk.toString()).slice(-8000);
|
||||
|
||||
@@ -124,22 +124,18 @@ let recentSupervisorLogs = "";
|
||||
try {
|
||||
console.log("Test 1: start supervisor-entrypoint in dev mode with isolated PASEO_HOME");
|
||||
|
||||
supervisorProcess = spawn(
|
||||
"npx",
|
||||
["tsx", "../server/scripts/supervisor-entrypoint.ts", "--dev"],
|
||||
{
|
||||
cwd: cliRoot,
|
||||
env: {
|
||||
...process.env,
|
||||
...testEnv,
|
||||
PASEO_HOME: paseoHome,
|
||||
PASEO_LISTEN: host,
|
||||
PASEO_RELAY_ENABLED: "false",
|
||||
CI: "true",
|
||||
},
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
supervisorProcess = spawn("npx", ["tsx", "../server/scripts/supervisor-entrypoint.ts", "--dev"], {
|
||||
cwd: cliRoot,
|
||||
env: {
|
||||
...process.env,
|
||||
...testEnv,
|
||||
PASEO_HOME: paseoHome,
|
||||
PASEO_LISTEN: host,
|
||||
PASEO_RELAY_ENABLED: "false",
|
||||
CI: "true",
|
||||
},
|
||||
);
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
});
|
||||
|
||||
supervisorProcess.stdout?.on("data", (chunk) => {
|
||||
recentSupervisorLogs = (recentSupervisorLogs + chunk.toString()).slice(-8000);
|
||||
|
||||
@@ -27,12 +27,7 @@ try {
|
||||
|
||||
{
|
||||
console.log("Test 2: chat post/read/wait work");
|
||||
const posted = await ctx.paseo([
|
||||
"chat",
|
||||
"post",
|
||||
"coord-room",
|
||||
"first message for @agent-1",
|
||||
], {
|
||||
const posted = await ctx.paseo(["chat", "post", "coord-room", "first message for @agent-1"], {
|
||||
env: { PASEO_AGENT_ID: "00000000-0000-4000-8000-000000000111" },
|
||||
});
|
||||
assert.strictEqual(posted.exitCode, 0, posted.stderr);
|
||||
|
||||
@@ -28,7 +28,10 @@ try {
|
||||
assert.strictEqual(listed.exitCode, 0, listed.stderr);
|
||||
const listedJson = JSON.parse(listed.stdout);
|
||||
assert(Array.isArray(listedJson), listed.stdout);
|
||||
assert(listedJson.some((item: { id: string }) => item.id === createdJson.id), listed.stdout);
|
||||
assert(
|
||||
listedJson.some((item: { id: string }) => item.id === createdJson.id),
|
||||
listed.stdout,
|
||||
);
|
||||
|
||||
const inspected = await ctx.paseo(["schedule", "inspect", createdJson.id, "--json"]);
|
||||
assert.strictEqual(inspected.exitCode, 0, inspected.stderr);
|
||||
@@ -53,7 +56,16 @@ try {
|
||||
{
|
||||
console.log("Test 2: loop run/ls/inspect/logs/stop work");
|
||||
const run = await ctx.paseo(
|
||||
["loop", "run", "Return any response", "--name", "smoke-loop", "--verify-check", "true", "--json"],
|
||||
[
|
||||
"loop",
|
||||
"run",
|
||||
"Return any response",
|
||||
"--name",
|
||||
"smoke-loop",
|
||||
"--verify-check",
|
||||
"true",
|
||||
"--json",
|
||||
],
|
||||
{ timeout: 30000 },
|
||||
);
|
||||
assert.strictEqual(run.exitCode, 0, run.stderr);
|
||||
@@ -64,7 +76,10 @@ try {
|
||||
assert.strictEqual(listed.exitCode, 0, listed.stderr);
|
||||
const listedJson = JSON.parse(listed.stdout);
|
||||
assert(Array.isArray(listedJson), listed.stdout);
|
||||
assert(listedJson.some((item: { id: string }) => item.id === runJson.id), listed.stdout);
|
||||
assert(
|
||||
listedJson.some((item: { id: string }) => item.id === runJson.id),
|
||||
listed.stdout,
|
||||
);
|
||||
|
||||
let status = "running";
|
||||
for (let attempt = 0; attempt < 40; attempt += 1) {
|
||||
|
||||
@@ -4,16 +4,12 @@ import assert from "node:assert/strict";
|
||||
import { mkdir, mkdtemp } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import { tmpdir } from "node:os";
|
||||
import {
|
||||
classifyInvocation,
|
||||
isExistingDirectory,
|
||||
isPathLikeArg,
|
||||
} from "../src/classify.ts";
|
||||
import { classifyInvocation, isExistingDirectory, isPathLikeArg } from "../src/classify.ts";
|
||||
import { openDesktopWithProject } from "../src/commands/open.ts";
|
||||
|
||||
console.log("📋 Phase 32: Open Project CLI Tests\n");
|
||||
|
||||
console.log(" Testing path-like detection exports...");
|
||||
console.log(" Testing path-like detection exports...");
|
||||
assert.equal(isPathLikeArg("."), true);
|
||||
assert.equal(isPathLikeArg("./app"), true);
|
||||
assert.equal(isPathLikeArg("/tmp/app"), true);
|
||||
|
||||
@@ -27,13 +27,14 @@ async function cleanup(): Promise<void> {
|
||||
}
|
||||
|
||||
async function test_invalid_opencode_model_does_not_report_completed_while_still_running() {
|
||||
const result = await ctx.paseo(
|
||||
["run", "--provider", "opencode/adklasldkdas", "hello"],
|
||||
{ timeout: 45_000 },
|
||||
);
|
||||
const result = await ctx.paseo(["run", "--provider", "opencode/adklasldkdas", "hello"], {
|
||||
timeout: 45_000,
|
||||
});
|
||||
|
||||
const output = `${result.stdout}\n${result.stderr}`;
|
||||
const agentId = output.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i)?.[0];
|
||||
const agentId = output.match(
|
||||
/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,
|
||||
)?.[0];
|
||||
|
||||
if (result.exitCode !== 0) {
|
||||
assert(
|
||||
@@ -46,7 +47,11 @@ async function test_invalid_opencode_model_does_not_report_completed_while_still
|
||||
assert(agentId, `expected run output to include an agent id\nstdout:\n${result.stdout}`);
|
||||
|
||||
const inspect = await ctx.paseo(["inspect", agentId], { timeout: 15_000 });
|
||||
assert.strictEqual(inspect.exitCode, 0, `inspect failed\nstdout:\n${inspect.stdout}\nstderr:\n${inspect.stderr}`);
|
||||
assert.strictEqual(
|
||||
inspect.exitCode,
|
||||
0,
|
||||
`inspect failed\nstdout:\n${inspect.stdout}\nstderr:\n${inspect.stderr}`,
|
||||
);
|
||||
|
||||
const runReportedCompleted = result.stdout.includes("completed");
|
||||
const inspectStillRunning = inspect.stdout.includes("Status running");
|
||||
|
||||
@@ -411,8 +411,10 @@ export async function createE2ETestContext(options?: { timeout?: number }): Prom
|
||||
> {
|
||||
const ctx = await startTestDaemon({ timeout: options?.timeout });
|
||||
|
||||
const paseo = (args: string[], opts?: { timeout?: number; cwd?: string; env?: NodeJS.ProcessEnv }) =>
|
||||
runPaseoCli(ctx, args, opts);
|
||||
const paseo = (
|
||||
args: string[],
|
||||
opts?: { timeout?: number; cwd?: string; env?: NodeJS.ProcessEnv },
|
||||
) => runPaseoCli(ctx, args, opts);
|
||||
|
||||
return {
|
||||
...ctx,
|
||||
|
||||
Reference in New Issue
Block a user