@empiricalrun/test-gen 0.27.10 → 0.28.1

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,23 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.28.1
4
+
5
+ ### Patch Changes
6
+
7
+ - a6fe36d: fix: incomplete llm response at the time of fixing ts errors
8
+
9
+ ## 0.28.0
10
+
11
+ ### Minor Changes
12
+
13
+ - a3761d0: feat: support test block extraction via suites param
14
+ - 7ab94df: feat: add support for downloading latest build during test gen workflow
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [cc12707]
19
+ - @empiricalrun/reporter@0.18.2
20
+
3
21
  ## 0.27.10
4
22
 
5
23
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAWvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAK5C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,MAAM,CAKhD;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,UAIvD;AAmDD;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,aAAa,GACvB,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAyBD,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,iBAiBxD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,QA6BjD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAM1E;AAWD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,Y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ACT,eAAoB,EACpB,gBAAqB,EACrB,UAAyC,GAC1C,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,8EASA"}
@@ -52,10 +52,12 @@ async function prepareFileForUpdateScenario(genConfig) {
52
52
  testCode: codePrompt,
53
53
  pomCode: pomPrompt,
54
54
  testCase: testCase,
55
- options: genConfig.options,
56
55
  });
57
56
  const testFileContent = await fs_extra_1.default.readFile(specPath, "utf-8");
58
- const { testBlock, testNode } = (0, web_1.getTypescriptTestBlock)(name, testFileContent);
57
+ const { testBlock, testNode } = (0, web_1.getTypescriptTestBlock)({
58
+ scenarioName: name,
59
+ content: testFileContent,
60
+ });
59
61
  const parentDescribe = (0, web_1.findFirstSerialDescribeBlock)(testNode);
60
62
  // add test.only / describe.only to the spec file so that only that block is executed
61
63
  const updatedTestFileContent = newContentsWithTestOnly(testFileContent, testBlock, testBlock, parentDescribe?.getText() || "");
@@ -77,7 +79,10 @@ async function prepareFileForMasterAgent(genConfig) {
77
79
  await fs_extra_1.default.writeFile(specPath, fileContentWithImports, "utf-8");
78
80
  }
79
81
  const existingContents = await fs_extra_1.default.readFile(specPath, "utf-8");
