Skip to content
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

Add coverage reporting to integration testing framework #4772

Open
blakerouse opened this issue May 16, 2024 · 2 comments
Open

Add coverage reporting to integration testing framework #4772

blakerouse opened this issue May 16, 2024 · 2 comments
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing

Comments

@blakerouse
Copy link
Contributor

It is possible to build a golang binary with coverage reporting enabled [1]. That will allow the integration tests to run the actual elastic-agent binary and have it report its coverage report. The coverage report should then be copied back to the developer or CI machine.

This would really help provide true coverage of the Elastic Agent repository with both unit and integration tests.

[1] https://go.dev/doc/build-cover

@blakerouse blakerouse added bug Something isn't working Testing Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team and removed bug Something isn't working labels May 16, 2024
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@ycombinator
Copy link
Contributor

ycombinator commented May 17, 2024

I believe if these reports land in the following folder/files, SonarQube should start picking them up and reporting more accurate stats for code that gets integration-tested but not unit-tested:

sonar.go.coverage.reportPaths=**/build/TEST-*.cov

Related: https://go.dev/doc/build-cover#converting-to-legacy-text-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing
Projects
None yet
Development

No branches or pull requests

3 participants