Skip to content

Commit aebd9b5

Browse files
committed
Split captured output
1 parent 715ac69 commit aebd9b5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/TestExplorer/TestParsers/SwiftTestingOutputParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class SwiftTestingOutputParser {
211211

212212
rl.on("line", line => this.parse(JSON.parse(line), runState));
213213

214-
await reader.start(readlinePipe);
214+
void reader.start(readlinePipe);
215215
}
216216

217217
/**

src/TestExplorer/TestRunner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ export class TestRunner {
729729
// discarded. If the test run has already started this is a no-op so its safe to call it multiple times.
730730
this.testRun.testRunStarted();
731731

732-
await this.swiftTestOutputParser.close();
732+
void this.swiftTestOutputParser.close();
733733
}
734734
} finally {
735735
outputStream.end();

test/integration-tests/testexplorer/TestExplorerIntegration.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { Commands } from "../../../src/commands";
5050
import { executeTaskAndWaitForResult } from "../../utilities/tasks";
5151
import { createBuildAllTask } from "../../../src/tasks/SwiftTaskProvider";
5252
import { FolderContext } from "../../../src/FolderContext";
53+
import { lineBreakRegex } from "../../../src/utilities/tasks";
5354

5455
suite("Test Explorer Suite", function () {
5556
const MAX_TEST_RUN_TIME_MINUTES = 5;
@@ -261,9 +262,12 @@ suite("Test Explorer Suite", function () {
261262
// in the middle of the print, so the last line is actually end end of our
262263
// huge string. If they fix this in future this `find` ensures the test wont break.
263264
const needle = "100000";
264-
const lastTenLines = testRun.runState.output.slice(-10).join("\n");
265+
const output = testRun.runState.output.flatMap(o =>
266+
o.split(lineBreakRegex).filter(o => !!o)
267+
);
268+
const lastTenLines = output.slice(-10).join("\n");
265269
assertContainsTrimmed(
266-
testRun.runState.output,
270+
output,
267271
needle,
268272
`Expected all test output to be captured, but it was truncated. Last 10 lines of output were: ${lastTenLines}`
269273
);

0 commit comments

Comments
 (0)