mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-07-17 02:04:40 +00:00
TestHPAAnalyzerWithExistingScaleTargetRefWithoutSpecifyingResources placed
its "if !errorFound { t.Error(...) }" assertion inside the outer
"for _, analysis := range analysisResults" loop. When the analyzer emits
zero results (exactly the regression this test guards against, the
"does not have resource configured." detection breaking), the outer loop
body never runs, the assertion is skipped, and the test passes green.
Move the assertion after the outer loop and break out of it once the error
is found, matching the sibling HPA tests (TestHPAAnalyzerWithUnsuportedScaleTargetRef,
TestHPAAnalyzerWithNonExistentScaleTargetRef). Also drop the dead break that
sat inside the inner loop after its own break. Test-only change.
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
Co-authored-by: Alex Jones <1235925+AlexsJones@users.noreply.github.com>