deflake 1.2.0 â 1.2.2
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 +11 -3
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -734,6 +734,9 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
const framework = artifacts.length > 0 && artifacts[0].htmlPath?.includes('cypress') ? 'Cypress' : 'Playwright';
|
|
737
|
+
const results = [];
|
|
738
|
+
const processLimit = Math.min(artifacts.length, limit);
|
|
739
|
+
const batchArtifacts = artifacts.slice(0, processLimit);
|
|
737
740
|
|
|
738
741
|
console.log(`đ Analyzing ${batchArtifacts.length} failure(s)...`);
|
|
739
742
|
|
|
@@ -797,9 +800,12 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
797
800
|
const key = `${locId}|${fixCode.trim()}`;
|
|
798
801
|
|
|
799
802
|
if (!groups[key]) {
|
|
800
|
-
groups[key] = { ...res, count: 0 };
|
|
803
|
+
groups[key] = { ...res, count: 0, locations: [] };
|
|
801
804
|
}
|
|
802
805
|
groups[key].count++;
|
|
806
|
+
if (res.location) {
|
|
807
|
+
groups[key].locations.push(res.location);
|
|
808
|
+
}
|
|
803
809
|
}
|
|
804
810
|
|
|
805
811
|
const finalGroups = Object.values(groups);
|
|
@@ -808,9 +814,11 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
808
814
|
console.log(`${C.GRAY}âšī¸ Suggested for ${group.count} similar failures:${C.RESET}`);
|
|
809
815
|
}
|
|
810
816
|
|
|
811
|
-
// APPLY FIX (
|
|
817
|
+
// APPLY FIX (To all instances in the group)
|
|
812
818
|
if (argv.fix) {
|
|
813
|
-
|
|
819
|
+
for (const loc of group.locations) {
|
|
820
|
+
await applySelfHealing({ ...group, location: loc });
|
|
821
|
+
}
|
|
814
822
|
}
|
|
815
823
|
|
|
816
824
|
printDetailedFix(group.fix, group.location, group.source_code, argv.fix);
|