• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubeflow / sdk / 28860538716
83%

Build:
DEFAULT BRANCH: main
Ran 07 Jul 2026 10:50AM UTC
Jobs 2
Files 89
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Jul 2026 10:49AM UTC coverage: 83.273% (+0.3%) from 82.969%
28860538716

push

github

web-flow
fix(trainer): serialize TorchTune dtype/loss enums by value, add unit tests for get_args_using_torchtune_config and get_trainer_cr_from_builtin_trainer (#416)

* chore(trainer): add unit tests for get_args_using_torchtune_config and get_trainer_cr_from_builtin_trainer

Add comprehensive unit tests for two previously untested utility functions
in kubeflow/trainer/backends/kubernetes/utils.py:

- test_get_args_using_torchtune_config: 8 parametrized test cases covering
  empty config, dtype only, all scalar fields (dtype/batch_size/epochs/loss),
  LoRA peft_config, dataset_preprocess_config, HuggingFace dataset URIs
  (directory and file paths via initializer), and invalid dtype error.

- test_get_trainer_cr_from_builtin_trainer: 4 parametrized test cases
  covering num_nodes with batch_size, resources_per_node, empty config,
  and invalid config type error.

These functions had zero test coverage. The new tests follow existing
patterns in the file using TestCase dataclass and pytest.mark.parametrize.

Signed-off-by: Prabhaharan Velu <haranprabha.v@gmail.com>

* fix(trainer): serialize TorchTune dtype/loss enums by value; address review

get_args_using_torchtune_config interpolated the DataType/Loss enum members
directly (e.g. "dtype=DataType.BF16"), so torchtune received the enum repr
instead of the intended value ("dtype=bf16",
"loss=torchtune.modules.loss.CEWithChunkedOutputLoss"). Use .value for both.

Tests:
- Assert literal produced strings for dtype/loss instead of reusing the
  implementation's f-string, which made the assertions tautological.
- Add a nested-directory dataset URI case covering the data_dir branch with
  a non-trivial relative path.
- Add a num_nodes=0 case pinning the `if config.num_nodes:` boundary.
- Add a case threading an initializer through get_trainer_cr_from_builtin_trainer
  and asserting the dataset arg lands in trainer_cr.args.

Signed-off-by: Prabhaharan Velu <haranprabha.v@gmail.com>

* test(trainer): update builtin t... (continued)

28 of 28 new or added lines in 2 files covered. (100.0%)

5048 of 6062 relevant lines covered (83.27%)

1.67 hits per line

Jobs
ID Job ID Ran Files Coverage
1 python-3.11 - 28860538716.1 07 Jul 2026 10:50AM UTC 89
83.27
GitHub Action Run
2 python-3.10 - 28860538716.2 07 Jul 2026 10:50AM UTC 89
83.27
GitHub Action Run
Source Files on build 28860538716
  • Tree
  • List 89
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28860538716
  • 0fe9bb73 on github
  • Prev Build on main (#28807460836)
  • Next Build on main (#28942921718)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc