@empiricalrun/test-gen 0.32.8 → 0.33.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,22 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.33.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 48e5628: fix: skip teardown files during test-gen
8
+
9
+ ## 0.33.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 61aa7b7: feat: collect and update generation table with updates
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [61aa7b7]
18
+ - @empiricalrun/reporter@0.21.0
19
+
3
20
  ## 0.32.8
4
21
 
5
22
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/run.ts"],"names":[],"mappings":"AAkBA,KAAK,iBAAiB,GAAG;IACvB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GACjB,EAAE,iBAAiB,iBAmEnB"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/browsing/run.ts"],"names":[],"mappings":"AAmBA,KAAK,iBAAiB,GAAG;IACvB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CAAC,EAClD,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GACjB,EAAE,iBAAiB,iBAyEnB"}
@@ -38,6 +38,9 @@ async function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, p
38
38
  const pageVar = await (0, web_1.getPageVariableNameFromCreateTest)(testFilePath);
39
39
  console.log(`Detected playwright project name: ${project}`);
40
40
  // run playwright test which will internally run the master agent
41
+ const testsDirectory = `${process.cwd()}/tests`;
42
+ const teardowns = new utils_2.TeardownManager(testsDirectory);
43
+ await teardowns.skipAll();
41
44
  let command = `npx playwright test ${testFilePath} --retries 0 --project ${project} --timeout 0`;
42
45
  if (!process.env.CI) {
43
46
  command = command.concat(` --headed`);
@@ -59,6 +62,7 @@ async function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, p
59
62
  console.error(error);
60
63
  isError = true;
61
64
  }
65
+ teardowns.unskipAll();
62
66
  // clean up the file if there is any error
