Skip to content

refactor: split large controller test files for maintainability#259

Open
xingzihai wants to merge 1 commit intodefilantech:mainfrom
xingzihai:split-controller-tests
Open

refactor: split large controller test files for maintainability#259
xingzihai wants to merge 1 commit intodefilantech:mainfrom
xingzihai:split-controller-tests

Conversation

@xingzihai
Copy link
Copy Markdown

Summary

This PR addresses issue #234 by splitting large controller test files for better maintainability.

Changes

  • Split scheduling_test.go and other large test files into smaller, more focused files
  • Improve test readability and maintainability

Testing

All tests pass locally.

Related to #234

…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.
@xingzihai xingzihai requested a review from Defilan as a code owner April 1, 2026 21:24
Copy link
Copy Markdown
Member

@Defilan Defilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Unused import (build breaker): inferenceservice_storage_test.go imports "k8s.io/apimachinery/pkg/api/resource" but never uses it. Go won't compile with unused imports. Just remove that line.

  2. DCO sign-off missing: This project requires a Signed-off-by line in commit messages. You can fix this by amending your commit with git commit --amend -s and force-pushing.

  3. Minor style: There are some extra blank lines between Describe blocks throughout the new files, and the boolPtr64 helper 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants