@empiricalrun/test-gen 0.23.0 → 0.23.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 +6 -0
- package/dist/bin/index.js +4 -3
- package/dist/bin/utils/index.d.ts +0 -1
- package/dist/bin/utils/index.d.ts.map +1 -1
- package/dist/bin/utils/index.js +0 -1
- package/dist/bin/utils/scenarios/index.d.ts.map +1 -1
- package/dist/bin/utils/scenarios/index.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/bin/index.js
CHANGED
|
@@ -20,7 +20,7 @@ process.on("beforeExit", async () => await (0, llm_1.flushAllTraces)());
|
|
|
20
20
|
process.on("exit", async () => await (0, llm_1.flushAllTraces)());
|
|
21
21
|
process.on("SIGINT", async () => await (0, llm_1.flushAllTraces)());
|
|
22
22
|
process.on("SIGTERM", async () => await (0, llm_1.flushAllTraces)());
|
|
23
|
-
async function runAgent(
|
|
23
|
+
async function runAgent(testGenConfig) {
|
|
24
24
|
const logger = new logger_1.CustomLogger();
|
|
25
25
|
const { specPath, testCase } = testGenConfig;
|
|
26
26
|
if (testGenConfig.options?.agent !== "code") {
|
|
@@ -39,19 +39,20 @@ async function runAgent(sourceFile, testGenConfig) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
(async function main() {
|
|
42
|
+
// this is where test gen starts executing on giving the command from ci
|
|
42
43
|
const logger = new logger_1.CustomLogger({ useReporter: false });
|
|
43
44
|
if (process.argv.length < 3) {
|
|
44
45
|
logger.error("Please provide path to scenarios using command:", "npx @empiricalrun/test-gen <TEST_GEN_TOKEN>");
|
|
45
46
|
process.exit(1);
|
|
46
47
|
}
|
|
47
|
-
const {
|
|
48
|
+
const { testGenConfig } = await (0, utils_2.parseCliArgs)();
|
|
48
49
|
(0, reporter_1.setReporterConfig)({
|
|
49
50
|
testCaseName: testGenConfig.testCase.name,
|
|
50
51
|
testGroup: testGenConfig.testCase.group,
|
|
51
52
|
projectRepoName: testGenConfig.options?.metadata.projectRepoName,
|
|
52
53
|
testSessionId: testGenConfig.options?.metadata.testSessionId,
|
|
53
54
|
});
|
|
54
|
-
await runAgent(
|
|
55
|
+
await runAgent(testGenConfig);
|
|
55
56
|
// TODO: move these reporters to a better lifecycle
|
|
56
57
|
await (0, ci_1.reportOnCI)(testGenConfig.testCase);
|
|
57
58
|
await (0, llm_1.flushAllTraces)();
|
|
@@ -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
|
|
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"}
|
package/dist/bin/utils/index.js
CHANGED
|
@@ -5,7 +5,6 @@ const scenarios_1 = require("./scenarios");
|
|
|
5
5
|
async function parseCliArgs(scenarioOrScenariosPath = getTestConfigCliArg()) {
|
|
6
6
|
const testGenConfig = await (0, scenarios_1.loadTestConfigs)(scenarioOrScenariosPath);
|
|
7
7
|
return {
|
|
8
|
-
sourceFile: scenarioOrScenariosPath,
|
|
9
8
|
testGenConfig,
|
|
10
9
|
};
|
|
11
10
|
}
|
|
@@ -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,
|
|
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"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadTestConfigs = void 0;
|
|
4
4
|
async function loadTestConfigs(scenariosPath) {
|
|
5
|
-
|
|
5
|
+
// scenariosPath is the testGenToken passed from ci
|
|
6
|
+
const str = decodeURIComponent(atob(scenariosPath));
|
|
6
7
|
const config = JSON.parse(str);
|
|
7
8
|
const specPath = `./tests/${config.group || "index"}.spec.ts`;
|
|
8
9
|
return {
|