@empiricalrun/test-gen 0.64.1 → 0.64.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.64.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f05aac2: feat: add environment overrides for projects in tool calls
8
+ - Updated dependencies [f05aac2]
9
+ - @empiricalrun/test-run@0.10.1
10
+ - @empiricalrun/llm@0.17.3
11
+
3
12
  ## 0.64.1
4
13
 
5
14
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAyChC,wBAAsB,kBAAkB,CAAC,EACvC,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,SAAS,GACV,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,iBAuHA;AAuBD,wBAAsB,wBAAwB,CAAC,EAC7C,aAAa,EACb,aAAa,GACd,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB,iBA6DA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/chat/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAyChC,wBAAsB,kBAAkB,CAAC,EACvC,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,SAAS,GACV,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,iBAwHA;AAuBD,wBAAsB,wBAAwB,CAAC,EAC7C,aAAa,EACb,aAAa,GACd,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;CACvB,iBA6DA"}
@@ -111,6 +111,7 @@ async function runChatAgentForCLI({ useDiskForChatState, selectedModel, initialP
111
111
  apiKey: process.env.EMPIRICALRUN_API_KEY,
112
112
  trace,
113
113
  featureFlags: [],
114
+ environmentOverrides: {},
114
115
  });
115
116
  const fileInfo = await (0, file_tree_1.getFileInfoFromFS)(process.cwd());
