-
Notifications
You must be signed in to change notification settings - Fork 3
Coverage report #18
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?
Coverage report #18
Conversation
Signed-off-by: sandhi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds test coverage reporting for Go unit tests by redirecting test output to a file and uploading it as a GitHub Actions artifact.
Changes:
- Redirects Go test output to a quality report file
- Adds a new GitHub Actions step to upload the test coverage artifact
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if: ${{ inputs.language == 'go' && inputs.unit-tests == true && inputs.build-profile == 'cli' }} | ||
| run: | | ||
| go test -v ./... | ||
| go test -v ./... > ${{ inputs.quality-junit-report }} |
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redirecting test output with > will lose stderr and won't capture actual coverage data. The command should use -coverprofile flag to generate proper coverage output (e.g., go test -v -coverprofile=coverage.out ./...), and consider using tee if you need both console output and file output.
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| # Name of the artifact to upload. | ||
| name: test-coverage.out |
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The artifact name 'test-coverage.out' is misleading since the captured output is test results in text format, not actual coverage data. Consider renaming to 'test-output' or 'test-results' to accurately reflect the content.
| name: test-coverage.out | |
| name: test-results |
| if: ${{ inputs.language == 'go' && inputs.unit-tests == true && inputs.build-profile == 'cli' }} | ||
| run: | | ||
| go test -v ./... | ||
| go test -v ./... > ${{ inputs.quality-junit-report }} |
Copilot
AI
Jan 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output is being redirected to quality-junit-report but go test with -v produces plain text output, not JUnit XML format. To generate JUnit reports, you need a tool like gotestsum or go-junit-report to convert the output.
Description
Added a small step to create the go unit test case coverage file and upload it
Related Issue
Types of changes
Checklist:
Gemfile.lockhas changed, I have used--conservativeto do it and included the full output in the Description above.