@wix/evalforge-evaluator 0.41.0 → 0.42.0
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/build/index.js +19 -11
- package/build/index.js.map +3 -3
- package/build/index.mjs +19 -11
- package/build/index.mjs.map +3 -3
- package/build/types/run-scenario/environment.d.ts +4 -2
- package/package.json +4 -4
package/build/index.js
CHANGED
|
@@ -232,6 +232,7 @@ var import_eval_assertions = require("@wix/eval-assertions");
|
|
|
232
232
|
|
|
233
233
|
// src/run-scenario/environment.ts
|
|
234
234
|
var import_fs5 = require("fs");
|
|
235
|
+
var import_os = require("os");
|
|
235
236
|
var import_stream = require("stream");
|
|
236
237
|
var import_promises2 = require("stream/promises");
|
|
237
238
|
var import_zlib2 = require("zlib");
|
|
@@ -6079,19 +6080,25 @@ async function downloadAndExtractTemplate(template, workDir) {
|
|
|
6079
6080
|
}
|
|
6080
6081
|
cleanAppleDoubleFiles(workDir);
|
|
6081
6082
|
}
|
|
6082
|
-
async function prepareWorkingDirectory(config, evalRunId2, targetId, template) {
|
|
6083
|
-
|
|
6084
|
-
|
|
6083
|
+
async function prepareWorkingDirectory(config, evalRunId2, targetId, scenarioId, template) {
|
|
6084
|
+
const baseDir = config.evaluationsDir ?? import_path4.default.join((0, import_os.tmpdir)(), "evalforge-evaluations");
|
|
6085
|
+
if (template) {
|
|
6086
|
+
if (!config.evaluationsDir) {
|
|
6087
|
+
console.warn(
|
|
6088
|
+
"Template specified but EVALUATIONS_DIR not set, using temp directory"
|
|
6089
|
+
);
|
|
6090
|
+
}
|
|
6091
|
+
const workDir2 = import_path4.default.join(baseDir, `${evalRunId2}_${targetId}`);
|
|
6092
|
+
await downloadAndExtractTemplate(template, workDir2);
|
|
6093
|
+
console.log(`Template extracted to ${workDir2}`);
|
|
6094
|
+
return workDir2;
|
|
6085
6095
|
}
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
);
|
|
6090
|
-
return void 0;
|
|
6096
|
+
const workDir = import_path4.default.join(baseDir, `${evalRunId2}_${targetId}_${scenarioId}`);
|
|
6097
|
+
if ((0, import_fs5.existsSync)(workDir)) {
|
|
6098
|
+
(0, import_fs5.rmSync)(workDir, { recursive: true });
|
|
6091
6099
|
}
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
console.log(`Template extracted to ${workDir}`);
|
|
6100
|
+
(0, import_fs5.mkdirSync)(workDir, { recursive: true });
|
|
6101
|
+
console.log(`Empty working directory created at ${workDir}`);
|
|
6095
6102
|
return workDir;
|
|
6096
6103
|
}
|
|
6097
6104
|
|
|
@@ -7473,6 +7480,7 @@ async function runScenario(config, evalRunId2, scenario, target, template) {
|
|
|
7473
7480
|
config,
|
|
7474
7481
|
evalRunId2,
|
|
7475
7482
|
targetId,
|
|
7483
|
+
scenario.id,
|
|
7476
7484
|
template
|
|
7477
7485
|
);
|
|
7478
7486
|
let partialResult;
|