Skip to content

Run tests with code coverage #894

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

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

plemarquand
Copy link
Contributor

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
Copy link
Contributor Author

plemarquand commented Jun 13, 2024

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 plemarquand marked this pull request as ready for review June 13, 2024 17:11
Copy link
Contributor

@award999 award999 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@matthewbastien matthewbastien left a comment

Choose a reason for hiding this comment

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

lgtm. Would be nice if there was a way to get our tests to show up in the Testing View with code coverage, but we could look into that later.

@plemarquand
Copy link
Contributor Author

@swift-server-bot test this please

@plemarquand
Copy link
Contributor Author

@swift-server-bot test this please

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.
@award999 award999 merged commit c40200b into swiftlang:main Jun 14, 2024
8 checks passed
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.

4 participants