mirror of
https://github.com/hanzo-ml/trainer.git
synced 2026-09-24 00:31:34 +00:00
* test(util): add unit tests for trainingruntime and trainjob utilities Fixes #3152 pkg/util/trainingruntime (0 percent to 100 percent coverage): - New trainingruntime_test.go with 8 cases for IsSupportDeprecated covering nil, empty, absent key, wrong value, empty value, correct deprecated, multiple labels, and partial match edge case. pkg/util/trainjob (extended): - TestRuntimeRefIsClusterTrainingRuntime: 4 new edge cases added covering wrong APIGroup, nil APIGroup, nil Kind, both nil. - TestIsTrainJobFinished: 6 new cases covering all condition states. - Added metav1 import required for Condition status constants. Signed-off-by: Yugendhar S <[email protected]> * chore(test): address review feedback from andreyvelich - Remove year from Copyright headers in both test files - Add trailing newline at end of both files - Fix error message format in TestRuntimeRefIsTrainingRuntime to use 'FunctionName(%v) = %v, want %v' pattern for consistency - Add nil edge cases to TestRuntimeRefIsTrainingRuntime for symmetry with TestRuntimeRefIsClusterTrainingRuntime (nil APIGroup, nil Kind, both nil, wrong APIGroup) Signed-off-by: Yugendhar S <[email protected]> * chore(test): fix line endings and formatting for CI Signed-off-by: Yugendhar S <[email protected]> --------- Signed-off-by: Yugendhar S <[email protected]>