@m4trix/evals 0.30.0 → 0.32.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/README.md +1 -1
- package/dist/cli-simple.cjs +19 -1
- package/dist/cli-simple.cjs.map +1 -1
- package/dist/cli-simple.js +19 -1
- package/dist/cli-simple.js.map +1 -1
- package/dist/cli.cjs +19 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +19 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +19 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1083,6 +1083,23 @@ function isRunConfigLike(value) {
|
|
|
1083
1083
|
function isTestCaseLike(value) {
|
|
1084
1084
|
return hasMethod(value, "getName") && hasMethod(value, "getTags") && hasMethod(value, "getInput");
|
|
1085
1085
|
}
|
|
1086
|
+
function collectTestCasesFromExportValues(exports) {
|
|
1087
|
+
const out = [];
|
|
1088
|
+
for (const value of exports) {
|
|
1089
|
+
if (isTestCaseLike(value)) {
|
|
1090
|
+
out.push(value);
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1093
|
+
if (Array.isArray(value)) {
|
|
1094
|
+
for (const item of value) {
|
|
1095
|
+
if (isTestCaseLike(item)) {
|
|
1096
|
+
out.push(item);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return out;
|
|
1102
|
+
}
|
|
1086
1103
|
async function walkDirectory(rootDir, excludeDirectories) {
|
|
1087
1104
|
const out = [];
|
|
1088
1105
|
async function walk(currentDir) {
|
|
@@ -1191,7 +1208,7 @@ async function collectTestCasesFromFiles(config) {
|
|
|
1191
1208
|
const found = await Promise.all(
|
|
1192
1209
|
matched.map(async (absolutePath) => {
|
|
1193
1210
|
const exports = await loadModuleExports(absolutePath);
|
|
1194
|
-
const testCases = exports
|
|
1211
|
+
const testCases = collectTestCasesFromExportValues(exports);
|
|
1195
1212
|
const relPath = relative(config.rootDir, absolutePath);
|
|
1196
1213
|
return testCases.map((testCase) => ({
|
|
1197
1214
|
id: toId("test-case", relPath, testCase.getName()),
|
|
@@ -1705,6 +1722,7 @@ function processOneEvaluation(task, unit, totalEvaluations, publishEvent, persis
|
|
|
1705
1722
|
meta: {
|
|
1706
1723
|
triggerId: task.triggerId,
|
|
1707
1724
|
triggerTimestamp: task.triggerTimestamp,
|
|
1725
|
+
triggeredAt: new Date(task.triggerTimestamp).toISOString(),
|
|
1708
1726
|
runId: evaluatorRunId,
|
|
1709
1727
|
datasetName: task.dataset.getDisplayLabel(),
|
|
1710
1728
|
testCaseId: testCaseItem.id,
|