@empiricalrun/test-gen 0.32.0 → 0.32.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 +17 -0
- package/dist/agent/browsing/run.d.ts +7 -1
- package/dist/agent/browsing/run.d.ts.map +1 -1
- package/dist/agent/browsing/run.js +2 -2
- package/dist/agent/browsing/utils.d.ts +1 -1
- package/dist/agent/browsing/utils.d.ts.map +1 -1
- package/dist/agent/browsing/utils.js +24 -4
- package/dist/agent/codegen/run.d.ts.map +1 -1
- package/dist/agent/codegen/run.js +1 -1
- package/dist/agent/master/run.d.ts.map +1 -1
- package/dist/agent/master/run.js +1 -0
- package/dist/bin/index.js +3 -2
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/bin/utils/scenarios/index.js +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @empiricalrun/test-gen
|
|
2
2
|
|
|
3
|
+
## 0.32.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d2bc4c5: fix: add logs and traces
|
|
8
|
+
- Updated dependencies [0eb7700]
|
|
9
|
+
- Updated dependencies [55f21cf]
|
|
10
|
+
- @empiricalrun/llm@0.9.5
|
|
11
|
+
|
|
12
|
+
## 0.32.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 7373dea: fix: project detection should use environment pw project filter
|
|
17
|
+
- Updated dependencies [ff77220]
|
|
18
|
+
- @empiricalrun/r2-uploader@0.3.4
|
|
19
|
+
|
|
3
20
|
## 0.32.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -11,6 +11,12 @@ type GenerateTestsType = {
|
|
|
11
11
|
* @type {string}
|
|
12
12
|
*/
|
|
13
13
|
filePathToUpdate: string;
|
|
14
|
+
/**
|
|
15
|
+
* playwright projects to filter
|
|
16
|
+
*
|
|
17
|
+
* @type {string[]}
|
|
18
|
+
*/
|
|
19
|
+
pwProjectsFilter: string[];
|
|
14
20
|
};
|
|
15
21
|
/**
|
|
16
22
|
*
|
|
@@ -21,6 +27,6 @@ type GenerateTestsType = {
|
|
|
21
27
|
* filePathToUpdate,
|
|
22
28
|
* }
|
|
23
29
|
*/
|
|
24
|
-
export declare function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, }: GenerateTestsType): Promise<void>;
|
|
30
|
+
export declare function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, pwProjectsFilter, }: GenerateTestsType): Promise<void>;
|
|
25
31
|
export {};
|
|
26
32
|
//# sourceMappingURL=run.d.ts.map
|
|
@@ -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;
|
|
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"}
|
|
@@ -20,7 +20,7 @@ const utils_2 = require("./utils");
|
|
|
20
20
|
* filePathToUpdate,
|
|
21
21
|
* }
|
|
22
22
|
*/
|
|
23
|
-
async function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, }) {
|
|
23
|
+
async function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, pwProjectsFilter, }) {
|
|
24
24
|
// valiate if the file path and file to update are valid
|
|
25
25
|
// also warn users if they are on older version of test-gen
|
|
26
26
|
(0, utils_2.canRunMasterAgent)(testFilePath);
|
|
@@ -34,7 +34,7 @@ async function generateTestsUsingMasterAgent({ testFilePath, filePathToUpdate, }
|
|
|
34
34
|
// read playwright config from ./playwright.config.ts of source repo
|
|
35
35
|
const playwrightConfig = await (0, utils_2.readPlaywrightConfig)();
|
|
36
36
|
// detect the playwright project name for the given test file and playwright config
|
|
37
|
-
const project = await (0, utils_2.detectProjectName)(testFilePath, playwrightConfig);
|
|
37
|
+
const project = await (0, utils_2.detectProjectName)(testFilePath, playwrightConfig, pwProjectsFilter);
|
|
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
|
|
@@ -27,7 +27,7 @@ export declare function readPlaywrightConfig(): Promise<PlaywrightTestConfig>;
|
|
|
27
27
|
* @param testFilePath
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
export declare function detectProjectName(testFilePath: string, playwrightConfig: PlaywrightTestConfig): Promise<string>;
|
|
30
|
+
export declare function detectProjectName(testFilePath: string, playwrightConfig: PlaywrightTestConfig, pwProjectsFilter?: string[]): Promise<string>;
|
|
31
31
|
export declare function getPromptForNextAction({ pageSnapshot, task, previousActions, lastActionErrors, promptType, }: {
|
|
32
32
|
pageSnapshot: string;
|
|
33
33
|
task: string;
|
|
@@ -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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C1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,8EASA"}
|
|
@@ -30,7 +30,7 @@ exports.prepareBrowsingAgentTask = prepareBrowsingAgentTask;
|
|
|
30
30
|
* Function to prepare test file for update scenarios for master agent to run
|
|
31
31
|
* @param {TestGenConfig} genConfig
|
|
32
32
|
*/
|
|
33
|
-
async function prepareFileForUpdateScenario(genConfig) {
|
|
33
|
+
async function prepareFileForUpdateScenario(genConfig, trace) {
|
|
34
34
|
const { specPath, testCase } = genConfig;
|
|
35
35
|
const { name, suites } = testCase;
|
|
36
36
|
await (0, web_1.addUserContextFixture)({
|
|
@@ -42,6 +42,7 @@ async function prepareFileForUpdateScenario(genConfig) {
|
|
|
42
42
|
// TODO: reduce the payload for this LLM call. Only provide test file and page files which are used in the test block
|
|
43
43
|
// this will help with faster response
|
|
44
44
|
const [suggestion] = await (0, update_flow_1.appendCreateTestBlock)({
|
|
45
|
+
trace,
|
|
45
46
|
testCase,
|
|
46
47
|
file: specPath,
|
|
47
48
|
validateTypes: false,
|
|
@@ -50,9 +51,17 @@ async function prepareFileForUpdateScenario(genConfig) {
|
|
|
50
51
|
const createTestFilePath = suggestion?.updatedFiles[0] || "";
|
|
51
52
|
console.log("appending to existing test block");
|
|
52
53
|
console.log("updated test file path", createTestFilePath);
|
|
54
|
+
const updateFileSpan = trace?.span({
|
|
55
|
+
name: "update-file-span",
|
|
56
|
+
input: {
|
|
57
|
+
createTestFilePath,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
53
60
|
await fs_extra_1.default.writeFile(createTestFilePath, (0, web_1.addNewImport)(await fs_extra_1.default.readFile(createTestFilePath, "utf-8"), ["createTest"], "@empiricalrun/test-gen"));
|
|
61
|
+
updateFileSpan?.end();
|
|
54
62
|
const { codePrompt, pomPrompt } = await (0, context_1.contextForGeneration)(createTestFilePath);
|
|
55
63
|
await (0, fix_ts_errors_1.validateAndFixTypescriptErrors)({
|
|
64
|
+
trace,
|
|
56
65
|
file: createTestFilePath,
|
|
57
66
|
testCode: codePrompt,
|
|
58
67
|
pomCode: pomPrompt,
|
|
@@ -79,14 +88,23 @@ async function prepareFileForUpdateScenario(genConfig) {
|
|
|
79
88
|
* @return {*} {Promise<string>}
|
|
80
89
|
*/
|
|
81
90
|
async function prepareFileForMasterAgent(genConfig) {
|
|
91
|
+
const trace = llm_1.langfuseInstance.trace({
|
|
92
|
+
name: "prepare-file-for-master-agent",
|
|
93
|
+
});
|
|
94
|
+
new logger_1.CustomLogger({ useReporter: true }).log(`Preparing file for master agent. [view trace](${trace.getTraceUrl()})`);
|
|
82
95
|
const { specPath, testCase } = genConfig;
|
|
83
96
|
const { name, suites } = testCase;
|
|
84
97
|
// check if the spec file exists
|
|
85
98
|
// if no then create a new file with test and expect imports
|
|
86
99
|
if (!fs_extra_1.default.existsSync(specPath)) {
|
|
100
|
+
const fileCreateSpan = trace.span({
|
|
101
|
+
name: "create-file",
|
|
102
|
+
input: { specPath },
|
|
103
|
+
});
|
|
87
104
|
await fs_extra_1.default.createFile(specPath);
|
|
88
105
|
const fileContentWithImports = (0, web_1.addNewImport)("", ["test", "expect"], (0, web_1.getFixtureImportPath)(specPath));
|
|
89
106
|
await fs_extra_1.default.writeFile(specPath, fileContentWithImports, "utf-8");
|
|
107
|
+
fileCreateSpan.end({ output: { specPath, fileContentWithImports } });
|
|
90
108
|
}
|
|
91
109
|
const existingContents = await fs_extra_1.default.readFile(specPath, "utf-8");
|
|
92
110
|
const { testBlock } = (0, web_1.getTypescriptTestBlock)({
|
|
@@ -96,6 +114,7 @@ async function prepareFileForMasterAgent(genConfig) {
|
|
|
96
114
|
});
|
|
97
115
|
if (!testBlock) {
|
|
98
116
|
const newTestBlock = await (0, create_test_block_1.createEmptyTestCaseBlock)({
|
|
117
|
+
trace,
|
|
99
118
|
testCase: genConfig.testCase,
|
|
100
119
|
file: specPath,
|
|
101
120
|
options: genConfig.options,
|
|
@@ -108,7 +127,7 @@ async function prepareFileForMasterAgent(genConfig) {
|
|
|
108
127
|
});
|
|
109
128
|
await fs_extra_1.default.writeFile(specPath, updatedContent, "utf-8");
|
|
110
129
|
}
|
|
111
|
-
await prepareFileForUpdateScenario(genConfig);
|
|
130
|
+
await prepareFileForUpdateScenario(genConfig, trace);
|
|
112
131
|
return specPath;
|
|
113
132
|
}
|
|
114
133
|
exports.prepareFileForMasterAgent = prepareFileForMasterAgent;
|
|
@@ -193,7 +212,7 @@ function matchAgainstPattern(pattern, filePathToTest) {
|
|
|
193
212
|
* @param testFilePath
|
|
194
213
|
* @returns
|
|
195
214
|
*/
|
|
196
|
-
async function detectProjectName(testFilePath, playwrightConfig) {
|
|
215
|
+
async function detectProjectName(testFilePath, playwrightConfig, pwProjectsFilter = ["*"]) {
|
|
197
216
|
const filePath = testFilePath.replace("./tests/", "");
|
|
198
217
|
if (!playwrightConfig.projects || playwrightConfig.projects.length === 0) {
|
|
199
218
|
throw new Error(`No projects found in playwright config.`);
|
|
@@ -229,7 +248,8 @@ async function detectProjectName(testFilePath, playwrightConfig) {
|
|
|
229
248
|
return "";
|
|
230
249
|
}
|
|
231
250
|
})
|
|
232
|
-
.filter((p) => !!p)
|
|
251
|
+
.filter((p) => !!p)
|
|
252
|
+
.filter((p) => pwProjectsFilter.some((f) => matchAgainstPattern(f, p)));
|
|
233
253
|
if (filteredProjectNames.length === 0) {
|
|
234
254
|
throw new Error(`No project found for the test file: ${testFilePath} in playwright config.`);
|
|
235
255
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAyBA,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,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/agent/codegen/run.ts"],"names":[],"mappings":"AAyBA,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,CAyGrB"}
|
|
@@ -101,7 +101,7 @@ async function generateTest(testCase, file, options) {
|
|
|
101
101
|
trace.event({ name: "format-file" });
|
|
102
102
|
await (0, web_1.formatCode)(file);
|
|
103
103
|
logger.success("File formatted successfully!");
|
|
104
|
-
logger.log(`
|
|
104
|
+
logger.log(`Successfully generated code for the given task. \n View [trace](${trace.getTraceUrl()})`);
|
|
105
105
|
generatedTestCases.push(testCase);
|
|
106
106
|
trace.update({ input: { testCase }, output: { response } });
|
|
107
107
|
await (0, llm_1.flushAllTraces)();
|
|
@@ -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,EAAE,CAAC;IAC1B,aAAa,EAAE,GAAG,EAAE,CAAC;I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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"}
|
package/dist/agent/master/run.js
CHANGED
|
@@ -82,6 +82,7 @@ async function createTestUsingMasterAgent({ task, page, testCase, options, }) {
|
|
|
82
82
|
options.metadata?.environment,
|
|
83
83
|
].filter((s) => !!s),
|
|
84
84
|
});
|
|
85
|
+
void testgenUpdatesReporter.sendMessage(`Starting master agent. [view trace](${trace.getTraceUrl()})`);
|
|
85
86
|
const llm = new llm_1.LLM({
|
|
86
87
|
trace,
|
|
87
88
|
provider: options.modelProvider || constants_1.DEFAULT_MODEL_PROVIDER,
|
package/dist/bin/index.js
CHANGED
|
@@ -27,15 +27,16 @@ 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
|
-
logger.success(`Generating test using ${testGenConfig.options?.agent} agent`);
|
|
30
|
+
logger.success(`Generating test using ${testGenConfig.options?.agent} agent. ${process.env.LOG_URL ? `[view log](${process.env.LOG_URL})` : ""}`);
|
|
31
31
|
const filePathToUpdate = await (0, utils_1.prepareFileForMasterAgent)(testGenConfig);
|
|
32
32
|
await (0, run_1.generateTestsUsingMasterAgent)({
|
|
33
33
|
testFilePath: specPath,
|
|
34
34
|
filePathToUpdate,
|
|
35
|
+
pwProjectsFilter: testGenConfig.environment?.playwrightProjects,
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
else {
|
|
38
|
-
logger.success(
|
|
39
|
+
logger.success(`Generating test using coding agent. ${process.env.LOG_URL ? `[view log](${process.env.LOG_URL})` : ""}`);
|
|
39
40
|
await (0, run_2.generateTest)(testCase, specPath, testGenConfig.options);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/utils/scenarios/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bin/utils/scenarios/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAaxB,iBAAe,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiB3E;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ export type FileContent = {
|
|
|
5
5
|
filePath: string;
|
|
6
6
|
content: string;
|
|
7
7
|
};
|
|
8
|
+
export type Environment = {
|
|
9
|
+
name: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
playwrightProjects: string[];
|
|
12
|
+
};
|
|
8
13
|
export type TestGenConfigOptions = {
|
|
9
14
|
agent: "code" | "master";
|
|
10
15
|
model: LLMModel;
|
|
@@ -26,6 +31,7 @@ export type TestGenConfig = {
|
|
|
26
31
|
specPath: string;
|
|
27
32
|
testCase: TestCase;
|
|
28
33
|
build?: Build;
|
|
34
|
+
environment?: Environment;
|
|
29
35
|
options?: TestGenConfigOptions;
|
|
30
36
|
};
|
|
31
37
|
export type TestCase = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,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,CAAC;IAC1C,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KACzB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-gen",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"ts-morph": "^23.0.0",
|
|
45
45
|
"tsx": "^4.16.2",
|
|
46
46
|
"typescript": "^5.3.3",
|
|
47
|
-
"@empiricalrun/llm": "^0.9.
|
|
48
|
-
"@empiricalrun/r2-uploader": "^0.3.
|
|
47
|
+
"@empiricalrun/llm": "^0.9.5",
|
|
48
|
+
"@empiricalrun/r2-uploader": "^0.3.4",
|
|
49
49
|
"@empiricalrun/reporter": "^0.20.7"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|