deflake 1.1.3 → 1.1.5
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 +18 -12
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -703,11 +703,11 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
703
703
|
if (result.status === 'success') {
|
|
704
704
|
const usage = result.data;
|
|
705
705
|
tier = usage.tier || 'free';
|
|
706
|
-
if (tier === 'free') limit =
|
|
706
|
+
if (tier === 'free') limit = 10;
|
|
707
707
|
else if (tier === 'pro') limit = 50;
|
|
708
708
|
else if (tier === 'master' || tier === 'byok') limit = 100;
|
|
709
709
|
|
|
710
|
-
console.log(`🎫 Subscription: ${tier.toUpperCase()} |
|
|
710
|
+
console.log(`🎫 Subscription: ${tier.toUpperCase()} | Monthly Usage: ${usage.usage}/${usage.limit}`);
|
|
711
711
|
}
|
|
712
712
|
|
|
713
713
|
if (artifacts.length > limit) {
|
|
@@ -769,21 +769,27 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
769
769
|
// GROUPING & PRINTING
|
|
770
770
|
const groups = {};
|
|
771
771
|
for (const res of results) {
|
|
772
|
-
|
|
772
|
+
let fixCode = res.fix;
|
|
773
|
+
try {
|
|
774
|
+
const p = JSON.parse(res.fix);
|
|
775
|
+
if (p.code) fixCode = p.code;
|
|
776
|
+
} catch (e) { }
|
|
777
|
+
|
|
773
778
|
const locId = res.location ? `${res.location.rootFile}:${res.location.rootLine}` : `unknown-${res.testName}`;
|
|
774
|
-
const key = `${locId}|${
|
|
779
|
+
const key = `${locId}|${fixCode.trim()}`;
|
|
780
|
+
|
|
775
781
|
if (!groups[key]) {
|
|
776
|
-
groups[key] = {
|
|
782
|
+
groups[key] = { ...res, count: 0 };
|
|
777
783
|
}
|
|
778
|
-
groups[key].
|
|
784
|
+
groups[key].count++;
|
|
779
785
|
}
|
|
780
786
|
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
printDetailedFix(groups[key].fix, groups[key].location, groups[key].sourceCode, argv.fix);
|
|
787
|
+
const finalGroups = Object.values(groups);
|
|
788
|
+
for (const group of finalGroups) {
|
|
789
|
+
if (group.count > 1) {
|
|
790
|
+
console.log(`${C.GRAY}ℹ️ Suggested for ${group.count} similar failures:${C.RESET}`);
|
|
786
791
|
}
|
|
792
|
+
printDetailedFix(group.fix, group.location, group.source_code, argv.fix);
|
|
787
793
|
}
|
|
788
794
|
|
|
789
795
|
// SUMMARY
|
|
@@ -797,7 +803,7 @@ async function analyzeFailures(artifacts, fullLog, client) {
|
|
|
797
803
|
if (updatedUsage.status === 'success') {
|
|
798
804
|
const u = updatedUsage.data;
|
|
799
805
|
const remaining = u.limit - u.usage;
|
|
800
|
-
console.log(` - Quota
|
|
806
|
+
console.log(` - Monthly Quota: ${C.GREEN}${remaining}/${u.limit} remaining${C.RESET}`);
|
|
801
807
|
}
|
|
802
808
|
} catch (e) {
|
|
803
809
|
// usage fetch failed is non-critical
|