80
- const { testBlock } = (0, web_1.getTypescriptTestBlock)(name, existingContents);
82
+ const { testBlock } = (0, web_1.getTypescriptTestBlock)({
83
+ scenarioName: name,
84
+ content: existingContents,
85
+ });
81
86
  if (!testBlock) {
82
87
  const newTestBlock = await (0, create_test_block_1.createEmptyTestCaseBlock)({
83
88
  testCase: genConfig.testCase,
@@ -1 +1 @@
1
- {"version":3,"file":"create-test-block.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/create-test-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,wBAAwB,CAAC,EAC7C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,+BAmDA"}
1
+ {"version":3,"file":"create-test-block.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/create-test-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,wBAAwB,CAAC,EAC7C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,+BAsDA"}
@@ -53,7 +53,10 @@ async function createEmptyTestCaseBlock({ testCase, file, options, trace, }) {
53
53
  });
54
54
  let response = firstShotMessage?.content || "";
55
55
  markdownRemoverSpan?.end({ output: { response } });
56
- const { testBlock } = (0, web_1.getTypescriptTestBlock)(testCase.name, response);
56
+ const { testBlock } = (0, web_1.getTypescriptTestBlock)({
57
+ scenarioName: testCase.name,
58
+ content: response,
59
+ });
57
60
  console.log(`trace: ${trace?.getTraceUrl()}`);
58
61
  return testBlock;
59
62
  }
@@ -1,13 +1,12 @@
1
1
  import { TraceClient } from "@empiricalrun/llm";
2
2
  import { CustomLogger } from "../../bin/logger";
3
- import { TestCase, TestGenConfigOptions } from "../../types";
4
- export declare function validateAndFixTypescriptErrors({ trace, logger, file, testCode, pomCode, testCase, options, }: {
3
+ import { TestCase } from "../../types";
4
+ export declare function validateAndFixTypescriptErrors({ trace, logger, file, testCode, pomCode, testCase, }: {
5
5
  trace?: TraceClient;
6
6
  logger?: CustomLogger;
7
7
  file: string;
8
8
  testCode: string;
9
9
  pomCode: string;
10
10
  testCase: TestCase;
11
- options?: TestGenConfigOptions;
12
11
  }): Promise<void>;
13
12
  //# sourceMappingURL=fix-ts-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fix-ts-errors.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/fix-ts-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAQhD,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,wBAAsB,8BAA8B,CAAC,EACnD,KAAK,EACL,MAA2B,EAC3B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,GACR,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,iBAoEA"}
1
+ {"version":3,"file":"fix-ts-errors.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/fix-ts-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAK3D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAsB,8BAA8B,CAAC,EACnD,KAAK,EACL,MAA2B,EAC3B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;CACpB,iBA8DA"}
@@ -5,11 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.validateAndFixTypescriptErrors = void 0;
7
7
  const llm_1 = require("@empiricalrun/llm");
8
+ const generative_ai_1 = require("@google/generative-ai");
8
9
  const fs_extra_1 = __importDefault(require("fs-extra"));
10
+ const remove_markdown_1 = __importDefault(require("remove-markdown"));
9
11
  const logger_1 = require("../../bin/logger");
10
12
  const web_1 = require("../../bin/utils/platform/web");
11
- const constants_1 = require("../../constants");
12
- async function validateAndFixTypescriptErrors({ trace, logger = new logger_1.CustomLogger(), file, testCode, pomCode, testCase, options, }) {
13
+ async function validateAndFixTypescriptErrors({ trace, logger = new logger_1.CustomLogger(), file, testCode, pomCode, testCase, }) {
13
14
  const validateTypesSpan = trace?.span({ name: "detect-type-errors-in-file" });
14
15
  logger.log("Validating types...");
15
16
  let errors = (0, web_1.validateTypescript)(file);
@@ -43,20 +44,15 @@ async function validateAndFixTypescriptErrors({ trace, logger = new logger_1.Cus
43
44
  scenaioName: testCase.name,
44
45
  });
45
46
  promptSpan?.end({ output: { instruction } });
46
- const llm = new llm_1.LLM({
47
- trace,
48
- provider: options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
49
- defaultModel: options?.model || constants_1.DEFAULT_MODEL,
50
- providerApiKey: constants_1.MODEL_API_KEYS[options?.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER],
51
- });
52
- const message = await llm.createChatCompletion({
53
- messages: instruction,
54
- modelParameters: {
55
- ...constants_1.DEFAULT_MODEL_PARAMETERS,
56
- ...options?.modelParameters,
57
- },
58
- });
59
- const response = message?.content || "";
47
+ const genAI = new generative_ai_1.GoogleGenerativeAI(process.env.GOOGLE_API_KEY);
48
+ const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest" });
49
+ const prompt = instruction.map((p) => p.content);
50
+ const llmOutputTrace = trace?.span({ name: "llm-output" });
51
+ const message = await model.generateContent(prompt);
52
+ llmOutputTrace?.end({ output: { message: message.response.text() } });
53
+ const removeMarkdownSpan = trace?.span({ name: "remove-markdown" });
54
+ let response = (0, remove_markdown_1.default)(message.response.text() || "");
55
+ removeMarkdownSpan?.end({ output: { response } });
60
56
  const readWriteFileSpan = trace?.span({ name: "write-to-file" });
61
57
  await fs_extra_1.default.writeFile(file, response, "utf-8");
62
58
  readWriteFileSpan?.end({ output: { response } });
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CA+FrB"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,QAAQ,EAAE,CAAC,CA8FrB"}
@@ -22,7 +22,10 @@ async function generateTest(testCase, file, options) {
22
22
  }
23
23
  const context = await (0, context_1.contextForGeneration)(file);
24
24
  const { codePrompt, pomPrompt, testFileContent } = context;
25
- const { testBlock } = (0, web_1.getTypescriptTestBlock)(testCase?.name, testFileContent);
25
+ const { testBlock } = (0, web_1.getTypescriptTestBlock)({
26
+ scenarioName: testCase?.name,
27
+ content: testFileContent,
28
+ });
26
29
  const isUpdate = !!testBlock;
27
30
  if (isUpdate) {
28
31
  return await (0, update_flow_1.updateTest)(testCase, file, options);
@@ -87,7 +90,6 @@ async function generateTest(testCase, file, options) {
87
90
  testCode: codePrompt,
88
91
  pomCode: pomPrompt,
89
92
  testCase: testCase,
90
- options,
91
93
  });
92
94
  trace.event({ name: "format-file" });
93
95
  await (0, web_1.formatCode)(file);
@@ -1 +1 @@
1
- {"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAmB3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA6GF,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,OAAO,GAAE,OAAc,EACvB,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CA6E5B;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAiE7B"}
1
+ {"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/update-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAmB3B,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAI7D,KAAK,eAAe,GAAG,QAAQ,GAAG;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA6GF,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,GAAG,SAAS,EACzC,OAAO,GAAE,OAAc,EACvB,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CA4E5B;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAoB,GACrB,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAgE7B"}
@@ -15,12 +15,15 @@ const constants_1 = require("../../constants");
15
15
  const session_1 = require("../../session");
16
16
  const fix_ts_errors_1 = require("./fix-ts-errors");
17
17
  const utils_1 = require("./utils");
18
- async function applyFileChanges({ validateTypes = true, trace, testCase, fileChanges, logger, testGenOptions, pomPrompt, codePrompt, }) {
18
+ async function applyFileChanges({ validateTypes = true, trace, testCase, fileChanges, logger, pomPrompt, codePrompt, }) {
19
19
  await Promise.allSettled(fileChanges.map(async (fileChange) => {
20
20
  if (!fileChange.filePath) {
21
21
  return;
22
22
  }
23
- const { testBlock: testBlockUpdate } = (0, web_1.getTypescriptTestBlock)(testCase?.name || "", fileChange.newCode || "");
23
+ const { testBlock: testBlockUpdate } = (0, web_1.getTypescriptTestBlock)({
24
+ scenarioName: testCase?.name || "",
25
+ content: fileChange.newCode || "",
26
+ });
24
27
  if (testBlockUpdate) {
25
28
  // assuming the test case getting updated
26
29
  // maintaining the previous accuracy of the test case update
@@ -28,7 +31,10 @@ async function applyFileChanges({ validateTypes = true, trace, testCase, fileCha
28
31
  let contents = await fs_extra_1.default.readFile(fileChange.filePath, "utf-8");
29
32
  const [prependContent, strippedContent] = await (0, web_1.stripAndPrependImports)(fileChange.newCode, testCase?.name);
30
33
  let updatedContent = prependContent + contents + `\n\n${strippedContent}`;
31
- const { testBlock } = (0, web_1.getTypescriptTestBlock)(testCase?.name, contents);
34
+ const { testBlock } = (0, web_1.getTypescriptTestBlock)({
35
+ scenarioName: testCase?.name,
36
+ content: contents,
37
+ });
32
38
  contents = contents.replace(testBlock, `\n\n${strippedContent}`);
33
39
  updatedContent = prependContent + contents;
34
40
  await fs_extra_1.default.writeFile(fileChange.filePath, updatedContent, "utf-8");
@@ -69,7 +75,6 @@ async function applyFileChanges({ validateTypes = true, trace, testCase, fileCha
69
75
  testCode: codePrompt,
70
76
  pomCode: pomPrompt,
71
77
  testCase: testCase,
72
- options: testGenOptions,
73
78
  });
74
79
  }
75
80
  trace.event({ name: "format-file" });
@@ -136,7 +141,6 @@ async function updateTest(testCase, file, options, logging = true, validate = tr
136
141
  testCase,
137
142
  fileChanges,
138
143
  logger,
139
- testGenOptions: options,
140
144
  pomPrompt: pomPrompt,
141
145
  codePrompt: codePrompt,
142
146
  });
@@ -201,7 +205,6 @@ async function appendCreateTestBlock({ testCase, file, options, trace, validateT
201
205
  testCase,
202
206
  fileChanges,
203
207
  logger,
204
- testGenOptions: options,
205
208
  pomPrompt: pomPrompt,
206
209
  codePrompt: codePrompt,
207
210
  validateTypes,
package/dist/bin/index.js CHANGED
@@ -12,6 +12,7 @@ const run_2 = require("../agent/codegen/run");
12
12
  const reporter_1 = require("../reporter");
13
13
  const ci_1 = require("../reporter/ci");
14
14
  const session_1 = require("../session");
15
+ const test_build_1 = require("../test-build");
15
16
  const logger_1 = require("./logger");
16
17
  const utils_2 = require("./utils");
17
18
  dotenv_1.default.config({
@@ -62,6 +63,8 @@ async function runAgent(testGenConfig) {
62
63
  generationId: testGenConfig.options?.metadata.generationId,
63
64
  });
64
65
  try {
66
+ // download the build if it exists
67
+ await (0, test_build_1.downloadBuild)(testGenConfig.build || {});
65
68
  await runAgent(testGenConfig);
66
69
  }
67
70
  catch (e) {
@@ -1,5 +1,5 @@
1
1
  import { TestGenConfig } from "../../types";
2
- export declare function parseCliArgs(scenarioOrScenariosPath?: string): Promise<{
2
+ export declare function parseCliArgs(testGenToken?: string): Promise<{
3
3
  testGenConfig: TestGenConfig;
4
4
  }>;
5
5
  export declare function getTestConfigCliArg(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,wBAAsB,YAAY,CAChC,uBAAuB,GAAE,MAA8B;;GAQxD;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,wBAAsB,YAAY,CAChC,YAAY,GAAE,MAA8B;;GAM7C;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTestConfigCliArg = exports.parseCliArgs = void 0;
4
4
  const scenarios_1 = require("./scenarios");
5
- async function parseCliArgs(scenarioOrScenariosPath = getTestConfigCliArg()) {
6
- const testGenConfig = await (0, scenarios_1.loadTestConfigs)(scenarioOrScenariosPath);
5
+ async function parseCliArgs(testGenToken = getTestConfigCliArg()) {
6
+ const testGenConfig = await (0, scenarios_1.loadTestConfigs)(testGenToken);
7
7
  return {
8
8
  testGenConfig,
9
9
  };
@@ -6,7 +6,11 @@ import { Node } from "ts-morph";
6
6
  * @param {string} content
7
7
  * @return { testBlock: string; parentDescribe: string; } testBlock - the test block content, testNode - the test function node
8
8
  */
9
- export declare function getTypescriptTestBlock(scenarioName: string, content: string): {
9
+ export declare function getTypescriptTestBlock({ scenarioName, suites, content, }: {
10
+ scenarioName: string;
11
+ suites?: string[];
12
+ content: string;
13
+ }): {
10
14
  testBlock: string | undefined;
11
15
  testNode: Node | undefined;
12
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/bin/utils/platform/web/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,IAAI,EAAuB,MAAM,UAAU,CAAC;AAGxE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GACd;IACD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;CAC5B,CAeA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,IAAI,GAAG,SAAS,CA4BlB;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CA8C7D;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,mCAUjB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAShD;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,iBAQhD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,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,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,UAE5E;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,iBAMpD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,UAcpD;AAED,wBAAsB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,+BAmBvE;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,UA0CtB"}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.replaceCreateTestWithNewCode = exports.getPageVariableNameFromCreateTest = exports.getFixtureImportPath = exports.removeTestOnly = exports.addNewImport = exports.formatCode = exports.lintErrors = exports.stripAndPrependImports = exports.validateTypescript = exports.appendToTestBlock = exports.findFirstSerialDescribeBlock = exports.getTypescriptTestBlock = void 0;
7
7
  const eslint_1 = require("eslint");
8
8
  const fs_extra_1 = __importDefault(require("fs-extra"));
9
+ const lodash_isequal_1 = __importDefault(require("lodash.isequal"));
9
10
  const prettier_1 = __importDefault(require("prettier"));
10
11
  const ts_morph_1 = require("ts-morph");
11
12
  const typescript_1 = __importDefault(require("typescript"));
@@ -16,18 +17,62 @@ const typescript_1 = __importDefault(require("typescript"));
16
17
  * @param {string} content
17
18
  * @return { testBlock: string; parentDescribe: string; } testBlock - the test block content, testNode - the test function node
18
19
  */
19
- function getTypescriptTestBlock(scenarioName, content) {
20
+ function getTypescriptTestBlock({ scenarioName, suites, content, }) {
20
21
  const project = new ts_morph_1.Project();
21
22
  const sourceFile = project.createSourceFile("test.ts", content);
22
- const testFunctionNode = sourceFile.getFirstDescendant((node) => !!(node.isKind(ts_morph_1.SyntaxKind.CallExpression) &&
23
- node.getExpression().getText() === "test" &&
24
- node.getArguments()[0]?.getText().includes(scenarioName)));
23
+ // Get all test function nodes that match the scenario name
24
+ const matchingTestFunctionNodes = sourceFile
25
+ .getDescendantsOfKind(ts_morph_1.SyntaxKind.CallExpression)
26
+ .filter((node) => {
27
+ return Boolean(node.getExpression().getText() === "test" &&
28
+ node.getArguments()[0]?.getText().includes(scenarioName));
29
+ });
30
+ if (!suites?.length) {
31
+ const firstNode = matchingTestFunctionNodes?.[0];
32
+ return {
33
+ testBlock: firstNode?.getText(),
34
+ testNode: firstNode,
35
+ };
36
+ }
37
+ // Iterate over each test function node and check if the suites match
38
+ for (const testNode of matchingTestFunctionNodes) {
39
+ const parentDescribes = getParentDescribeNames(testNode);
40
+ if ((0, lodash_isequal_1.default)(parentDescribes, suites)) {
41
+ // Found the matching test block
42
+ return {
43
+ testBlock: testNode.getText(),
44
+ testNode,
45
+ };
46
+ }
47
+ }
48
+ // No matching test block found
25
49
  return {
26
- testBlock: testFunctionNode?.getText(),
27
- testNode: testFunctionNode,
50
+ testBlock: undefined,
51
+ testNode: undefined,
28
52
  };
29
53
  }
30
54
  exports.getTypescriptTestBlock = getTypescriptTestBlock;
55
+ // get the names of parent describe blocks
56
+ function getParentDescribeNames(node) {
57
+ const names = [];
58
+ let current = node.getParent();
59
+ while (current) {
60
+ if (ts_morph_1.Node.isCallExpression(current)) {
61
+ const expr = current.getExpression();
62
+ if (expr.getText() === "test.describe") {
63
+ const describeBlockArguments = current.getArguments();
64
+ if (describeBlockArguments.length > 0) {
65
+ const describeBlockName = describeBlockArguments[0];
66
+ if (ts_morph_1.Node.isStringLiteral(describeBlockName)) {
67
+ names.push(describeBlockName.getLiteralText());
68
+ }
69
+ }
70
+ }
71
+ }
72
+ current = current.getParent();
73
+ }
74
+ return names.reverse(); // Reverse to get from outermost to innermost
75
+ }
31
76
  /**
32
77
  * Function to find the first 'describe' block configured with 'serial: true'
33
78
  *
@@ -124,7 +169,10 @@ exports.validateTypescript = validateTypescript;
124
169
  async function stripAndPrependImports(content, testName) {
125
170
  const importRegexp = /import\s+\{[^}]*\}\s+from\s+["'][^"']+["'];?/g;
126
171
  const imports = content.match(importRegexp);
127
- const { testBlock: strippedContent } = getTypescriptTestBlock(testName, content);
172
+ const { testBlock: strippedContent } = getTypescriptTestBlock({
173
+ scenarioName: testName,
174
+ content,
175
+ });
128
176
  const prependContent = (imports?.join("\n") || "") + "\n\n";
129
177
  return [prependContent, strippedContent];
130
178
  }
@@ -1,4 +1,4 @@
1
1
  import { TestGenConfig } from "../../../types";
2
- declare function loadTestConfigs(scenariosPath: string): Promise<TestGenConfig>;
2
+ declare function loadTestConfigs(testGenToken: string): Promise<TestGenConfig>;
3
3
  export { loadTestConfigs };
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/utils/scenarios/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AASrE,iBAAe,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAc5E;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/utils/scenarios/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AAU5E,iBAAe,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAc3E;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadTestConfigs = void 0;
4
- async function loadTestConfigs(scenariosPath) {
5
- // scenariosPath is the testGenToken passed from ci
6
- const str = decodeURIComponent(atob(scenariosPath));
4
+ async function loadTestConfigs(testGenToken) {
5
+ const str = decodeURIComponent(atob(testGenToken));
7
6
  const config = JSON.parse(str);
8
7
  const specPath = `./tests/${config.group || "index"}.spec.ts`;
9
8
  return {
@@ -13,6 +12,7 @@ async function loadTestConfigs(scenariosPath) {
13
12
  steps: config.steps.filter((s) => !!s),
14
13
  group: config.group,
15
14
  },
15
+ build: config.build,
16
16
  options: config.options,
17
17
  };
18
18
  }
@@ -0,0 +1,10 @@
1
+ import { Build } from "../types";
2
+ /**
3
+ * method to download the build from the URL provided in the build object
4
+ * this is only used in cases like chrome extension as of yet.
5
+ * @export
6
+ * @param {Build} build
7
+ * @return {*} {Promise<void>}
8
+ */
9
+ export declare function downloadBuild(build: Build): Promise<void>;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-build/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOjC;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAY/D"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.downloadBuild = void 0;
7
+ const fs_extra_1 = __importDefault(require("fs-extra"));
8
+ const logger_1 = require("../bin/logger");
9
+ const exec_1 = require("../utils/exec");
10
+ /**
11
+ * method to download the build from the URL provided in the build object
12
+ * this is only used in cases like chrome extension as of yet.
13
+ * @export
14
+ * @param {Build} build
15
+ * @return {*} {Promise<void>}
16
+ */
17
+ async function downloadBuild(build) {
18
+ const logger = new logger_1.CustomLogger({ useReporter: false });
19
+ const packageJSONPath = "package.json";
20
+ const packageJsonStr = await fs_extra_1.default.readFile(packageJSONPath, "utf-8");
21
+ const packageJSONData = JSON.parse(packageJsonStr);
22
+ const buildDownloadScript = packageJSONData.scripts["download"];
23
+ if (buildDownloadScript && build?.url) {
24
+ logger.log(`Downloading build from ${build.url}`);
25
+ await (0, exec_1.cmd)(`npm run download ${build.url}`.split(" "), {
26
+ env: { ...Object(process.env) },
27
+ });
28
+ }
29
+ }
30
+ exports.downloadBuild = downloadBuild;
@@ -19,9 +19,13 @@ export type TestGenConfigOptions = {
19
19
  environment: "development" | "production";
20
20
  };
21
21
  };
22
+ export type Build = {
23
+ url?: string;
24
+ };
22
25
  export type TestGenConfig = {
23
26
  specPath: string;
24
27
  testCase: TestCase;
28
+ build?: Build;
25
29
  options?: TestGenConfigOptions;
26
30
  };
27
31
  export type TestCase = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,WAAW,CAAC;IAC3B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,aAAa,GAAG,YAAY,CAAC;KAC3C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,QAA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,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CAC/E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.27.10",
3
+ "version": "0.28.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,6 +18,7 @@
18
18
  "@actions/core": "^1.10.1",
19
19
  "@aws-sdk/client-s3": "^3.614.0",
20
20
  "@aws-sdk/s3-request-presigner": "^3.614.0",
21
+ "@google/generative-ai": "^0.15.0",
21
22
  "@playwright/test": "^1.44.1",
22
23
  "@types/sanitize-html": "^2.11.0",
23
24
  "commander": "^12.1.0",
@@ -29,6 +30,7 @@
29
30
  "google-auth-library": "^9.10.0",
30
31
  "google-spreadsheet": "^4.1.2",
31
32
  "ignore": "^5.3.1",
33
+ "lodash.isequal": "^4.5.0",
32
34
  "md5": "^2.3.0",
33
35
  "mime": "^4.0.4",
34
36
  "minimatch": "^10.0.1",
@@ -44,12 +46,13 @@
44
46
  "typescript": "^5.3.3",
45
47
  "@empiricalrun/llm": "^0.9.2",
46
48
  "@empiricalrun/r2-uploader": "^0.3.0",
47
- "@empiricalrun/reporter": "^0.18.1"
49
+ "@empiricalrun/reporter": "^0.18.2"
48
50
  },
49
51
  "devDependencies": {
50
52
  "@types/detect-port": "^1.3.5",
51
53
  "@types/express": "^4.17.21",
52
54
  "@types/fs-extra": "^11.0.4",
55
+ "@types/lodash.isequal": "^4.5.8",
53
56
  "@types/md5": "^2.3.5"
54
57
  },
55
58
  "scripts": {
@@ -58,6 +61,7 @@
58
61
  "clean": "tsc --build --clean",
59
62
  "lint": "eslint .",
60
63
  "test": "vitest run",
61
- "test:watch": "vitest"
64
+ "test:watch": "vitest",
65
+ "test:watch-files": "vitest $0 --watch"
62
66
  }
63
67
  }