deflake 1.0.6 → 1.0.7
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 +12 -8
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -658,11 +658,6 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
658
658
|
process.stdout.write(`\r⏳ Analyzing ${art.name}... `);
|
|
659
659
|
const result = await runHealer(specificLog, art.htmlPath, argv.apiUrl, art.name);
|
|
660
660
|
|
|
661
|
-
if (result && result.status === 'error' && result.detail === 'QUOTA_EXCEEDED') {
|
|
662
|
-
console.log(`\n${C.RED}🛑 Quota exceeded! Stopping.${C.RESET}`);
|
|
663
|
-
break;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
661
|
if (result && result.status === 'success') {
|
|
667
662
|
results.push(result);
|
|
668
663
|
|
|
@@ -670,15 +665,18 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
670
665
|
if (argv.fix) {
|
|
671
666
|
await applySelfHealing(result);
|
|
672
667
|
}
|
|
668
|
+
} else {
|
|
669
|
+
console.log(`\n ${C.RED}❌ Analysis failed for ${art.name}:${C.RESET} ${result?.detail || 'Check server status'}`);
|
|
673
670
|
}
|
|
674
671
|
}
|
|
675
|
-
|
|
672
|
+
process.stdout.write("\r✅ Analysis complete. \n");
|
|
676
673
|
|
|
677
674
|
// GROUPING & PRINTING
|
|
678
675
|
const groups = {};
|
|
679
676
|
for (const res of results) {
|
|
680
|
-
|
|
681
|
-
const
|
|
677
|
+
// Use a unique key for grouping. If location is missing, use testName to ensure it shows up.
|
|
678
|
+
const locId = res.location ? `${res.location.rootFile}:${res.location.rootLine}` : `unknown-${res.testName}`;
|
|
679
|
+
const key = `${locId}|${JSON.stringify(res.fix)}`;
|
|
682
680
|
if (!groups[key]) {
|
|
683
681
|
groups[key] = { location: res.location, sourceCode: res.sourceCode, fix: res.fix, tests: [] };
|
|
684
682
|
}
|
|
@@ -694,6 +692,12 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
694
692
|
for (const key of sortedKeys) {
|
|
695
693
|
printDetailedFix(groups[key].fix, groups[key].location, groups[key].sourceCode);
|
|
696
694
|
}
|
|
695
|
+
|
|
696
|
+
if (results.length > 0 && sortedKeys.length === 0) {
|
|
697
|
+
console.log(`${C.YELLOW}⚠️ Note: Some suggestions were found but could not be grouped for display.${C.RESET}`);
|
|
698
|
+
} else if (results.length === 0) {
|
|
699
|
+
console.log(`${C.GRAY}ℹ️ DeFlake analyzed the logs but couldn't find a confident fix for these errors.${C.RESET}`);
|
|
700
|
+
}
|
|
697
701
|
}
|
|
698
702
|
|
|
699
703
|
async function main() {
|