deflake 1.2.31 → 1.2.32
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 +6 -7
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -116,10 +116,8 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '') {
|
|
|
116
116
|
return 0;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
//
|
|
120
|
-
const
|
|
121
|
-
const errorContextCount = (capturedOutput.match(/Error Context:/g) || []).length;
|
|
122
|
-
console.log(`${C.GRAY}📊 Captured output: ${capturedOutput.length} chars, Error Context lines: ${errorContextCount}, has 'at ': ${capturedOutput.includes(' at ')}${C.RESET}`);
|
|
119
|
+
// Strip ANSI escape codes from captured output — they break regex matching
|
|
120
|
+
const cleanOutput = capturedOutput.replace(/\x1b\[[0-9;]*m/g, '');
|
|
123
121
|
|
|
124
122
|
console.log(`${C.BRIGHT}🔍 Analyzing ${artifacts.length} failure(s)...${C.RESET}\n`);
|
|
125
123
|
let count = 0;
|
|
@@ -133,10 +131,11 @@ async function analyzeAndFix(artifacts, client, argv, capturedOutput = '') {
|
|
|
133
131
|
let loc = extractLoc(content);
|
|
134
132
|
let locSource = 'error-context.md';
|
|
135
133
|
|
|
136
|
-
if (!loc &&
|
|
134
|
+
if (!loc && cleanOutput) {
|
|
137
135
|
// Extract the relevant section from captured output for this artifact
|
|
138
|
-
const relevantOutput = extractRelevantOutput(
|
|
139
|
-
|
|
136
|
+
const relevantOutput = extractRelevantOutput(cleanOutput, art.name);
|
|
137
|
+
console.log(` ${C.GRAY}🔬 Relevant output: ${relevantOutput.length} chars for artifact${C.RESET}`);
|
|
138
|
+
loc = extractLoc(relevantOutput || cleanOutput);
|
|
140
139
|
locSource = 'console output';
|
|
141
140
|
}
|
|
142
141
|
|