intellitester 0.2.14 → 0.2.15
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/dist/cli/index.cjs +40 -3
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +40 -3
- package/dist/cli/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1400,7 +1400,7 @@ var discoverTestFiles = async (testsDir = "tests") => {
|
|
|
1400
1400
|
const allFiles = await collectYamlFiles(absoluteDir);
|
|
1401
1401
|
const pipelines = [];
|
|
1402
1402
|
const workflows = [];
|
|
1403
|
-
const
|
|
1403
|
+
const allTests = [];
|
|
1404
1404
|
for (const file of allFiles) {
|
|
1405
1405
|
const name = path4__namespace.default.basename(file).toLowerCase();
|
|
1406
1406
|
if (name.endsWith(".pipeline.yaml") || name.endsWith(".pipeline.yml")) {
|
|
@@ -1408,10 +1408,47 @@ var discoverTestFiles = async (testsDir = "tests") => {
|
|
|
1408
1408
|
} else if (name.endsWith(".workflow.yaml") || name.endsWith(".workflow.yml")) {
|
|
1409
1409
|
workflows.push(file);
|
|
1410
1410
|
} else if (name.endsWith(".test.yaml") || name.endsWith(".test.yml")) {
|
|
1411
|
-
|
|
1411
|
+
allTests.push(file);
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
|
|
1414
|
+
const { parse: parse2 } = await import('yaml');
|
|
1415
|
+
const workflowsInPipelines = /* @__PURE__ */ new Set();
|
|
1416
|
+
for (const pipelineFile of pipelines) {
|
|
1417
|
+
try {
|
|
1418
|
+
const content = await fs3__default.default.readFile(pipelineFile, "utf8");
|
|
1419
|
+
const pipeline = parse2(content);
|
|
1420
|
+
const pipelineDir = path4__namespace.default.dirname(pipelineFile);
|
|
1421
|
+
if (pipeline?.workflows && Array.isArray(pipeline.workflows)) {
|
|
1422
|
+
for (const workflowRef of pipeline.workflows) {
|
|
1423
|
+
if (workflowRef?.file) {
|
|
1424
|
+
const absoluteWorkflowPath = path4__namespace.default.resolve(pipelineDir, workflowRef.file);
|
|
1425
|
+
workflowsInPipelines.add(absoluteWorkflowPath);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
} catch {
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
const standaloneWorkflows = workflows.filter((wf) => !workflowsInPipelines.has(wf));
|
|
1433
|
+
const testsInWorkflows = /* @__PURE__ */ new Set();
|
|
1434
|
+
for (const workflowFile of workflows) {
|
|
1435
|
+
try {
|
|
1436
|
+
const content = await fs3__default.default.readFile(workflowFile, "utf8");
|
|
1437
|
+
const workflow = parse2(content);
|
|
1438
|
+
const workflowDir = path4__namespace.default.dirname(workflowFile);
|
|
1439
|
+
if (workflow?.tests && Array.isArray(workflow.tests)) {
|
|
1440
|
+
for (const testRef of workflow.tests) {
|
|
1441
|
+
if (testRef?.file) {
|
|
1442
|
+
const absoluteTestPath = path4__namespace.default.resolve(workflowDir, testRef.file);
|
|
1443
|
+
testsInWorkflows.add(absoluteTestPath);
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
} catch {
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
const standaloneTests = allTests.filter((test) => !testsInWorkflows.has(test));
|
|
1451
|
+
return { pipelines, workflows: standaloneWorkflows, tests: standaloneTests };
|
|
1415
1452
|
};
|
|
1416
1453
|
var writeFileIfMissing = async (filePath, contents) => {
|
|
1417
1454
|
if (await fileExists(filePath)) return;
|