-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(coverage): implement automated coverage validation tool (#14098) #14134
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
base: main
Are you sure you want to change the base?
feat(coverage): implement automated coverage validation tool (#14098) #14134
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (27.69%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #14134 +/- ##
==========================================
- Coverage 92.24% 91.91% -0.34%
==========================================
Files 657 659 +2
Lines 41068 41281 +213
==========================================
+ Hits 37884 37944 +60
- Misses 2179 2321 +142
- Partials 1005 1016 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
From a quick look: IMHO, the command would be better off in |
8a7394e to
a3a4353
Compare
…lemetry#14098) Key features: - Validates stable components meet 80% coverage minimum - Supports repository-wide minimum via CLI flag - Allows components to set higher requirements in metadata.yaml - Integrated into existing CI workflow - Includes unit tests and comprehensive documentation Fixes open-telemetry#14098 Signed-off-by: SACHIN KUMAR <[email protected]>
- Added comprehensive unit tests for validator.go - Created main_test.go for CLI testing - Added coverage_minimum validation tests in status_test.go - Improved test coverage for error paths, edge cases, and verbose mode - Coverage breakdown: * LoadCoverage: 95.6% * ValidateComponents: 91.7% * findMetadataFiles: 92.3% * validateComponent: 92.0% * getModulePath: 90.0% * run: 93.3% Total improvement: +59.6 percentage points
Addresses PR feedback from @dmathieu: - Move checkcover from cmd/ to internal/cmd/ (not needed as public tool) - Remove committed binary from git tracking - Add binary to .gitignore to prevent future commits Changes: - Moved cmd/checkcover -> internal/cmd/checkcover - Updated module path in go.mod - Updated CI workflow to reference new path - Updated documentation references - Added checkcover binaries to .gitignore - All tests passing
a99551c to
b7b86cd
Compare
Description
This PR implements automated code coverage validation for OpenTelemetry Collector components as outlined in issue #14098. The new
checkcovertool enforces coverage requirements based on component stability levels and integrates seamlessly into the existing CI pipeline.Key Features:
--repo-minimum)coverage_minimumin metadata.yamlLink to tracking issue
Addresses #14066 (Automate validation and fulfillment of criteria outlined in the "Component Stability" document)
Fixes #14098 (Validate and enforce test coverage requirements)
Testing
checkcovertool (validator_test.go)Documentation
cmd/checkcover/README.md- Usage guide and examplesdocs/coverage-requirements.md- Component author guidelinesCOVERAGE_VALIDATION_IMPLEMENTATION.md- Technical documentationcmd/mdatagen/metadata-schema.yamlwithcoverage_minimumfield description