Repository navigation
Conversation
Add missing test files for untested source files (clusterinfo.go, route.go, output.go, collector.go), add t.Run subtests to all table-driven tests that were missing them for better failure diagnostics, consolidate duplicate test helpers into a shared testhelper_test.go with functional options, unify the two nearly identical factory helpers in kube/client_test.go, and consolidate 12 individual test functions in namespace/filter_test.go into 4 table-driven tests. Assisted-by: Claude
|
PR images are available (for 1 week):
|
PR Summary by QodoExpand Go test coverage and standardize table-driven tests
AI Description
Diagram
High-Level Assessment
Files changed (14)
|
Code Review by Qodo
1.
|
|
PR images are available (for 1 week):
|
Use v1alpha5 (the currently served Backstage CRD version) instead of v1alpha3 in TestResolveCRDType fixtures, and assert the resolved GVR version field in both subtests to verify the full return value. Assisted-by: Claude
|
PR images are available (for 1 week):
|
|
/hold Will use #435 to verify coverage diff upload in Codecov. |
|
/cherrypick release-2.1 |
|
@rm3l: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
Improve Go test idiomaticness across the codebase:
clusterinfo.go,route.go,output.go, andcollector.go— coveringwriteYAML,ClusterInfo.Run,getString,Route.Run(with/without Route API),setGVK,writeResource,writeCollectError,knownGroupKinds,listResourceNames,resolveCRDType,Config.IsInterrupted,Config.Namespaces,Config.ShouldInclude,Config.ApplyLogSince, andRegistrycompletenesst.Runsubtests to all table-driven tests that were missing them (TestIsRHDHRelated,TestMatchesInstance,TestHumanSize,TestMatchesAnyPattern,TestOwnerRefKind,TestHeapDumpMethodValidation,TestIsSecretDocument) for precise failure diagnosticstesthelper_test.go) with functional options (withAPIGroups,withTypedObjs,withDynamicObjs,withInterrupted), replacing duplicated fake-client setup acrossplatform_test.go,clusterinfo_test.go,route_test.go, andoutput_test.gokube/client_test.go(newTestClient+newTestClientWithVersions→ singlenewTestClient) and consolidateTestHasAPIGroup_*into a table-driven testnamespace/filter_test.go(12 functions → 4 table-driven tests)Which issue(s) does this PR fix or relate to
PR acceptance criteria
How to test changes / Special notes to the reviewer
All changes are test-only. Run
make testandmake lint— both pass cleanly. No production code was modified.🤖 Generated with Claude Code