Skip to content

Commit 7c13ea9

Browse files
committed
fix: remove dead noise patterns and rename durationText to displayDurationText on ParsedTotals
The Resolve Package Graph and Resolved source packages noise patterns were unreachable dead code -- resolveStageFromLine matches them first and returns a build-stage event. Renamed ParsedTotals.durationText to displayDurationText to make clear it's a display string not parseable by parseDurationMs (the XCTest totals format is '1.234 (1.235) seconds' which doesn't parse).
1 parent ce10d30 commit 7c13ea9

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/utils/__tests__/swift-testing-line-parsers.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ describe('Swift Testing line parsers', () => {
200200
expect(result).toEqual({
201201
executed: 6,
202202
failed: 1,
203-
durationText: '0.001s',
203+
displayDurationText: '0.001s',
204204
});
205205
});
206206

@@ -211,7 +211,7 @@ describe('Swift Testing line parsers', () => {
211211
expect(result).toEqual({
212212
executed: 5,
213213
failed: 0,
214-
durationText: '0.003s',
214+
displayDurationText: '0.003s',
215215
});
216216
});
217217

@@ -222,7 +222,7 @@ describe('Swift Testing line parsers', () => {
222222
expect(result).toEqual({
223223
executed: 5,
224224
failed: 3,
225-
durationText: '0.001s',
225+
displayDurationText: '0.001s',
226226
});
227227
});
228228

src/utils/swift-testing-line-parsers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function parseSwiftTestingRunSummary(line: string): ParsedTotals | null {
140140
}
141141

142142
const total = Number(match[1]);
143-
const durationText = `${match[2]}s`;
143+
const displayDurationText = `${match[2]}s`;
144144

145145
// Swift Testing reports "issues" not "failed tests" -- a single test can produce
146146
// multiple issues (e.g. multiple #expect failures). This is the best available
@@ -150,7 +150,7 @@ export function parseSwiftTestingRunSummary(line: string): ParsedTotals | null {
150150
const issueMatch = line.match(/with (\d+) issues?/u);
151151
const failed = issueMatch ? Number(issueMatch[1]) : 0;
152152

153-
return { executed: total, failed, durationText };
153+
return { executed: total, failed, displayDurationText };
154154
}
155155

156156
/**

src/utils/xcodebuild-event-parser.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ const IGNORED_NOISE_PATTERNS = [
7474
/^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d+\s+xcodebuild\[.+\]\s+Writing error result bundle to\s+/u,
7575
/^Build settings from command line:$/u,
7676
/^(?:COMPILER_INDEX_STORE_ENABLE|ONLY_ACTIVE_ARCH)\s*=\s*.+$/u,
77-
/^Resolve Package Graph$/u,
78-
/^Resolved source packages:$/u,
7977
/^\s*[A-Za-z0-9_.-]+:\s+https?:\/\/.+$/u,
8078
/^--- xcodebuild: WARNING: Using the first of multiple matching destinations:$/u,
8179
/^\{\s*platform:.+\}$/u,

src/utils/xcodebuild-line-parsers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface ParsedTestCase {
3232
export interface ParsedTotals {
3333
executed: number;
3434
failed: number;
35-
durationText?: string;
35+
displayDurationText?: string;
3636
}
3737

3838
export interface ParsedFailureDiagnostic {
@@ -104,7 +104,7 @@ export function parseTotalsLine(line: string): ParsedTotals | null {
104104
if (!match) {
105105
return null;
106106
}
107-
return { executed: Number(match[1]), failed: Number(match[2]), durationText: match[3] };
107+
return { executed: Number(match[1]), failed: Number(match[2]), displayDurationText: match[3] };
108108
}
109109

110110
export function parseFailureDiagnostic(line: string): ParsedFailureDiagnostic | null {

0 commit comments

Comments
 (0)