116
117
  await (0, agent_loop_1.chatAgentLoop)({
@@ -15,7 +15,8 @@ export declare class ToolCallService {
15
15
  apiKey: string | undefined;
16
16
  trace?: TraceClient;
17
17
  featureFlags: string[];
18
- constructor({ chatSessionId, selectedModel, branchName, repoPath, apiKey, trace, featureFlags, }: {
18
+ environmentOverrides: Record<string, string>;
19
+ constructor({ chatSessionId, selectedModel, branchName, repoPath, apiKey, trace, featureFlags, environmentOverrides, }: {
19
20
  chatSessionId: number | null;
20
21
  selectedModel: SupportedChatModels;
21
22
  branchName: string;
@@ -23,6 +24,7 @@ export declare class ToolCallService {
23
24
  apiKey: string | undefined;
24
25
  trace?: TraceClient;
25
26
  featureFlags: string[];
27
+ environmentOverrides?: Record<string, string>;
26
28
  });
27
29
  sendToQueue(toolCalls: PendingToolCall[]): Promise<void>;
28
30
  execute(toolCalls: PendingToolCall[]): Promise<ToolResult[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAEL,eAAe,EACf,mBAAmB,EACnB,UAAU,EACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAiB,IAAI,EAAE,WAAW,EAAE,MAAM,4BAA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 chatSessionId, selectedModel, branchName, repoPath, apiKey, trace, featureFlags, }) {
27
+ environmentOverrides;
28
+ constructor({ chatSessionId, selectedModel, branchName, repoPath, apiKey, trace, featureFlags, environmentOverrides = {}, }) {
28
29
  this.chatSessionId = chatSessionId;
29
30
  this.selectedModel = selectedModel;
30
31
  this.branchName = branchName;
@@ -32,6 +33,7 @@ class ToolCallService {
32
33
  this.repoPath = repoPath;
33
34
  this.apiKey = apiKey;
34
35
  this.featureFlags = featureFlags;
36
+ this.environmentOverrides = environmentOverrides;
35
37
  this.tools = [
36
38
  grep_1.grepTool,
37
39
  test_run_1.runTestTool,
@@ -62,13 +64,16 @@ class ToolCallService {
62
64
  if (!requestId) {
63
65
  throw new Error("Could not find an id for the tool call.");
64
66
  }
65
- await (0, utils_1.sendToolRequestToRemoteQueue)({
67
+ const queueUrl = (0, utils_1.getQueueUrl)(this.featureFlags);
68
+ if (!queueUrl) {
69
+ throw new Error(`queueUrl is required for remote execution.`);
70
+ }
71
+ await (0, utils_1.sendToolRequestToRemoteQueue)(queueUrl, {
66
72
  toolCalls,
67
73
  requestId,
68
74
  chatSessionId: this.chatSessionId,
69
75
  selectedModel: this.selectedModel,
70
76
  branchName: this.branchName,
71
- featureFlags: this.featureFlags || [],
72
77
  });
73
78
  }
74
79
  async execute(toolCalls) {
@@ -110,6 +115,7 @@ class ToolCallService {
110
115
  apiKey: this.apiKey,
111
116
  trace: this.trace,
112
117
  collectArtifacts: collectArtifactsFn,
118
+ environmentOverrides: this.environmentOverrides,
113
119
  });
114
120
  const artifacts = await uploadArtifactsQueue.waitForCompletion();
115
121
  toolResults.push({ ...result, artifacts });
@@ -1,11 +1,11 @@
1
1
  import { SupportedChatModels } from "@empiricalrun/llm/chat";
2
2
  import { PendingToolCall } from "@empiricalrun/shared-types";
3
- export declare function sendToolRequestToRemoteQueue(payload: {
3
+ export declare function getQueueUrl(featureFlags: string[]): string | undefined;
4
+ export declare function sendToolRequestToRemoteQueue(queueUrl: string, payload: {
4
5
  toolCalls: PendingToolCall[];
5
6
  requestId: string;
6
7
  chatSessionId: number;
7
8
  selectedModel: SupportedChatModels;
8
9
  branchName: string;
9
- featureFlags: string[];
10
10
  }): Promise<void>;
11
11
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,iBA4BA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tool-call-service/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,sBAMjD;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IACP,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,iBAiBF"}
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getQueueUrl = getQueueUrl;
3
4
  exports.sendToolRequestToRemoteQueue = sendToolRequestToRemoteQueue;
4
5
  const client_sqs_1 = require("@aws-sdk/client-sqs");
5
- async function sendToolRequestToRemoteQueue(payload) {
6
+ function getQueueUrl(featureFlags) {
7
+ const useToolExecutionOnEcs = featureFlags.includes("useToolExecutionOnEcs");
8
+ if (useToolExecutionOnEcs) {
9
+ return process.env.TOOL_EXECUTION_SQS_URL_ECS;
10
+ }
11
+ return process.env.TOOL_EXECUTION_SQS_URL;
12
+ }
13
+ async function sendToolRequestToRemoteQueue(queueUrl, payload) {
6
14
  const sqs = new client_sqs_1.SQSClient({
7
15
  region: process.env.AWS_REGION,
8
16
  credentials: {
@@ -10,14 +18,6 @@ async function sendToolRequestToRemoteQueue(payload) {
10
18
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
11
19
  },
12
20
  });
13
- const useToolExecutionOnEcs = payload.featureFlags.includes("useToolExecutionOnEcs");
14
- let queueUrl = process.env.TOOL_EXECUTION_SQS_URL;
15
- if (useToolExecutionOnEcs) {
16
- queueUrl = process.env.TOOL_EXECUTION_SQS_URL_ECS;
17
- }
18
- if (!queueUrl) {
19
- throw new Error(`${useToolExecutionOnEcs ? "TOOL_EXECUTION_SQS_URL_ECS" : "TOOL_EXECUTION_SQS_URL"} is required for remote execution.`);
20
- }
21
21
  await sqs.send(new client_sqs_1.SendMessageCommand({
22
22
  QueueUrl: queueUrl,
23
23
  MessageBody: JSON.stringify(payload),
@@ -1 +1 @@
1
- {"version":3,"file":"commit-and-create-pr.d.ts","sourceRoot":"","sources":["../../src/tools/commit-and-create-pr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAOvD,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAiB1D;AA2CD,eAAO,MAAM,qBAAqB,EAAE,IA0FnC,CAAC"}
1
+ {"version":3,"file":"commit-and-create-pr.d.ts","sourceRoot":"","sources":["../../src/tools/commit-and-create-pr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AAOpC,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAiB1D;AA2CD,eAAO,MAAM,qBAAqB,EAAE,IA6FnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagnosis-fetcher.d.ts","sourceRoot":"","sources":["../../src/tools/diagnosis-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAevD,eAAO,MAAM,wBAAwB,EAAE,IAyFtC,CAAC"}
1
+ {"version":3,"file":"diagnosis-fetcher.d.ts","sourceRoot":"","sources":["../../src/tools/diagnosis-fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAC;AAepE,eAAO,MAAM,wBAAwB,EAAE,IAqFtC,CAAC"}
@@ -19,7 +19,9 @@ exports.fetchDiagnosisReportTool = {
19
19
  description: "Fetch details about a test case diagnosis using its URL or slug",
20
20
  parameters: DiagnosisSchema,
21
21
  },
22
- execute: async ({ input, repoPath, apiKey, }) => {
22
+ execute: async (params) => {
23
+ const { input } = params;
24
+ const { repoPath, apiKey } = params;
23
25
  const { diagnosisUrl } = input;
24
26
  // Extract the slug from the URL - it's the part after the last '--'
25
27
  const slug = diagnosisUrl.split("--").pop();
@@ -1 +1 @@
1
- {"version":3,"file":"download-build.d.ts","sourceRoot":"","sources":["../../src/tools/download-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E,eAAO,MAAM,iBAAiB,EAAE,IAsC/B,CAAC"}
1
+ {"version":3,"file":"download-build.d.ts","sourceRoot":"","sources":["../../src/tools/download-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE7E,eAAO,MAAM,iBAAiB,EAAE,IAkC/B,CAAC"}
@@ -14,7 +14,9 @@ have a build URL, you can try getting the environment details with the getEnviro
14
14
  Environment details will include the build URL.`,
15
15
  parameters: exports.downloadBuildToolSchema,
16
16
  },
17
- execute: async ({ input, repoPath, apiKey, }) => {
17
+ execute: async (params) => {
18
+ const { input } = params;
19
+ const { repoPath, apiKey } = params;
18
20
  if (!(await (0, test_build_1.hasDownloadScript)(repoPath))) {
19
21
  return {
20
22
  isError: true,
@@ -1 +1 @@
1
- {"version":3,"file":"environment-crud.d.ts","sourceRoot":"","sources":["../../src/tools/environment-crud.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA6DvD,eAAO,MAAM,kBAAkB,EAAE,IAiFhC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAAyB,CAAC"}
1
+ {"version":3,"file":"environment-crud.d.ts","sourceRoot":"","sources":["../../src/tools/environment-crud.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAEL,MAAM,4BAA4B,CAAC;AA6DpC,eAAO,MAAM,kBAAkB,EAAE,IAoFhC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,IAAI,EAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AA8HnE,eAAO,MAAM,QAAQ,EAAE,IAuBtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/grep/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,IAAI,EAGL,MAAM,4BAA4B,CAAC;AA8HpC,eAAO,MAAM,QAAQ,EAAE,IA2BtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"str_replace_editor.d.ts","sourceRoot":"","sources":["../../src/tools/str_replace_editor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAOnE,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA6UD;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,UAAU,CAAC,CA2CtB;AAsID,eAAO,MAAM,eAAe,EAAE,IAAI,EAKjC,CAAC"}
1
+ {"version":3,"file":"str_replace_editor.d.ts","sourceRoot":"","sources":["../../src/tools/str_replace_editor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAe,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAOhF,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA6UD;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,UAAU,CAAC,CA2CtB;AA8HD,eAAO,MAAM,eAAe,EAAE,IAAI,EAKjC,CAAC"}
@@ -340,7 +340,9 @@ File contents are returned with line numbers, starting from 1.
340
340
  path: zod_1.z.string().describe("The path to the file or directory to view."),
341
341
  }),
342
342
  },
343
- execute: async ({ input, repoPath, }) => {
343
+ execute: async (params) => {
344
+ const { input } = params;
345
+ const { repoPath } = params;
344
346
  return strReplaceEditorExecutor({
345
347
  input: {
346
348
  command: "view",
@@ -362,7 +364,9 @@ directories "tests", "tests/example", and "tests/example/foo.spec.ts".`,
362
364
  file_text: zod_1.z.string().describe("The contents of the new file."),
363
365
  }),
364
366
  },
365
- execute: async ({ input, repoPath, }) => {
367
+ execute: async (params) => {
368
+ const { input } = params;
369
+ const { repoPath } = params;
366
370
  return strReplaceEditorExecutor({
367
371
  input: {
368
372
  command: "create",
@@ -384,7 +388,9 @@ in the file. If old_str is not unique, the tool will return an error.`,
384
388
  new_str: zod_1.z.string().describe("The string to replace old_str with."),
385
389
  }),
386
390
  },
387
- execute: async ({ input, repoPath, }) => {
391
+ execute: async (params) => {
392
+ const { input } = params;
393
+ const { repoPath } = params;
388
394
  return strReplaceEditorExecutor({
389
395
  input: {
390
396
  command: "str_replace",
@@ -412,7 +418,9 @@ To insert a string at the end of the file, you should use insert_line = (total l
412
418
  new_str: zod_1.z.string().describe("The string to insert."),
413
419
  }),
414
420
  },
415
- execute: async ({ input, repoPath, }) => {
421
+ execute: async (params) => {
422
+ const { input } = params;
423
+ const { repoPath } = params;
416
424
  return strReplaceEditorExecutor({
417
425
  input: {
418
426
  command: "insert",
@@ -1 +1 @@
1
- {"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAmGpE,eAAO,MAAM,4BAA4B,EAAE,IAwI1C,CAAC"}
1
+ {"version":3,"file":"test-gen-browser.d.ts","sourceRoot":"","sources":["../../src/tools/test-gen-browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAmGpE,eAAO,MAAM,4BAA4B,EAAE,IA0I1C,CAAC"}
@@ -95,7 +95,7 @@ exports.generateTestWithBrowserAgent = {
95
95
  description: BROWSER_AGENT_DESCRIPTION,
96
96
  parameters: BrowserAgentSchema,
97
97
  },
98
- execute: async ({ input, repoPath, trace, collectArtifacts, }) => {
98
+ execute: async ({ input, repoPath, trace, collectArtifacts, environmentOverrides = {}, }) => {
99
99
  const { filePath, project } = input;
100
100
  const absoluteFilePath = path_1.default.join(repoPath, filePath);
101
101
  if (!fs_1.default.existsSync(absoluteFilePath)) {
@@ -152,7 +152,7 @@ exports.generateTestWithBrowserAgent = {
152
152
  catch (err) {
153
153
  console.warn("[generateTestWithBrowserAgent] Error preparing playwright for codegen", err);
154
154
  }
155
- let envOverrides = {};
155
+ let envOverrides = { ...environmentOverrides };
156
156
  if (input.buildUrl) {
157
157
  envOverrides = {
158
158
  ...envOverrides,
@@ -1 +1 @@
1
- {"version":3,"file":"test-run.d.ts","sourceRoot":"","sources":["../../src/tools/test-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AAsDnE,eAAO,MAAM,WAAW,EAAE,IAiFzB,CAAC"}
1
+ {"version":3,"file":"test-run.d.ts","sourceRoot":"","sources":["../../src/tools/test-run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,4BAA4B,CAAC;AAsDnE,eAAO,MAAM,WAAW,EAAE,IAoFzB,CAAC"}
@@ -45,14 +45,15 @@ exports.runTestTool = {
45
45
  description: "Run a test",
46
46
  parameters: RunTestSchema,
47
47
  },
48
- execute: async ({ input, repoPath, collectArtifacts, }) => {
48
+ execute: async ({ input, repoPath, collectArtifacts, environmentOverrides = {}, }) => {
49
49
  let reportUrl = undefined;
50
- let envOverrides = {};
50
+ let envOverrides = { ...environmentOverrides };
51
51
  if ((0, artifacts_1.isArtifactCollectionEnabled)()) {
52
52
  const projectName = "test-gen-chat-agent";
53
53
  const testRunId = Date.now().toString();
54
54
  reportUrl = buildReportUrl(projectName, testRunId);
55
55
  envOverrides = {
56
+ ...envOverrides,
56
57
  PROJECT_NAME: projectName,
57
58
  TEST_RUN_GITHUB_ACTION_ID: testRunId,
58
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.64.1",
3
+ "version": "0.64.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -64,7 +64,7 @@
64
64
  "zod": "^3.23.8",
65
65
  "@empiricalrun/llm": "^0.17.3",
66
66
  "@empiricalrun/r2-uploader": "^0.3.9",
67
- "@empiricalrun/test-run": "^0.10.0"
67
+ "@empiricalrun/test-run": "^0.10.1"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@playwright/test": "1.47.1",
@@ -79,7 +79,7 @@
79
79
  "playwright": "1.47.1",
80
80
  "serve-handler": "^6.1.6",
81
81
  "ts-patch": "^3.3.0",
82
- "@empiricalrun/shared-types": "0.4.1"
82
+ "@empiricalrun/shared-types": "0.4.2"
83
83
  },
84
84
  "scripts": {
85
85
  "dev": "tspc --build --watch",