-
Notifications
You must be signed in to change notification settings - Fork 77
Use native VSCode coverage APIs, cover swift-testing tests #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use native VSCode coverage APIs, cover swift-testing tests #807
Conversation
b171b9b
to
8af5e10
Compare
aa0fe65
to
6c0aa09
Compare
48d2dca
to
12613c9
Compare
Move to the new VSCode coverage APIs that were introduced in VSCode version 1.88. This allows us to remove the coverage renderer and coverage report files. This functionality is now built in to the test explorer and VSCode's document rendering. This patch also adds support for producing test coverage from swift-testing tests. XCTests and swift-testing tests are each run in their respective binaries and then the coverage data is merged into a profdata file before being exported to LCOV format. Finally we transform the LCOV JSON into the coverage structures for VSCode and associate this data with the test run.
Refactor common debug config creation
Instead of a build followed by a test run with --skip-build, use a SwiftExecution task to do swift test with the appropriate arguments. This shows the build progress in the status bar.
12613c9
to
4c44a38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how ready this is for review, but I can get the coverage view to appear now which looks nice, I don't get inline rendering of coverage in the text editor though. Outside of coverage, parallel testing crashes VSCode which is quite impressive and debugging tests doesn't work anymore.
I think you are going to need to reimplement the two phase build and test instead of relying on swift test
to do everything (outside of coverage testing), because you cannot use swift test
when debugging tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of minor things, otherwise I think we're pretty much there
bf0e5d8
to
1c3a35d
Compare
686c1d6
to
40a6ff2
Compare
Use a combination of the xunit xml output and the test output to capture test pass/fail state and issues.
40a6ff2
to
b78d7a2
Compare
2aff937
to
1a0a3a3
Compare
@adam-fowler thanks for taking such a thorough look. I think everything should be addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good
Move to the new VSCode coverage APIs that were introduced in VSCode version 1.88. This allows us to remove the coverage renderer and coverage report files. This functionality is now built in to the test explorer and VSCode's document rendering.
This patch also adds support for producing test coverage from swift-testing tests. XCTests and swift-testing tests are each run in their respective binaries and then the coverage data is merged into a profdata file before being exported to LCOV format.
Finally we transform the LCOV JSON into the coverage structures for VSCode and associate this data with the test run.