Repository navigation
chore: Convert the outdated Helm chart and semver tests to Ginkgo - #2038
Merged
gianlucam76 merged 1 commit intoOct 15, 2026
Merged
Conversation
The only tests of the controllers package still using plain testing.T now use Ginkgo and Gomega like the rest of the package. They move to package controllers_test, and what they need from unexported code is exposed through export_test.go. The test of a chart which could not be checked uses an httptest server which is closed, instead of relying on nothing listening on port 1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Follow-up to #2036.
helmchart_outdated_check_test.goandhelmchart_semver_test.gowere the only tests incontrollersstill written with plaintesting.T. They now use Ginkgo and Gomega like the rest of the package.The tests move from
package controllerstopackage controllers_test. What they need from unexported code is exposed throughexport_test.go, behind small exported types and functions that keep the unexported types (helmChartKey,outdatedHelmChartMetricKey,releaseInfo) out of the tests:CollectHelmChartRefs,HelmChartVersionDiff,SetResolvedHelmChartIdentity, and anOutdatedHelmCharttype with helpers to set, run and inspect the outdated state of a chart.The cases are the same as before: collecting chart references (conflict, unresolved identity as a table, grouping across ClusterSummaries), resolving the chart identity, the version diff table, and the four whole-pass cases of #2036 (deleted ClusterSummary, chart removed from the profile, chart that could not be checked, chart up to date).
One change in behavior of the tests: the "chart that could not be checked" case now uses an
httptestserver which is closed before the pass, instead of relying on nothing listening on port 1. The fetch still fails immediately, and it no longer depends on how the runner treats that port.Testing: the 18 specs pass (
-ginkgo.focus "Outdated Helm chart check|Helm chart version diff"),make lintreports 0 issues. Reverting the fix of #2036 makes the deleted-ClusterSummary spec fail.🤖 Generated with Claude Code