Strengthen action pin mapping spec coverage and assertion rigor in pkg/actionpins#45340
Merged
pelikhan merged 3 commits intoJul 14, 2026
Merged
Conversation
7 tasks
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve test quality in pkg/actionpins/spec_test.go
Strengthen action pin mapping spec coverage and assertion rigor in Jul 13, 2026
pkg/actionpins
Contributor
There was a problem hiding this comment.
Pull request overview
Strengthens pkg/actionpins test coverage and assertion precision.
Changes:
- Covers unknown and malformed action-pin mapping targets.
- Improves ordering assertions and test fixture organization.
- Aligns spec tests with current behavior.
Show a summary per file
| File | Description |
|---|---|
pkg/actionpins/spec_test.go |
Adds unknown-target coverage and reorganizes fixtures. |
pkg/actionpins/actionpins_internal_test.go |
Tightens assertions and tests malformed mappings. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
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.
pkg/actionpins/spec_test.gohad identified test-quality gaps around mapping edge cases, assertion strictness, and test organization. This update tightens the spec tests to cover unmapped/invalid mapping targets more explicitly and improves failure signal in internal table assertions.Coverage: mapping edge cases
TestSpec_PublicAPI_ResolveActionPin_MappingTargetUnknownto verify mapped-to-unknown repos resolve to an empty result without panic.TestApplyActionPinMapping_TargetWithoutRefSeparatorSkippedto verify mapping targets missing@refare ignored.Assertion quality improvements
assert.Equalcalls withrequire.Equalafterrequire.LeninTestBuildByRepoIndex_GroupsByRepoAndSortsDescending, improving fail-fast behavior and reducing misleading follow-on failures.Spec/readability cleanup
testSHAResolvernear the top ofspec_test.go(after constants) for easier fixture discovery.SPEC_MISMATCHcomment locations by asserting current implementation behavior directly in tests.