Skip to content

Support swift-testing warnings#2244

Merged
plemarquand merged 3 commits into
swiftlang:mainfrom
plemarquand:swift-testing-warnings
May 25, 2026
Merged

Support swift-testing warnings#2244
plemarquand merged 3 commits into
swiftlang:mainfrom
plemarquand:swift-testing-warnings

Conversation

@plemarquand
Copy link
Copy Markdown
Contributor

@plemarquand plemarquand commented May 21, 2026

Implement support for SE-0013 (issue severity warnings), swift-testing emits issues with severity "warning" and isFailure: false. These were previously dropped silently by the JSON event stream parser.

Route warning-severity issues through a new recordWarning path that publishes them via TestRun.appendOutput (with location-linked yellow text in the editor view) and as DiagnosticSeverity.Warning entries in a "swift-test-warnings" DiagnosticCollection (for editor squiggles and the Problems panel). Tests with only warnings continue to pass; tests with both a warning and a failing issue still fail.

Tasks

  • Required tests have been written
  • Documentation has been updated
  • Added an entry to CHANGELOG.md if applicable

Implement support for SE-0013 (issue severity warnings),
swift-testing emits issues with severity "warning" and
`isFailure: false`. These were previously dropped silently
by the JSON event stream parser.

Route warning-severity issues through a new `recordWarning` path that
publishes them via `TestRun.appendOutput` (with location-linked yellow
text in the editor view) and as `DiagnosticSeverity.Warning` entries
in a "swift-test-warnings" `DiagnosticCollection` (for editor squiggles
and the Problems panel). Tests with only warnings continue to pass;
tests with both a warning and a failing issue still fail.
@plemarquand
Copy link
Copy Markdown
Contributor Author

Screenshot 2026-05-21 at 9 32 20 AM

@plemarquand plemarquand changed the title Surface swift-testing warnings without failing tests Support swift-testing warnings May 21, 2026
Comment thread src/TestExplorer/TestParsers/SwiftTestingOutputParser.ts
this.warningDiagnosticUris.add(location.uri.toString());
}

private clearWarningDiagnostics() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK how readily this proxy object is available but ideally swift.clearDiagnosticsCollection command would also call this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would that clear all diagnostics? I want to just clear the swift-testing warning diagnostics

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just meant when swift.clearDiagnosticsCollection is called, can we clear these swift-testing ones as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you mean now. I've updated the patch

@plemarquand plemarquand merged commit f68b80d into swiftlang:main May 25, 2026
29 checks passed
@plemarquand plemarquand deleted the swift-testing-warnings branch May 25, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants