testdriverai 7.3.43 → 7.3.44
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 +4 -0
- package/lib/vitest/hooks.mjs +0 -52
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/vitest/hooks.mjs
CHANGED
|
@@ -121,7 +121,6 @@ function bufferConsoleToClients(args, level) {
|
|
|
121
121
|
line: message,
|
|
122
122
|
level: level || "log",
|
|
123
123
|
source: "console",
|
|
124
|
-
logFile: "console",
|
|
125
124
|
});
|
|
126
125
|
}
|
|
127
126
|
}
|
|
@@ -217,47 +216,6 @@ function cleanupConsoleSpy(client) {
|
|
|
217
216
|
const testDriverInstances = new WeakMap();
|
|
218
217
|
const lifecycleHandlers = new WeakMap();
|
|
219
218
|
|
|
220
|
-
/**
|
|
221
|
-
* Known log file paths on the Windows test runner.
|
|
222
|
-
* These are written by pyautogui-cli.py and related services.
|
|
223
|
-
*/
|
|
224
|
-
const WINDOWS_RUNNER_LOG_PATHS = [
|
|
225
|
-
"C:\\Windows\\Temp\\pyautogui-cli.log",
|
|
226
|
-
];
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Fetch log files from the Windows test runner via exec() and save them locally.
|
|
230
|
-
* This runs before disconnect so we can still communicate with the sandbox.
|
|
231
|
-
*
|
|
232
|
-
* @param {import('../../sdk.js').default} client - TestDriver SDK instance
|
|
233
|
-
* @param {string} testName - Test file name (used for local directory naming)
|
|
234
|
-
*/
|
|
235
|
-
async function fetchRunnerLogs(client, testName) {
|
|
236
|
-
if (!client.connected) return;
|
|
237
|
-
if (client.os !== "windows") return;
|
|
238
|
-
|
|
239
|
-
for (const remotePath of WINDOWS_RUNNER_LOG_PATHS) {
|
|
240
|
-
const localName = path.basename(remotePath);
|
|
241
|
-
try {
|
|
242
|
-
// Read the log file contents via PowerShell
|
|
243
|
-
const cmd = `if (Test-Path '${remotePath}') { Get-Content -Path '${remotePath}' -Raw } else { Write-Output '__FILE_NOT_FOUND__' }`;
|
|
244
|
-
const result = await Promise.race([
|
|
245
|
-
client.exec("pwsh", cmd, 10000, true),
|
|
246
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("timeout")), 15000)),
|
|
247
|
-
]);
|
|
248
|
-
|
|
249
|
-
if (result && typeof result === "string" && !result.includes("__FILE_NOT_FOUND__")) {
|
|
250
|
-
console.log(`\n[TestDriver] === Runner Log: ${localName} ===`);
|
|
251
|
-
console.log(result);
|
|
252
|
-
console.log(`[TestDriver] === End Runner Log ===\n`);
|
|
253
|
-
}
|
|
254
|
-
} catch (err) {
|
|
255
|
-
// Fire-and-forget — don't let log retrieval break cleanup
|
|
256
|
-
console.warn(`[TestDriver] Could not fetch runner log ${remotePath}: ${err.message}`);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
219
|
/**
|
|
262
220
|
* Upload buffered SDK + console logs directly to S3 via the existing Log system.
|
|
263
221
|
* Extracts the replayId from the dashcam URL, calls POST /api/v1/logs to create
|
|
@@ -673,16 +631,6 @@ export function TestDriver(context, options = {}) {
|
|
|
673
631
|
context.task.meta.dashcamUrl = null;
|
|
674
632
|
}
|
|
675
633
|
|
|
676
|
-
// Fetch runner logs before disconnecting (Windows only)
|
|
677
|
-
// This grabs pyautogui-cli logs from the runner while we still have a connection
|
|
678
|
-
try {
|
|
679
|
-
const logTestName = testFile.replace(/[/\\]/g, "_").replace(/\.test\.m?js$/, "");
|
|
680
|
-
await fetchRunnerLogs(currentInstance, logTestName);
|
|
681
|
-
} catch (err) {
|
|
682
|
-
// Never let log retrieval block cleanup
|
|
683
|
-
console.warn("[TestDriver] Runner log fetch failed:", err.message);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
634
|
// Clean up console spies
|
|
687
635
|
cleanupConsoleSpy(currentInstance);
|
|
688
636
|
|