Files
trainer/pkg
Yugendhar SandGitHub 557d8c1bbd chore(test): add unit tests for trainingruntime and trainjob utilities (#3370)
* 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]>
2026-05-11 22:33:04 +00:00
..
2026-05-08 12:38:28 +00:00
2026-05-08 12:38:28 +00:00