@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @empiricalrun/test-gen
2
2
 
3
+ ## 0.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 108ee1b: fix: encode testGenToken before btoa
8
+
3
9
  ## 0.23.0
4
10
 
5
11
  ### Minor Changes
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(sourceFile, testGenConfig) {
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 { sourceFile, testGenConfig } = await (0, utils_2.parseCliArgs)();
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(sourceFile, testGenConfig);
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,6 +1,5 @@
1
1
  import { TestGenConfig } from "../../types";
2
2
  export declare function parseCliArgs(scenarioOrScenariosPath?: string): Promise<{
3
- sourceFile: string;
4
3
  testGenConfig: TestGenConfig;
5
4
  }>;
6
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;;;GASxD;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,uBAAuB,GAAE,MAA8B;;GAQxD;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
@@ -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,CAa5E;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,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
- const str = atob(scenariosPath);
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-gen",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"