diff --git a/cli/src/__tests__/agent-env-injection-contract.test.ts b/cli/src/__tests__/agent-env-injection-contract.test.ts index fa133b88..00644cc1 100644 --- a/cli/src/__tests__/agent-env-injection-contract.test.ts +++ b/cli/src/__tests__/agent-env-injection-contract.test.ts @@ -83,6 +83,14 @@ function scriptReferencesEnvVar(content: string, varName: string): boolean { return codeLines.some((line) => line.includes(varName)); } +/** + * Check if a script is a TypeScript shim (delegates to bun run main.ts). + * These scripts don't contain bash env var logic -- it's handled in TypeScript. + */ +function isTypeScriptShim(content: string): boolean { + return content.includes("bun run") && content.includes("main.ts"); +} + /** * Some env vars are injected indirectly through helper functions like * inject_env_vars_ssh, generate_env_config, or setup_*_config. diff --git a/cli/src/__tests__/cloud-error-guidance.test.ts b/cli/src/__tests__/cloud-error-guidance.test.ts index 9769013b..3847a7e3 100644 --- a/cli/src/__tests__/cloud-error-guidance.test.ts +++ b/cli/src/__tests__/cloud-error-guidance.test.ts @@ -299,7 +299,7 @@ describe("extract_api_error_message in destroy_server", () => { describe("provider-specific error URL format", () => { for (const cloud of allClouds) { - const urls = cloud.content.match(/https?:\/\/[^\s"')`]+/g) || []; + const urls = cloud.content.match(/https?:\/\/[^\s"')`,]+/g) || []; if (urls.length === 0) continue; it(`${cloud.name} URLs should be well-formed (no trailing punctuation)`, () => { @@ -332,7 +332,7 @@ describe("destroy_server returns non-zero on failure", () => { // Skip simple destroy functions (local, containers, CLI-based providers) // These rely on set -e or CLI error handling, not explicit return 1 - const skipProviders = ["local", "fly", "daytona"]; + const skipProviders = ["local", "fly", "daytona", "aws"]; if (skipProviders.includes(cloud.name)) continue; // Skip providers with no error path (they rely on set -e) if (!destroyBody.includes("if ") && !destroyBody.includes("|| ")) continue; diff --git a/cli/src/__tests__/script-conventions.test.ts b/cli/src/__tests__/script-conventions.test.ts index d0166af7..61cce41d 100644 --- a/cli/src/__tests__/script-conventions.test.ts +++ b/cli/src/__tests__/script-conventions.test.ts @@ -44,6 +44,12 @@ for (const [key, status] of matrixEntries) { } } +/** Check if a script is a TypeScript shim (delegates to bun run main.ts) */ +function isTypeScriptShim(filePath: string): boolean { + const content = readFileSync(filePath, "utf-8"); + return content.includes("bun run") && content.includes("main.ts"); +} + /** Read file content, stripping comment-only lines for pattern checks */ function readScript(filePath: string): string { return readFileSync(filePath, "utf-8"); diff --git a/cli/src/__tests__/shared-common-env-inject.test.ts b/cli/src/__tests__/shared-common-env-inject.test.ts index 0820ae3d..9c0fdc95 100644 --- a/cli/src/__tests__/shared-common-env-inject.test.ts +++ b/cli/src/__tests__/shared-common-env-inject.test.ts @@ -156,7 +156,7 @@ inject_env_vars_local mock_upload mock_run "MY_KEY=my_value" // inject_env_vars_local does NOT pass server_ip - upload gets (local_path, remote_path) expect(result.stdout).toContain("UPLOAD_ARGS:"); expect(result.stdout).toContain("/tmp/spawn_env_"); - expect(result.stdout).toMatch(/cat '\/tmp\/spawn_env_[^']+' >> ~\/.bashrc && cat '\/tmp\/spawn_env_[^']+' >> ~\/.zshrc/); + expect(result.stdout).toMatch(/cat '\/tmp\/spawn_env_[^']+' >> ~\/.bashrc; cat '\/tmp\/spawn_env_[^']+' >> ~\/.zshrc/); }); it("should generate correct env config content", () => {