feat: add unit test and coverage check workflows#232
Merged
xgerman merged 2 commits intodocumentdb:mainfrom Feb 13, 2026
Merged
feat: add unit test and coverage check workflows#232xgerman merged 2 commits intodocumentdb:mainfrom
xgerman merged 2 commits intodocumentdb:mainfrom
Conversation
Collaborator
hossain-rayhan
commented
Feb 5, 2026
- Add test-unit.yml to run Go unit tests on PRs and pushes to main
- Add test-unit-coverage.yml to enforce 90% coverage on new lines
- Both workflows only trigger on Go code changes in operator/src/
- Skip docs, shell scripts, and non-Go files
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds two new GitHub Actions workflows to automate unit testing and coverage enforcement for the DocumentDB Kubernetes Operator. The workflows integrate seamlessly with the existing test infrastructure by triggering on Go code changes in the operator/src directory.
Changes:
- Added test-unit.yml to run unit tests with race detection on all PRs and pushes to main
- Added test-unit-coverage.yml to enforce 90% coverage threshold on newly added lines in PRs
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/test-unit.yml | Runs Go unit tests with race detection, go vet, and test summary on PR and main branch changes |
| .github/workflows/test-unit-coverage.yml | Enforces 90% coverage on new code using go-patch-cover-action with diff analysis |
alaye-ms
approved these changes
Feb 13, 2026
added 2 commits
February 13, 2026 10:38
- Add test-unit.yml to run Go unit tests on PRs and pushes to main - Add test-unit-coverage.yml to enforce 90% coverage on new lines - Both workflows only trigger on Go code changes in operator/src/ - Skip docs, shell scripts, and non-Go files
Signed-off-by: Rayhan Hossain <rhossain@microsoft.com>
0c3bb65 to
fcaed4d
Compare
alaye-ms
approved these changes
Feb 13, 2026
xgerman
approved these changes
Feb 13, 2026
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.