deflake 1.2.13 → 1.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/cli.js +37 -0
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -681,6 +681,43 @@ async function runDoctor(argv) {
|
|
|
681
681
|
} catch (error) {
|
|
682
682
|
process.stdout.write(`\r ❌ ${C.RED}API Connectivity Error: ${error.message}${C.RESET}\n`);
|
|
683
683
|
}
|
|
684
|
+
// 6. Artifact & Permission Check
|
|
685
|
+
console.log(`${C.BRIGHT}Checking Artifact Permissions:${C.RESET}`);
|
|
686
|
+
const criticalDirs = [
|
|
687
|
+
{ path: 'test-results', label: 'Playwright Failures' },
|
|
688
|
+
{ path: 'playwright-report', label: 'Playwright Report' },
|
|
689
|
+
{ path: 'cypress/screenshots', label: 'Cypress Screenshots' },
|
|
690
|
+
{ path: 'cypress/videos', label: 'Cypress Videos' }
|
|
691
|
+
];
|
|
692
|
+
|
|
693
|
+
let permsIssue = false;
|
|
694
|
+
for (const dir of criticalDirs) {
|
|
695
|
+
if (fs.existsSync(dir.path)) {
|
|
696
|
+
try {
|
|
697
|
+
fs.accessSync(dir.path, fs.constants.R_OK | fs.constants.W_OK);
|
|
698
|
+
// Deep check: try readdir
|
|
699
|
+
fs.readdirSync(dir.path);
|
|
700
|
+
console.log(` ✅ ${dir.label.padEnd(20)}: ${C.GREEN}Accessible${C.RESET}`);
|
|
701
|
+
} catch (e) {
|
|
702
|
+
console.log(` ❌ ${dir.label.padEnd(20)}: ${C.RED}Access Denied${C.RESET}`);
|
|
703
|
+
console.log(` ${C.GRAY}Path: ${dir.path}${C.RESET}`);
|
|
704
|
+
permsIssue = true;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if (permsIssue) {
|
|
710
|
+
console.log(`\n ${C.YELLOW}⚠️ Permission bottleneck detected!${C.RESET}`);
|
|
711
|
+
if (process.platform === 'win32') {
|
|
712
|
+
console.log(` ${C.BRIGHT}Windows Fix:${C.RESET} Run this in PowerShell as Admin:`);
|
|
713
|
+
console.log(` ${C.CYAN}icacls . /grant \${env:USERNAME}:(OI)(CI)F /T${C.RESET}`);
|
|
714
|
+
} else {
|
|
715
|
+
console.log(` ${C.BRIGHT}macOS/Linux Fix:${C.RESET} Run this command:`);
|
|
716
|
+
console.log(` ${C.CYAN}sudo chown -R $(whoami) .${C.RESET}`);
|
|
717
|
+
}
|
|
718
|
+
} else {
|
|
719
|
+
console.log(` ✅ All critical directories are accessible`);
|
|
720
|
+
}
|
|
684
721
|
console.log("");
|
|
685
722
|
|
|
686
723
|
console.log(`${C.BRIGHT}Summary:${C.RESET}`);
|