Skip to content

Commit ce10d30

Browse files
committed
fix: use caseCount for parameterized test progress in both event parsers
recordTestCaseResult in xcodebuild-event-parser hardcoded += 1 for all count increments, ignoring the caseCount field from parameterized Swift Testing results. Also made the XCTest fallback path in the Swift Testing event parser consistent.
1 parent 3c7fe5f commit ce10d30

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/utils/swift-testing-event-parser.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ export function createSwiftTestingEventParser(
147147
// XCTest: Test Case '...' passed/failed (for mixed output from `swift test`)
148148
const xcTestCase = parseTestCaseLine(line);
149149
if (xcTestCase) {
150-
completedCount += 1;
150+
const xcIncrement = xcTestCase.caseCount ?? 1;
151+
completedCount += xcIncrement;
151152
if (xcTestCase.status === 'failed') {
152-
failedCount += 1;
153+
failedCount += xcIncrement;
153154
}
154155
if (xcTestCase.status === 'skipped') {
155-
skippedCount += 1;
156+
skippedCount += xcIncrement;
156157
}
157158
emitTestProgress();
158159
return;

src/utils/xcodebuild-event-parser.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,20 @@ export function createXcodebuildEventParser(options: EventParserOptions): Xcodeb
234234
suiteName?: string;
235235
testName?: string;
236236
durationText?: string;
237+
caseCount?: number;
237238
}): void {
238-
completedCount += 1;
239+
const increment = testCase.caseCount ?? 1;
240+
completedCount += increment;
239241
if (testCase.status === 'failed') {
240-
failedCount += 1;
242+
failedCount += increment;
241243
applyFailureDuration(
242244
testCase.suiteName,
243245
testCase.testName,
244246
parseDurationMs(testCase.durationText),
245247
);
246248
}
247249
if (testCase.status === 'skipped') {
248-
skippedCount += 1;
250+
skippedCount += increment;
249251
}
250252
emitTestProgress();
251253
}

0 commit comments

Comments
 (0)