intellitester 0.2.42 → 0.2.43
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/{chunk-4MKGIPFO.js → chunk-66ECN3LB.js} +31 -5
- package/dist/chunk-66ECN3LB.js.map +1 -0
- package/dist/{chunk-YTTMMYRA.cjs → chunk-GDPJLAXU.cjs} +31 -5
- package/dist/chunk-GDPJLAXU.cjs.map +1 -0
- package/dist/cli/index.cjs +18 -16
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +4 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4MKGIPFO.js.map +0 -1
- package/dist/chunk-YTTMMYRA.cjs.map +0 -1
|
@@ -936,18 +936,43 @@ var cleanupStaleSession = async (entry, cleanupConfig) => {
|
|
|
936
936
|
} catch {
|
|
937
937
|
}
|
|
938
938
|
};
|
|
939
|
+
var cleanupOrphanedTrackFiles = async (cwd, state, trackDir) => {
|
|
940
|
+
const dir = getTrackDir(cwd, trackDir);
|
|
941
|
+
try {
|
|
942
|
+
const files = await fs.readdir(dir);
|
|
943
|
+
const activeFiles = new Set(Object.values(state.sessions).map((s) => path2.basename(s.trackFile)));
|
|
944
|
+
for (const file of files) {
|
|
945
|
+
if (!file.endsWith(".jsonl")) continue;
|
|
946
|
+
if (activeFiles.has(file)) continue;
|
|
947
|
+
const filePath = path2.join(dir, file);
|
|
948
|
+
try {
|
|
949
|
+
const stat = await fs.stat(filePath);
|
|
950
|
+
const staleMs = Number(process.env.INTELLITESTER_STALE_TEST_MS ?? DEFAULT_STALE_MS);
|
|
951
|
+
const isOld = Date.now() - stat.mtimeMs > staleMs;
|
|
952
|
+
const isEmpty = stat.size === 0;
|
|
953
|
+
if (isEmpty || isOld) {
|
|
954
|
+
await fs.rm(filePath, { force: true });
|
|
955
|
+
}
|
|
956
|
+
} catch {
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
} catch {
|
|
960
|
+
}
|
|
961
|
+
};
|
|
939
962
|
var pruneStaleTests = async (cwd, cleanupConfig, trackDir) => {
|
|
940
963
|
const state = await loadActiveTests(cwd, trackDir);
|
|
941
964
|
const staleMs = Number(process.env.INTELLITESTER_STALE_TEST_MS ?? DEFAULT_STALE_MS);
|
|
942
965
|
let changed = false;
|
|
943
966
|
for (const [sessionId, entry] of Object.entries(state.sessions)) {
|
|
944
967
|
let missingFile = false;
|
|
968
|
+
let isEmpty = false;
|
|
945
969
|
try {
|
|
946
|
-
await fs.
|
|
970
|
+
const stat = await fs.stat(entry.trackFile);
|
|
971
|
+
isEmpty = stat.size === 0;
|
|
947
972
|
} catch {
|
|
948
973
|
missingFile = true;
|
|
949
974
|
}
|
|
950
|
-
if (!missingFile && !isStale(entry, staleMs)) continue;
|
|
975
|
+
if (!missingFile && !isEmpty && !isStale(entry, staleMs)) continue;
|
|
951
976
|
changed = true;
|
|
952
977
|
await cleanupStaleSession(entry, cleanupConfig);
|
|
953
978
|
try {
|
|
@@ -959,6 +984,7 @@ var pruneStaleTests = async (cwd, cleanupConfig, trackDir) => {
|
|
|
959
984
|
if (changed) {
|
|
960
985
|
await saveActiveTests(cwd, state, trackDir);
|
|
961
986
|
}
|
|
987
|
+
await cleanupOrphanedTrackFiles(cwd, state, trackDir);
|
|
962
988
|
};
|
|
963
989
|
async function initFileTracking(options) {
|
|
964
990
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -3004,7 +3030,7 @@ Starting workflow: ${workflow.name}`);
|
|
|
3004
3030
|
executionContext.variables.set(key, interpolated);
|
|
3005
3031
|
}
|
|
3006
3032
|
}
|
|
3007
|
-
const result = await runTestInWorkflow(test, page, executionContext, options, workflowDir, workflow.config?.web?.baseUrl);
|
|
3033
|
+
const result = await runTestInWorkflow(test, page, executionContext, options, workflowDir, workflow.config?.web?.baseUrl ?? options.baseUrl);
|
|
3008
3034
|
const testResult = {
|
|
3009
3035
|
id: testRef.id,
|
|
3010
3036
|
file: testRef.file,
|
|
@@ -3342,5 +3368,5 @@ Collected ${serverResources.length} server-tracked resources`);
|
|
|
3342
3368
|
}
|
|
3343
3369
|
|
|
3344
3370
|
export { createAIProvider, createTestContext, generateFillerText, generateRandomEmail, generateRandomPhone, generateRandomPhoto, generateRandomUsername, getBrowserLaunchOptions, initFileTracking, interpolateVariables, killServer, mergeFileTrackedResources, runWebTest, runWorkflow, runWorkflowWithContext, setupAppwriteTracking, startTrackingServer, startWebServer };
|
|
3345
|
-
//# sourceMappingURL=chunk-
|
|
3346
|
-
//# sourceMappingURL=chunk-
|
|
3371
|
+
//# sourceMappingURL=chunk-66ECN3LB.js.map
|
|
3372
|
+
//# sourceMappingURL=chunk-66ECN3LB.js.map
|