Skip to content

chore(optimizer): Add unit tests for Optimizer KubernetesBackend#334

Open
ruskaruma wants to merge 2 commits intokubeflow:mainfrom
ruskaruma:test/optimizer-kubernetes-backend1
Open

chore(optimizer): Add unit tests for Optimizer KubernetesBackend#334
ruskaruma wants to merge 2 commits intokubeflow:mainfrom
ruskaruma:test/optimizer-kubernetes-backend1

Conversation

@ruskaruma
Copy link
Contributor

What this PR does / why we need it:
Adds unit tests for the Optimizer KubernetesBackend, covering all 8 public methods: optimize, list_jobs, get_job, get_job_logs, get_best_results, wait_for_job_status, delete_job, and get_job_events. Addresses
review feedback from #224 which went stale.

Also renames the existing test_optimize (input mutation test) to test_optimize_no_input_mutation to avoid name collision with the new test_optimize that verifies Experiment CR creation.

Which issue(s) this PR fixes:
Fixes #126

Checklist:

  • Unit tests included (30 tests, all passing)
  • Docs included if any changes are user facing

Copilot AI review requested due to automatic review settings February 26, 2026 18:55
@google-oss-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign astefanutti for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ruskaruma ruskaruma changed the title test(optimizer): Add unit tests for Optimizer KubernetesBackend (#126) chore(optimizer): Add unit tests for Optimizer KubernetesBackend Feb 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds comprehensive unit tests for Optimizer’s KubernetesBackend to cover all public methods and expands mocked Kubernetes/Katib interactions to support those scenarios.

Changes:

  • Added fixtures + mock handlers to simulate Katib Experiment/Trial CRUD, events, and logs.
  • Added new parametrized tests covering optimize, job lifecycle methods, logs, results, polling, deletion, and events.
  • Renamed prior test_optimize to test_optimize_no_input_mutation to avoid a name collision.

Signed-off-by: ruskaruma <ishaan.sinha10@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create unit tests for the OptimizerClient()

2 participants