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.
Files changed (2) hide show
  1. package/cli.js +18 -12
  2. 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 = 5;
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()} | Quota: ${usage.usage}/${usage.limit}`);
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
- // Use a unique key for grouping. If location is missing, use testName to ensure it shows up.
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}|${JSON.stringify(res.fix)}`;
779
+ const key = `${locId}|${fixCode.trim()}`;
780
+
775
781
  if (!groups[key]) {
776
- groups[key] = { location: res.location, sourceCode: res.sourceCode, fix: res.fix, tests: [] };
782
+ groups[key] = { ...res, count: 0 };
777
783
  }
778
- groups[key].tests.push(res.testName);
784
+ groups[key].count++;
779
785
  }
780
786
 
781
- const sortedKeys = Object.keys(groups);
782
-
783
- if (sortedKeys.length > 0) {
784
- for (const key of sortedKeys) {
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 remaining: ${C.GREEN}${remaining}/${u.limit}${C.RESET}`);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deflake",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "AI-powered self-healing tool for Playwright, Cypress, and WebdriverIO tests.",
5
5
  "main": "client.js",
6
6
  "bin": {