@empiricalrun/test-gen 0.41.1 → 0.41.4

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,27 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.41.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 399f968: test: fix eslint mock test output
8
+ - 4c35992: fix: import statements with alias were getting removed from file
9
+
10
+ ## 0.41.3
11
+
12
+ ### Patch Changes
13
+
14
+ - 1d39892: fix: repo edit exception
15
+
16
+ ## 0.41.2
17
+
18
+ ### Patch Changes
19
+
20
+ - 8d6f8be: fix: enable type check in repo agent
21
+ - 6573a58: fix: move generate requested change method to test-gen package
22
+ - 54e7e03: fix: avoid uploading screenshots if reporter config is not set
23
+ - 3eff6a8: fix: updated prompt for create test
24
+
3
25
  ## 0.41.1
4
26
 
5
27
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"repo-edit.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/repo-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAexE,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,MAAM,EAAE,MAAM,GAAG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AE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC;IACV,MAAM,EAAE,0BAA0B,EAAE,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;KAC5B,EAAE,CAAC;CACL,CAAC,CAmED"}
@@ -1,35 +1,11 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
6
  exports.repoEditAgent = exports.generateCodeUsingRepoAgent = void 0;
30
7
  const llm_1 = require("@empiricalrun/llm");
31
- const fsSync = __importStar(require("fs"));
32
- const promises_1 = __importDefault(require("fs/promises"));
8
+ const fs_extra_1 = __importDefault(require("fs-extra"));
33
9
  const path_1 = require("path");
34
10
  const context_1 = require("../../bin/utils/context");
35
11
  const web_1 = require("../../bin/utils/platform/web");
@@ -159,7 +135,7 @@ async function repoEditAgent({ trace, task, }) {
159
135
  const fileUpdateResponses = await (0, utils_1.applyFileChanges)({
160
136
  trace,
161
137
  testCase: {},
162
- fileChanges: updates.filter((f) => f.filePath && fsSync.existsSync(f.filePath)),
138
+ fileChanges: updates.filter((f) => f.filePath && fs_extra_1.default.existsSync(f.filePath)),
163
139
  });
164
140
  const errorResponses = fileUpdateResponses.filter((f) => f?.error);
165
141
  if (errorResponses.length > 0) {
@@ -178,23 +154,22 @@ async function repoEditAgent({ trace, task, }) {
178
154
  fileChanges: updatedFileChanges,
179
155
  });
180
156
  }
181
- await (0, utils_1.validateTypesAndFormatCode)({
182
- validateTypes: false,
183
- trace,
184
- testCase: {},
185
- fileChanges: updates.filter((f) => f.filePath && fsSync.existsSync(f.filePath)),
186
- });
187
- const newFileUpdates = updates.filter((f) => !fsSync.existsSync(f.filePath));
157
+ const newFileUpdates = updates.filter((f) => !fs_extra_1.default.existsSync(f.filePath));
188
158
  await Promise.all(newFileUpdates.map((f) => {
189
159
  return (async () => {
190
- await promises_1.default.mkdir((0, path_1.dirname)(f.filePath), { recursive: true });
191
- await promises_1.default.writeFile(f.filePath, f.newCode, "utf-8");
160
+ await fs_extra_1.default.mkdir((0, path_1.dirname)(f.filePath), { recursive: true });
161
+ await fs_extra_1.default.writeFile(f.filePath, f.newCode, "utf-8");
192
162
  })();
193
163
  }));
