Add CI workflow and Makefile target for unit tests#861
Conversation
The support package (tests/common/support) has 13 unit test files that validate shared test helpers using fake Kubernetes clients. These were not being run in CI. Add a GitHub Actions workflow and a `make unit-test` target to cover them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThis PR introduces automated unit testing for support packages. A new GitHub Actions workflow ( Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/go-unit-test.yml:
- Line 22: Replace tag-based action references with full commit SHAs: locate the
workflow steps that use actions via tag refs (e.g., the uses entry
"actions/checkout@v4" and any other "uses: ...@vX" like the one on line 24) and
update them to pin to the corresponding full commit SHA for that action
repository; ensure every uses: entry in the file references a commit SHA instead
of a tag and verify the SHAs match the trusted release commits for
actions/checkout and any other third-party actions.
- Line 22: The checkout step currently uses actions/checkout@v4 without
disabling credential persistence; update the checkout invocation (the step using
actions/checkout@v4) to include persist-credentials: false so the GITHUB_TOKEN
is not written to .git/config and cannot be reused by subsequent steps or
actions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: f5a3b5af-1697-4031-9739-678e8cf31dcb
📒 Files selected for processing (2)
.github/workflows/go-unit-test.ymlMakefile
Description
.github/workflows/go-unit-test.ymlthat runsgo test ./tests/common/support/...on PRs and pushes to mainmake unit-testMakefile target for local convenienceWhy
The support package has 13 unit test files that validate shared helpers (fake clients, resource builders, environment getters, etc.). A regression here could silently break assumptions across all e2e test suites.
How Has This Been Tested?
go test ./tests/common/support/...passed locallyMerge criteria:
Summary by CodeRabbit