Download automation/scripts/verify-artifacts.js from EnergyVenom/patchwise-agent-studio: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/automation/scripts/verify-artifacts.js
- Command line
-
hf download hf://spaces/EnergyVenom/patchwise-agent-studio/automation/scripts/verify-artifacts.js
-
curl -L -o verify-artifacts.js https://huggingface.co/spaces/EnergyVenom/patchwise-agent-studio/resolve/main/automation/scripts/verify-artifacts.js
1.22 kB
| // Checks that every attachment path (trace, screenshot, video, ...) referenced in a Playwright results.json exists. | |
| // Usage: node scripts/verify-artifacts.js [results.json] (default results/results.json). Exit 1 if any are missing. | |
| const fs = require('fs'); const path = require('path'); | |
| const file = path.resolve(process.argv[2] || path.join(__dirname, '../results/results.json')); | |
| const r = JSON.parse(fs.readFileSync(file, 'utf8')); | |
| const seen = []; const missing = []; const kinds = {}; | |
| const walk = (s) => { (s.specs || []).forEach((sp) => sp.tests.forEach((t) => t.results.forEach((res) => (res.attachments || []).forEach((a) => { | |
| if (!a.path) return; seen.push(a.path); kinds[a.name] = (kinds[a.name] || 0) + 1; if (!fs.existsSync(a.path)) missing.push(`${sp.title} :: ${a.name} :: ${a.path}`); | |
| })))); (s.suites || []).forEach(walk); }; | |
| (r.suites || []).forEach(walk); | |
| console.log(`verify-artifacts ${path.relative(process.cwd(), file)}: ${seen.length} attachment paths (${Object.entries(kinds).map(([k, v]) => `${k}=${v}`).join(', ')}), missing ${missing.length}`); | |
| missing.slice(0, 20).forEach((m) => console.log(' MISSING', m)); | |
| process.exit(missing.length ? 1 : 0); | |