164
+ await (0, utils_1.validateTypesAndFormatCode)({
165
+ validateTypes: true,
166
+ trace,
167
+ testCase: {},
168
+ fileChanges: updates,
169
+ });
194
170
  await Promise.all(updates.map((f) => {
195
171
  return (async () => {
196
- if (fsSync.existsSync(f.filePath)) {
197
- await (0, web_1.formatCode)(f.filePath);
172
+ if (fs_extra_1.default.existsSync(f.filePath)) {
198
173
  await (0, web_1.lintErrors)(f.filePath);
199
174
  }
200
175
  })();
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,EAC7B,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAsC5B"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhE,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAK7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,EAC7B,KAAK,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAkC5B"}
@@ -11,6 +11,7 @@ const context_1 = require("../../bin/utils/context");
11
11
  const web_1 = require("../../bin/utils/platform/web");
12
12
  const repo_edit_1 = require("./repo-edit");
13
13
  const update_flow_1 = require("./update-flow");
14
+ const utils_1 = require("./utils");
14
15
  async function generateTest(testCase, file, options, trace) {
15
16
  const logger = new logger_1.CustomLogger();
16
17
  if (!fs_extra_1.default.existsSync(file)) {
@@ -37,14 +38,10 @@ async function generateTest(testCase, file, options, trace) {
37
38
  testFilePath: file,
38
39
  },
39
40
  });
40
- const task = `
41
- Create a new test at the given test file path and perform the relevant changes required:\n
42
- Scenario name: ${testCase.name}
43
- Test file path: ${file}
44
- Test suite: ${testCase.suites?.join("->") || "-"}
45
- Scenario: ${testCase.steps.join("\n")}
46
- `;
47
- const repoAgentResponse = await (0, repo_edit_1.repoEditAgent)({ trace, task });
41
+ const repoAgentResponse = await (0, repo_edit_1.repoEditAgent)({
42
+ trace,
43
+ task: (0, utils_1.getTaskForCreateTest)({ testCase, file }),
44
+ });
48
45
  createTestSpan?.end({ output: repoAgentResponse.fileChanges });
49
46
  await (0, llm_1.flushAllTraces)();
50
47
  }
@@ -84,4 +84,8 @@ export declare function validateTypesAndFormatCode({ validateTypes, trace, testC
84
84
  pomPrompt?: string;
85
85
  nonSpecFilePrompt?: string;
86
86
  }): Promise<void>;
87
+ export declare function getTaskForCreateTest({ testCase, file, }: {
88
+ testCase: TestCase;
89
+ file: string;
90
+ }): string;
87
91
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMhD,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG7D;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG;IACjD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,EAAE,CAiBF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,SA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ACR,WAAW,EACX,MAAM,EACN,cAAc,EACd,SAAS,EACT,iBAAiB,GAClB,EAAE;IACD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE;QACX,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;KAC5B,EAAE,CAAC;IACJ,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,iBA6BA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,IAAI,GACL,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,UAaA"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateTypesAndFormatCode = exports.applyFileChanges = exports.extractTestStepsSuggestions = exports.extractAppendTestUpdates = exports.extractTestUpdates = void 0;
6
+ exports.getTaskForCreateTest = exports.validateTypesAndFormatCode = exports.applyFileChanges = exports.extractTestStepsSuggestions = exports.extractAppendTestUpdates = exports.extractTestUpdates = void 0;
7
7
  const llm_1 = require("@empiricalrun/llm");
8
8
  const fs_extra_1 = __importDefault(require("fs-extra"));
9
9
  const ts_morph_1 = require("ts-morph");
@@ -229,3 +229,16 @@ async function validateTypesAndFormatCode({ validateTypes = true, trace, testCas
229
229
  await (0, llm_1.flushAllTraces)();
230
230
  }
231
231
  exports.validateTypesAndFormatCode = validateTypesAndFormatCode;
232
+ function getTaskForCreateTest({ testCase, file, }) {
233
+ return `
234
+ Create a new test case with name '${testCase.name}' at file path '${file}'
235
+ ${testCase.suites.length
236
+ ? `
237
+ Put this test case inside describe blocks named: ${testCase.suites.join(" > ")}`
238
+ : ""}
239
+
240
+ In the above test, write code that performs these actions and ONLY these actions:
241
+ ${testCase.steps.join("\n")}
242
+ `;
243
+ }
244
+ exports.getTaskForCreateTest = getTaskForCreateTest;
@@ -0,0 +1,14 @@
1
+ import { TraceClient } from "@empiricalrun/llm";
2
+ type ArgsT = {
3
+ testBlock: string;
4
+ testFilePath: string;
5
+ suggestionForFix: string;
6
+ trace?: TraceClient;
7
+ };
8
+ export declare const enrichPromptWithFailingLine: ({ trace, testBlock, testFilePath, suggestionForFix, }: ArgsT) => Promise<{
9
+ output: string;
10
+ is_user_message_enriched: boolean;
11
+ reason_for_output: string;
12
+ }>;
13
+ export {};
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/enrich-prompt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKhE,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAgCF,eAAO,MAAM,2BAA2B,0DAKrC,KAAK;YACE,MAAM;8BACY,OAAO;uBACd,MAAM;EA+D1B,CAAC"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.enrichPromptWithFailingLine = void 0;
4
+ const llm_1 = require("@empiricalrun/llm");
5
+ const constants_1 = require("../../constants");
6
+ const utils_1 = require("./utils");
7
+ const promptName = "generate-self-heal-requested-change";
8
+ const responseFormat = {
9
+ type: "json_schema",
10
+ json_schema: {
11
+ name: "analyze_user_message_and_conditionally_enrich_it",
12
+ strict: true,
13
+ schema: {
14
+ type: "object",
15
+ properties: {
16
+ reason_for_output: {
17
+ type: "string",
18
+ description: "provide reason in both cases whether the user message was enriched or not",
19
+ },
20
+ is_user_message_enriched: {
21
+ type: "boolean",
22
+ description: "whether the user message should be enriched or not",
23
+ },
24
+ output: {
25
+ type: "string",
26
+ description: "This is the final output after analyzing the user message, and optionally enriching it.",
27
+ },
28
+ },
29
+ required: ["is_user_message_enriched", "output", "reason_for_output"],
30
+ additionalProperties: false,
31
+ },
32
+ },
33
+ };
34
+ // TODO: fix the format
35
+ const enrichPromptWithFailingLine = async ({ trace, testBlock, testFilePath, suggestionForFix, }) => {
36
+ let output = {
37
+ output: suggestionForFix,
38
+ is_user_message_enriched: false,
39
+ reason_for_output: "",
40
+ };
41
+ try {
42
+ const instructions = await (0, llm_1.getPrompt)(promptName, {
43
+ testBlock,
44
+ testFilePath,
45
+ userMessage: suggestionForFix,
46
+ }, 26);
47
+ trace?.event({
48
+ name: "get prompt",
49
+ input: {
50
+ promptName,
51
+ testBlock,
52
+ testFilePath,
53
+ userMessage: suggestionForFix,
54
+ },
55
+ output: { instructions },
56
+ });
57
+ const llm = new llm_1.LLM({
58
+ trace,
59
+ providerApiKey: constants_1.MODEL_API_KEYS["anthropic"],
60
+ provider: "anthropic",
61
+ defaultModel: "claude-3-5-sonnet-latest",
62
+ });
63
+ const llmResponse = await llm.createChatCompletion({
64
+ messages: instructions,
65
+ trace,
66
+ modelParameters: {
67
+ temperature: 0.5,
68
+ },
69
+ responseFormat,
70
+ });
71
+ const generateRequestedChangeResponse = (0, utils_1.extractGenerateRequestedChange)(llmResponse?.content);
72
+ output = {
73
+ output: generateRequestedChangeResponse.output,
74
+ is_user_message_enriched: generateRequestedChangeResponse.is_user_message_enriched,
75
+ reason_for_output: generateRequestedChangeResponse.reason_for_output,
76
+ };
77
+ }
78
+ catch (e) {
79
+ console.error(`Failed to generate requested change for test - "${testBlock}", suggestion - "${suggestionForFix}"`, e);
80
+ }
81
+ return output;
82
+ };
83
+ exports.enrichPromptWithFailingLine = enrichPromptWithFailingLine;
@@ -0,0 +1,6 @@
1
+ export declare function extractGenerateRequestedChange(input: string): {
2
+ reason_for_output: string;
3
+ is_user_message_enriched: boolean;
4
+ output: string;
5
+ };
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/enrich-prompt/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,EAAE,OAAO,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB,CAQA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractGenerateRequestedChange = void 0;
4
+ function extractGenerateRequestedChange(input) {
5
+ const regex = /<reason_for_output>([\s\S]*?)<\/reason_for_output>[\s\S]*?<is_user_message_enriched>([\s\S]*?)<\/is_user_message_enriched>[\s\S]*?<output>([\s\S]*?)<\/output>/g;
6
+ const match = regex.exec(input);
7
+ const reason_for_output = match[1]?.trim() || "";
8
+ const is_user_message_enriched = match[2]?.trim() === "true";
9
+ const output = match[3]?.trim() || "";
10
+ return { reason_for_output, is_user_message_enriched, output };
11
+ }
12
+ exports.extractGenerateRequestedChange = extractGenerateRequestedChange;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,OAAO,EAGL,IAAI,EAEJ,UAAU,EAEX,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,eAAO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AM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,UAoCtB;AAED,eAAO,MAAM,6BAA6B;qBAKvB,MAAM;iBACV,MAAM;YACX,MAAM,EAAE;YA2DjB,CAAC;AAEF,eAAO,MAAM,iCAAiC,cACjC,MAAM,EAAE,gBACL,MAAM,sBAyBrB,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,EAC1C,YAAY,EACZ,QAAQ,EACR,MAAM,GACP,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,iBA8CA;AAED,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EAAE,iBAsBzB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,WAYA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,UAOA;AAED,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CA4B5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQnD"}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.isSyntaxValid = exports.getVariableDeclarationsFromCode = exports.buildTestNamePrompt = exports.isTestPresent = exports.appendScopeToCreateTest = exports.addUserContextFixture = exports.importAllExportsStmtFromFilePaths = exports.injectCodeSnippetBySuiteChain = exports.replaceCreateTestWithNewCode = exports.getPageVariableNameFromCreateTest = exports.getFixtureImportPath = exports.removeTestOnly = exports.addNewImport = exports.formatCode = exports.lintErrors = exports.stripAndPrependImports = exports.validateTypescript = exports.appendToTestBlock = exports.findFirstSerialDescribeBlock = exports.hasTopLevelDescribeConfigureWithSerialMode = exports.getTypescriptTestBlock = exports.getTestModuleAliasFromSourceFile = void 0;
7
7
  const parser_1 = require("@babel/parser");
8
8
  const eslint_1 = require("eslint");
9
- const fs_1 = require("fs");
10
9
  const fs_extra_1 = __importDefault(require("fs-extra"));
11
10
  const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
12
11
  const path_1 = __importDefault(require("path"));
@@ -177,7 +176,7 @@ exports.appendToTestBlock = appendToTestBlock;
177
176
  function validateTypescript(filePath) {
178
177
  // Create a compiler host to read files
179
178
  const compilerHost = typescript_1.default.createCompilerHost({});
180
- compilerHost.readFile = (file) => (0, fs_1.readFileSync)(file, "utf8");
179
+ compilerHost.readFile = (file) => fs_extra_1.default.readFileSync(file, "utf8");
181
180
  // Create a program with a single source file
182
181
  const program = typescript_1.default.createProgram([filePath], {
183
182
  esModuleInterop: true,
@@ -301,6 +300,34 @@ async function getPageVariableNameFromCreateTest(filePath) {
301
300
  return pageVariableName?.split(" ")[0];
302
301
  }
303
302
  exports.getPageVariableNameFromCreateTest = getPageVariableNameFromCreateTest;
303
+ function resolveImportsFromFixtures({ fixtureImportNode, testAlias, filePath, updatedTestFile, }) {
304
+ const imports = {};
305
+ const importClause = fixtureImportNode.getImportClause();
306
+ if (!importClause) {
307
+ return updatedTestFile;
308
+ }
309
+ const namedImports = importClause.getNamedImports().map((imp) => {
310
+ // aliasNode is truthy if the import is aliased (e.g. import { test as setup } ...)
311
+ const aliasNode = imp.getAliasNode();
312
+ const originalImportName = imp.getName();
313
+ const aliasImportName = aliasNode?.getText();
314
+ const importName = aliasImportName || originalImportName;
315
+ imports[originalImportName] = imp.getText();
316
+ return importName;
317
+ });
318
+ const isComplete = namedImports.includes(testAlias) && namedImports.includes("expect");
319
+ if (!isComplete) {
320
+ if (!Object.keys(imports).includes("test")) {
321
+ imports["test"] = "test";
322
+ }
323
+ if (!Object.keys(imports).includes("expect")) {
324
+ imports["expect"] = "expect";
325
+ }
326
+ const expectedImports = `import { ${Object.values(imports).join(", ")} } from "${getFixtureImportPath(filePath)}";`;
327
+ updatedTestFile = updatedTestFile.replace(fixtureImportNode.getText(), expectedImports);
328
+ }
329
+ return updatedTestFile;
330
+ }
304
331
  function replaceCreateTestWithNewCode(filePath, contents, generatedCode) {
305
332
  const project = new ts_morph_1.Project();
306
333
  const sourceFile = project.createSourceFile("test.ts", contents);
@@ -317,17 +344,12 @@ function replaceCreateTestWithNewCode(filePath, contents, generatedCode) {
317
344
  const fixtureImportNode = sourceFile.getFirstDescendant((node) => !!(node.isKind(ts_morph_1.SyntaxKind.ImportDeclaration) &&
318
345
  node.getText().includes("fixtures")));
319
346
  if (fixtureImportNode) {
320
- const importClause = fixtureImportNode.getImportClause();
321
- const namedImports = importClause.getNamedImports().map((imp) => {
322
- // aliasNode is truthy if the import is aliased (e.g. import { test as setup } ...)
323
- const aliasNode = imp.getAliasNode();
324
- return aliasNode?.getText() || imp.getName();
347
+ updatedTestFile = resolveImportsFromFixtures({
348
+ fixtureImportNode,
349
+ testAlias,
350
+ filePath,
351
+ updatedTestFile,
325
352
  });
326
- const isComplete = namedImports.includes(testAlias) && namedImports.includes("expect");
327
- if (!isComplete) {
328
- const expectedImports = `import { test, expect } from "${getFixtureImportPath(filePath)}";`;
329
- updatedTestFile = updatedTestFile.replace(fixtureImportNode.getText(), expectedImports);
330
- }
331
353
  }
332
354
  return updatedTestFile;
333
355
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add-scenario-agent.evals.d.ts","sourceRoot":"","sources":["../../src/evals/add-scenario-agent.evals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA+BpC,QAAA,MAAM,4BAA4B,EAAE,UA6BnC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
1
+ {"version":3,"file":"add-scenario-agent.evals.d.ts","sourceRoot":"","sources":["../../src/evals/add-scenario-agent.evals.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAqCpC,QAAA,MAAM,4BAA4B,EAAE,UAqBnC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -1,10 +1,19 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
3
7
  const repo_edit_1 = require("../agent/codegen/repo-edit");
8
+ const utils_1 = require("../agent/codegen/utils");
4
9
  function evaluateEqualityScore({ currentOutput, expectedOutput, }) {
5
10
  for (const expectedFile of expectedOutput) {
6
11
  if (!currentOutput.find((output) => {
7
- return output.filePath === expectedFile.filePath;
12
+ if (output.filePath && expectedFile.filePath) {
13
+ return (path_1.default.basename(output.filePath) ===
14
+ path_1.default.basename(expectedFile.filePath));
15
+ }
16
+ return false;
8
17
  })) {
9
18
  return 0;
10
19
  }
@@ -13,16 +22,9 @@ function evaluateEqualityScore({ currentOutput, expectedOutput, }) {
13
22
  }
14
23
  const addScenarioCodeAgentEvaluate = async ({ item, trace }) => {
15
24
  const { testCase, testFilePath, pageFiles, testFiles } = item.input;
16
- const task = `
17
- Create a new test at the given test file path and perform the relevant changes required:\n
18
- Scenario name: ${testCase.name}
19
- Test file path: ${testFilePath}
20
- Test suite: ${testCase.suites?.join("->") || "-"}
21
- Scenario: ${testCase.steps.join("\n")}
22
- `;
23
25
  const repoFiles = pageFiles + testFiles;
24
26
  const repoAgentOutput = await (0, repo_edit_1.generateCodeUsingRepoAgent)({
25
- task,
27
+ task: (0, utils_1.getTaskForCreateTest)({ testCase, file: testFilePath }),
26
28
  trace,
27
29
  repoFiles,
28
30
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporter/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,QAAQ,EAA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AM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1C,eAAe,CAAC,EACpB,eAAe,EACf,QAAQ,GACT,EAAE;QACD,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;KAClB;IAgDK,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+C9C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY3C,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1C,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAWxD"}
@@ -95,6 +95,10 @@ class TestGenUpdatesReporter {
95
95
  logger.log("Skipped uploading current view screenshot");
96
96
  return;
97
97
  }
98
+ if (!reporterConfig) {
99
+ logger.log("Reporter config is not set skipping screenshot uploads.");
100
+ return;
101
+ }
98
102
  try {
99
103
  // upload current screenshot to r2 and report it to reporter
100
104
  if (!fs_extra_1.default.existsSync(path_1.default.join(process.cwd(), "gen-assets"))) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.41.1",
3
+ "version": "0.41.4",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -22,6 +22,10 @@
22
22
  "types": "./dist/agent/master/planner.d.ts",
23
23
  "default": "./dist/agent/master/planner.js"
24
24
  },
25
+ "./agent/enrich-prompt": {
26
+ "types": "./dist/agent/enrich-prompt/index.d.ts",
27
+ "default": "./dist/agent/enrich-prompt/index.js"
28
+ },
25
29
  "./types": {
26
30
  "types": "./dist/types/index.d.ts",
27
31
  "default": "./dist/types/index.js"