63
67
  if (isError) {
64
68
  try {
@@ -35,4 +35,13 @@ export declare function getPromptForNextAction({ pageSnapshot, task, previousAct
35
35
  lastActionErrors: string[];
36
36
  promptType?: string;
37
37
  }): Promise<import("openai/resources/index.mjs").ChatCompletionMessageParam[]>;
38
+ export declare class TeardownManager {
39
+ private directory;
40
+ constructor(directory: string);
41
+ private teardownFiles;
42
+ private getAllTeardownFiles;
43
+ private skipTeardownFile;
44
+ skipAll(): Promise<void>;
45
+ unskipAll(): void;
46
+ }
38
47
  //# sourceMappingURL=utils.d.ts.map
@@ -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;AAcvD,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;AA4ED;;;;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,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,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,oBAAoB,EACtC,gBAAgB,GAAE,MAAM,EAAU,GACjC,OAAO,CAAC,MAAM,CAAC,CA+CjB;AAED,wBAAsB,sBAAsB,CAAC,EAC3C,YAAiB,EACjB,IAAS,EACT,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;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,MAAM;IACrC,OAAO,CAAC,aAAa,CAAqB;YAE5B,mBAAmB;YAUnB,gBAAgB;IAsBjB,OAAO;IAuBb,SAAS;CAKjB"}
@@ -3,15 +3,18 @@ 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.getPromptForNextAction = exports.detectProjectName = exports.readPlaywrightConfig = exports.canRunMasterAgent = exports.injectPwLocatorGenerator = exports.prepareFileForMasterAgent = exports.prepareBrowsingAgentTask = exports.isRegExp = void 0;
6
+ exports.TeardownManager = exports.getPromptForNextAction = exports.detectProjectName = exports.readPlaywrightConfig = exports.canRunMasterAgent = exports.injectPwLocatorGenerator = exports.prepareFileForMasterAgent = exports.prepareBrowsingAgentTask = exports.isRegExp = void 0;
7
7
  const llm_1 = require("@empiricalrun/llm");
8
8
  const child_process_1 = require("child_process");
9
9
  const fs_extra_1 = __importDefault(require("fs-extra"));
10
10
  const minimatch_1 = require("minimatch");
11
+ const ts_morph_1 = require("ts-morph");
11
12
  const api_1 = __importDefault(require("tsx/cjs/api"));
12
13
  const logger_1 = require("../../bin/logger");
13
14
  const context_1 = require("../../bin/utils/context");
15
+ const fs_1 = require("../../bin/utils/fs");
14
16
  const web_1 = require("../../bin/utils/platform/web");
17
+ const reporter_1 = require("../../reporter");
15
18
  const create_test_block_1 = require("../codegen/create-test-block");
16
19
  const fix_ts_errors_1 = require("../codegen/fix-ts-errors");
17
20
  const update_flow_1 = require("../codegen/update-flow");
@@ -92,6 +95,9 @@ async function prepareFileForMasterAgent(genConfig) {
92
95
  name: "prepare-file-for-master-agent",
93
96
  });
94
97
  new logger_1.CustomLogger({ useReporter: true }).log(`Preparing file for master agent. [view trace](${trace.getTraceUrl()})`);
98
+ if (trace.getTraceUrl()) {
99
+ await new reporter_1.TestGenUpdatesReporter().sendAgentTraceUrl(trace.getTraceUrl());
100
+ }
95
101
  const { specPath, testCase } = genConfig;
96
102
  const { name, suites } = testCase;
97
103
  // check if the spec file exists
@@ -267,3 +273,56 @@ async function getPromptForNextAction({ pageSnapshot = "", task = "", previousAc
267
273
  return prompt;
268
274
  }
269
275
  exports.getPromptForNextAction = getPromptForNextAction;
276
+ class TeardownManager {
277
+ directory;
278
+ constructor(directory) {
279
+ this.directory = directory;
280
+ }
281
+ teardownFiles = [];
282
+ async getAllTeardownFiles() {
283
+ const teardownFileRegex = /.*\.teardown\.ts/;
284
+ const teardownFiles = await (0, fs_1.readFilesInDirectory)(this.directory, (fileName) => teardownFileRegex.test(fileName));
285
+ return teardownFiles;
286
+ }
287
+ async skipTeardownFile(filePath) {
288
+ const project = new ts_morph_1.Project();
289
+ const sourceFile = project.addSourceFileAtPath(filePath);
290
+ sourceFile
291
+ .getDescendantsOfKind(ts_morph_1.SyntaxKind.CallExpression)
292
+ .forEach((callExpression) => {
293
+ const expression = callExpression.getExpression();
294
+ if (expression.getText() === "teardown") {
295
+ expression.replaceWithText("teardown.skip");
296
+ }
297
+ else if (expression.getText() === "test") {
298
+ expression.replaceWithText("test.skip");
299
+ }
300
+ });
301
+ // Save the modified file
302
+ sourceFile.save().catch((error) => {
303
+ console.error(`Error updating the file: ${filePath}`, error);
304
+ });
305
+ }
306
+ async skipAll() {
307
+ this.teardownFiles = await this.getAllTeardownFiles();
308
+ await Promise.all(this.teardownFiles.map(async ({ filePath }) => await this.skipTeardownFile(filePath)));
309
+ process.on("beforeExit", () => {
310
+ this.unskipAll();
311
+ });
312
+ process.on("exit", () => {
313
+ this.unskipAll();
314
+ });
315
+ process.on("SIGINT", () => {
316
+ this.unskipAll();
317
+ });
318
+ process.on("SIGTERM", () => {
319
+ this.unskipAll();
320
+ });
321
+ }
322
+ unskipAll() {
323
+ this.teardownFiles.forEach(({ filePath, content }) => {
324
+ fs_extra_1.default.writeFileSync(filePath, content, "utf-8");
325
+ });
326
+ }
327
+ }
328
+ exports.TeardownManager = TeardownManager;
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/master/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,GAAG,EACH,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAYlD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,oBAAoB,EAErB,MAAM,aAAa,CAAC;AAOrB,wBAAsB,aAAa,CAAC,EAClC,IAAI,EACJ,eAAe,EACf,aAAa,EACb,IAAI,EACJ,KAAK,EACL,GAAG,EACH,OAAO,EACP,cAAc,EACd,OAAO,EACP,aAAa,GACd,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,EAA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Ac,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;CACxB,2FAwDA;AAED,wBAAsB,0BAA0B,CAAC,EAC/C,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,OAAO,GACR,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;;;GAsLA"}
@@ -83,6 +83,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, }) {
83
83
  ].filter((s) => !!s),
84
84
  });
85
85
  void testgenUpdatesReporter.sendMessage(`Starting master agent. [view trace](${trace.getTraceUrl()})`);
