Uh oh!
There was an error while loading. Please reload this page.
test(home): cover realProbeEnv discovery (live/degraded/no-release) via the cluster-load seam - #250
Merged
Merged
Conversation
realProbeEnv was 35% — it called cluster.Load / cluster.NewClientset directly, so tests could only reach the ownership-gate and load-failure returns; the release discovery (the core of the bare-`tracebloc` screen) was dark. Route it through the existing loadClusterFn / newClientsetFn seam (both default to the real helpers → zero behavior change) so a fake clientset can drive discovery. - TestRealProbeEnv_Discovery: live (ready jobs-manager + Ready node -> localLive + compute), degraded (jobs-manager ReadyReplicas 0 -> localDegraded), no-release (empty cluster -> localNoRelease). Ownership gate + load failure stay covered by TestRealProbeEnv_OwnershipGate. - withClusterSeams now sets RestConfig (realProbeEnv sets RestConfig.Timeout); additive, its resolveClusterTarget users don't read it (all pass). make ci green. Follow-up: runClusterInfo/runClusterDoctor still call cluster.Load directly — their routing + post-discovery tests next. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 14, 2026
ContributorAuthor
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4ef436e. Configure here.
saadqbal
approved these changes
Jul 14, 2026
saadqbal
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 👍 Clean seam routing — and good that you set RestConfig: &rest.Config{} in withClusterSeams, since realProbeEnv now sets .Timeout on it through the seam. The live/degraded/no-release split is asserted right.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Summary
Fourth increment from the CLI test-coverage audit — the home-screen environment probe's discovery paths.
realProbeEnvwas 35%: it calledcluster.Load/cluster.NewClientsetdirectly, so a test could only reach the ownership-gate and load-failure returns — the actual release discovery (the core of the default bare-traceblocscreen) was dark.Production change (seam — zero behavior change)
realProbeEnvnow routes through the existingloadClusterFn/newClientsetFnseam instead of callingcluster.Load/cluster.NewClientsetdirectly (both default to the real helpers, so production is unchanged). This lets a fake clientset drive discovery.Test
TestRealProbeEnv_Discovery(new) — drives the three discovered states with a fake clientset:localLive, release name resolved, compute surfaced;ReadyReplicas 0) →localDegraded;localNoRelease.TestRealProbeEnv_OwnershipGate.withClusterSeamsnow setsRestConfig—realProbeEnvdoesresolved.RestConfig.Timeout = …, so the seam's fakeResolvedConfigneeded a non-nilRestConfig. Additive; its existingresolveClusterTargetusers don't read it (all their tests still pass).Not in this PR (follow-up)
runClusterInfo(cluster.go:134) andrunClusterDoctor(doctor.go:99) still callcluster.Loaddirectly. Their routing + post-discovery tests (which also need aMintIngestorTokenreactor + printing assertions) are the next increment.Test plan
make cigreen (build,-race, gofmt, lint, schema). New probe tests + the existingresolveClusterTargettests (which sharewithClusterSeams) all pass.🤖 Generated with Claude Code
Note
Low Risk
Test-only seam wiring with production defaults unchanged; no auth, data, or user-facing behavior changes.
Overview
Adds test coverage for the home screen’s
realProbeEnvrelease discovery paths, which were previously hard to exercise because kubeconfig load went straight tocluster.Load/cluster.NewClientset.realProbeEnvnow calls the sameloadClusterFn/newClientsetFnhooks asresolveClusterTarget(still defaulting to the real helpers in production).TestRealProbeEnv_Discoverydrives a fake clientset through live (ready jobs-manager + node →localLive+ compute), degraded (jobs-manager not ready →localDegraded), and no release (localNoRelease).withClusterSeamsnow supplies a non-nilRestConfigon the fakeResolvedConfigso tests don’t panic when the probe setsRestConfig.Timeout.Reviewed by Cursor Bugbot for commit 4ef436e. Bugbot is set up for automated code reviews on this repo. Configure here.