swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
755 stars 54 forks source link

Run tests with code coverage #894

Closed plemarquand closed 4 months ago

plemarquand commented 4 months ago

To help identify poorly tested areas of the extension, run the tests with code coverage. Coverage is reported in the terminal as text as well as stored in the /coverage directory as HTML.

In CI results can be seen in the terminal at the end of the test run. Locally when running tests in the docker containers HTML coverage results will appear in the /coverage folder after the run completes.

plemarquand commented 4 months ago

In the future it would be nice to have the HTML report captured as a Jenkins artifact, and to have the CI bot comment back on the PR with coverage numbers that link to this HTML report, but for now we'll have to make due with reporting inline at the end of the build output.

A further improvement would be to have a final step in the build pipeline that collects all coverage artifacts across all the platforms/toolchains and merges the results together so we have a single report that gives a complete picture of test coverage across all platforms.

plemarquand commented 4 months ago

@swift-server-bot test this please

plemarquand commented 4 months ago

@swift-server-bot test this please