86
+ void testgenUpdatesReporter.sendAgentTraceUrl(trace.getTraceUrl());
86
87
  const llm = new llm_1.LLM({
87
88
  trace,
88
89
  provider: options.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
package/dist/bin/index.js CHANGED
@@ -27,6 +27,9 @@ async function runAgent(testGenConfig) {
27
27
  const { specPath, testCase } = testGenConfig;
28
28
  if (testGenConfig.options?.agent !== "code") {
29
29
  // this assumes we have only one scenario in test config
30
+ if (process.env.LOG_URL) {
31
+ await new reporter_1.TestGenUpdatesReporter().sendLogUrl(process.env.LOG_URL);
32
+ }
30
33
  logger.success(`Generating test using ${testGenConfig.options?.agent} agent. ${process.env.LOG_URL ? `[view log](${process.env.LOG_URL})` : ""}`);
31
34
  const filePathToUpdate = await (0, utils_1.prepareFileForMasterAgent)(testGenConfig);
32
35
  await (0, run_1.generateTestsUsingMasterAgent)({
@@ -13,7 +13,7 @@ class CustomLogger {
13
13
  logToReporter(message) {
14
14
  if (this.useReporter) {
15
15
  (() => {
16
- const promise = (0, reporter_2.getReporter)()?.report(new reporter_1.ProcessLogMessageBuilder({ message: message }));
16
+ const promise = (0, reporter_2.getReporter)()?.report(new reporter_1.ProcessLogMessageBuilder({ type: "message", message: message }));
17
17
  if (promise) {
18
18
  queuedReporterMessages.push(promise);
19
19
  }
@@ -28,6 +28,8 @@ export declare class TestGenUpdatesReporter {
28
28
  }): Promise<void>;
29
29
  sendCurrentView(buffer: Buffer): Promise<void>;
30
30
  sendMessage(message: string): Promise<void>;
31
+ sendLogUrl(message: string): Promise<void>;
32
+ sendAgentTraceUrl(message: string): Promise<void>;
31
33
  }
32
34
  export {};
33
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporter/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAa5E,KAAK,kBAAkB,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,wBAAgB,WAAW,IAAI,QAAQ,GAAG,SAAS,CAUlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAGlE;AAED,qBAAa,sBAAsB;;IAE3B,YAAY,CAAC,KAAK,EAAE,MAAM,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;IA8CK,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC9C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUlD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporter/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAa5E,KAAK,kBAAkB,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,wBAAgB,WAAW,IAAI,QAAQ,GAAG,SAAS,CAUlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAGlE;AAED,qBAAa,sBAAsB;;IAE3B,YAAY,CAAC,KAAK,EAAE,MAAM,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;IAmC9C,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"}
@@ -66,6 +66,7 @@ class TestGenUpdatesReporter {
66
66
  ...(videoUrls.length
67
67
  ? [
68
68
  reporter?.report(new reporter_1.ProcessLogMessageBuilder({
69
+ type: "video",
69
70
  message: JSON.stringify(message),
70
71
  })),
71
72
  ]
@@ -73,6 +74,7 @@ class TestGenUpdatesReporter {
73
74
  ...(traceFiles.length
74
75
  ? [
75
76
  reporter?.report(new reporter_1.ProcessLogMessageBuilder({
77
+ type: "pw-trace",
76
78
  message: JSON.stringify({
77
79
  type: "trace",
78
80
  traceFiles,
@@ -108,6 +110,7 @@ class TestGenUpdatesReporter {
108
110
  const relativeFilePath = filePath.replace(path_1.default.join(process.cwd(), "gen-assets"), "");
109
111
  const url = `${uploader_1.UPLOAD_DOMAIN}/${uploadDir}${relativeFilePath}`;
110
112
  await getReporter()?.report(new reporter_1.ProcessLogMessageBuilder({
113
+ type: "current-snapshot",
111
114
  message: JSON.stringify({ type: "current-view", url }),
112
115
  }));
113
116
  await fs_extra_1.default.rmdir((process.cwd(), "gen-assets"), { recursive: true });
@@ -116,6 +119,25 @@ class TestGenUpdatesReporter {
116
119
  const reporter = getReporter();
117
120
  if (reporter) {
118
121
  await reporter.report(new reporter_1.ProcessLogMessageBuilder({
122
+ type: "message",
123
+ message,
124
+ }));
125
+ }
126
+ }
127
+ async sendLogUrl(message) {
128
+ const reporter = getReporter();
129
+ if (reporter) {
130
+ await reporter.report(new reporter_1.ProcessLogMessageBuilder({
131
+ type: "log-url",
132
+ message,
133
+ }));
134
+ }
135
+ }
136
+ async sendAgentTraceUrl(message) {
137
+ const reporter = getReporter();
138
+ if (reporter) {
139
+ await reporter.report(new reporter_1.ProcessLogMessageBuilder({
140
+ type: "agent-trace",
119
141
  message,
120
142
  }));
121
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.32.8",
3
+ "version": "0.33.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -46,7 +46,7 @@
46
46
  "typescript": "^5.3.3",
47
47
  "@empiricalrun/llm": "^0.9.9",
48
48
  "@empiricalrun/r2-uploader": "^0.3.4",
49
- "@empiricalrun/reporter": "^0.20.7"
49
+ "@empiricalrun/reporter": "^0.21.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/detect-port": "^1.3.5",