4/edit ci pipeline to account for 100 code coverage#7
Merged
Conversation
Added to the ci-build.yaml file to make sure it looks for 100% coverage when a test job is run.
Update Branch
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the CI pipeline to enforce 100% code coverage on all pull requests. The build will now fail if coverage falls below 100%, ensuring high code quality standards.
- Replaces simple test execution with coverage-enabled testing that excludes specific directories
- Adds strict 100% coverage validation that fails the build if not met
- Integrates Codecov reporting for detailed coverage analysis
Comments suppressed due to low confidence (2)
.github/workflows/ci-build.yaml:17
- Go version 1.24.x does not exist. The latest Go version as of my knowledge cutoff is 1.22.x. Please use a valid Go version like '1.22.x' or '1.21.x'.
go-version: '1.24.x'
.github/workflows/ci-build.yaml:56
- Go version 1.24.x does not exist. The latest Go version as of my knowledge cutoff is 1.22.x. Please use a valid Go version like '1.22.x' or '1.21.x'.
go-version: '1.24.x'
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Made some additional fixes to the ci-build.yaml file. Now it checks to makes sure that there is a tests/config.yaml file and that the excluded directories exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new check to the CI pipeline to enforce 100% code coverage on all new pull requests.
Changes
I've modified the ci-build.yaml file to include a new step that fails the build if the total code coverage percentage is anything less than 100%.
Key updates in the workflow
Test with Coverage: The go test command now uses the -coverprofile=coverage.out flag to generate a coverage report. It also dynamically excludes specific files and directories from the coverage calculation based on a list in tests/config.yaml.
Check 100% coverage: A new step was added to parse the coverage.out file. It extracts the total coverage percentage and uses a shell script to enforce that the value is exactly 100.0. If it's not, the build will fail.
Upload coverage report: The workflow now uploads the coverage.out file to Codecov for detailed analysis.