refactor: split large controller test files for maintainability#259
refactor: split large controller test files for maintainability#259xingzihai wants to merge 1 commit intodefilantech:mainfrom
Conversation
…lantech#234) Split inferenceservice_controller_test.go (2982 lines) into: - inferenceservice_reconcile_test.go — core reconciliation tests - inferenceservice_deployment_test.go — deployment construction tests - inferenceservice_storage_test.go — storage config tests (cached, emptyDir, PVC) - inferenceservice_service_test.go — service construction tests - inferenceservice_scheduling_test.go — GPU queue / priority tests All files stay in the controller package and use the same suite_test.go setup. Fixed unused imports in each split file.
Defilan
left a comment
There was a problem hiding this comment.
Really appreciate you jumping in on this, @xingzihai! Splitting the test files is something that's been on the backlog for a while and this is a solid contribution. I verified all 23 test blocks and both helper functions are accounted for with nothing dropped. The file organization follows exactly what was outlined in #234, which is great to see.
CI is failing on a few things that should be quick to fix:
-
Unused import (build breaker):
inferenceservice_storage_test.goimports"k8s.io/apimachinery/pkg/api/resource"but never uses it. Go won't compile with unused imports. Just remove that line. -
DCO sign-off missing: This project requires a
Signed-off-byline in commit messages. You can fix this by amending your commit withgit commit --amend -sand force-pushing. -
Minor style: There are some extra blank lines between Describe blocks throughout the new files, and the
boolPtr64helper comment got removed. Not blockers but worth cleaning up if you're already making changes.
Once the unused import and DCO sign-off are fixed, this is good to merge. Thanks again for contributing!
Summary
This PR addresses issue #234 by splitting large controller test files for better maintainability.
Changes
scheduling_test.goand other large test files into smaller, more focused filesTesting
All tests pass locally.
Related to #234