pkg/announce
: make interface functions public and add tests
#3596
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.
What type of PR is this?
After refactoring
pkg/announce
in #3580, this is the first wave of tests to validate that the new packages work properly. I didn't want to have all tests in one PR (as that will result in a very large diff to review), and I was hoping to get some feedback on my approach before committing to work on additional tests.In this PR:
k8s.io/release/pkg/announce.Announce
are made public, because otherwise they can't be used for mock tests. I'm not sure why I chose them to be private in the first place.CreateForRelease
method to ensure that empty data (empty changelog HTML or Go version) is caught.Overall,
CreateForBranch
andCreateForRelease
are very simple methods, but this adds test coverage nonetheless. If this is looking good, I will move on to the sub-packages inpkg/announce
in future PRs./kind cleanup
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?