Skip to content

Commit 1aa7fc2

Browse files
committed
Fix Grok CI test portability
Use the repo test harness imports and launch mock ACP agents with the current runtime so CI does not depend on undeclared vitest or bun PATH availability.
1 parent 2fb6598 commit 1aa7fc2

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎apps/server/src/provider/Layers/GrokAdapter.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const decodeGrokSettings = Schema.decodeSync(GrokSettings);
2828

2929
const __dirname = path.dirname(fileURLToPath(import.meta.url));
3030
const mockAgentPath = path.join(__dirname, "../../../scripts/acp-mock-agent.ts");
31-
const bunExe = "bun";
31+
const mockAgentCommand = process.execPath;
3232

3333
async function makeMockGrokWrapper(extraEnv?: Record<string, string>) {
3434
const dir = await mkdtemp(path.join(os.tmpdir(), "grok-acp-mock-"));
@@ -38,7 +38,7 @@ async function makeMockGrokWrapper(extraEnv?: Record<string, string>) {
3838
.join("\n");
3939
const script = `#!/bin/sh
4040
${envExports}
41-
exec ${JSON.stringify(bunExe)} ${JSON.stringify(mockAgentPath)} "$@"
41+
exec ${JSON.stringify(mockAgentCommand)} ${JSON.stringify(mockAgentPath)} "$@"
4242
`;
4343
await writeFile(wrapperPath, script, "utf8");
4444
await chmod(wrapperPath, 0o755);

‎apps/server/src/provider/Layers/GrokProvider.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as Effect from "effect/Effect";
33
import * as FileSystem from "effect/FileSystem";
44
import * as Path from "effect/Path";
55
import * as Schema from "effect/Schema";
6-
import { describe, expect, it } from "vitest";
6+
import { describe, expect, it } from "vite-plus/test";
77
import { ChildProcessSpawner } from "effect/unstable/process";
88
import { GrokSettings } from "@t3tools/contracts";
99

‎apps/server/src/provider/acp/GrokAcpCliProbe.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
1111
import { it } from "@effect/vitest";
1212
import * as Effect from "effect/Effect";
1313
import { ChildProcessSpawner } from "effect/unstable/process";
14-
import { describe, expect } from "vitest";
14+
import { describe, expect } from "vite-plus/test";
1515

1616
import { makeGrokAcpRuntime } from "./GrokAcpSupport.ts";
1717

‎apps/server/src/provider/acp/GrokAcpSupport.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Effect from "effect/Effect";
22
import * as EffectAcpErrors from "effect-acp/errors";
3-
import { describe, expect, it } from "vitest";
3+
import { describe, expect, it } from "vite-plus/test";
44

55
import {
66
applyGrokAcpModelSelection,

‎apps/server/src/textGeneration/GrokTextGeneration.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as Effect from "effect/Effect";
1010
import * as Layer from "effect/Layer";
1111
import * as Schema from "effect/Schema";
1212
import { createModelSelection } from "@t3tools/shared/model";
13-
import { expect } from "vitest";
13+
import { expect } from "vite-plus/test";
1414
import { GrokSettings, ProviderInstanceId } from "@t3tools/contracts";
1515

1616
import { ServerConfig } from "../config.ts";
@@ -42,7 +42,7 @@ function makeAcpGrokWrapper(dir: string, env: Record<string, string>): string {
4242
' printf "%s\\n" "unexpected args: $*" >&2',
4343
" exit 11",
4444
"fi",
45-
`exec bun ${JSON.stringify(mockAgentPath)}`,
45+
`exec ${JSON.stringify(process.execPath)} ${JSON.stringify(mockAgentPath)}`,
4646
"",
4747
].join("\n"),
4848
"utf8",

0 commit comments

Comments
 (0)