Skip to content

Conversation

itsomri
Copy link
Collaborator

@itsomri itsomri commented Sep 18, 2025

Added the infra to test the podgroupcontroller in env-tests. Added one sanity test as example.

Copy link

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/KAI-scheduler/cmd/binder 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/cmd/binder/app 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/app 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers 47.52% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests 73.86% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/binder 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/podgroupcontroller 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/KAI-scheduler/cmd/binder/app/options.go 0.00% (ø) 23 (+1) 0 23 (+1)
github.com/NVIDIA/KAI-scheduler/cmd/binder/main.go 0.00% (ø) 28 0 28
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/app/app.go 0.00% (ø) 30 (-5) 0 30 (-5)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/app/options.go 0.00% (ø) 11 (+1) 0 11 (+1)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/main.go 0.00% (ø) 10 (+7) 0 10 (+7)
github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers/bindrequest_controller.go 69.07% (ø) 97 67 30
github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers/pod_controller.go 0.00% (ø) 44 0 44
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/binder/binder.go 0.00% (ø) 23 (+2) 0 23 (+2)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/podgroupcontroller/podgroupcontroller.go 0.00% (ø) 9 (+9) 0 9 (+9)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/NVIDIA/KAI-scheduler/pkg/env-tests/podgroupcontroller_test.go
  • github.com/NVIDIA/KAI-scheduler/pkg/env-tests/scheduler_test.go

@itsomri itsomri enabled auto-merge (squash) September 18, 2025 11:30
@itsomri itsomri requested a review from Copilot September 18, 2025 12:14
Copy link

@Copilot 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

This PR adds infrastructure to test the PodGroupController in env-tests and includes a basic sanity test demonstrating the functionality.

Key Changes

  • Created test infrastructure for running PodGroupController in test environments
  • Added binder integration for complete pod lifecycle testing
  • Implemented a sanity test that verifies PodGroup status updates when pods are bound

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/env-tests/podgroupcontroller_test.go New test file with PodGroupController test infrastructure and sanity test
pkg/env-tests/podgroupcontroller/podgroupcontroller.go New helper module to run PodGroupController in test context
pkg/env-tests/binder/binder.go Updated binder helper to accept configurable flag sets
pkg/env-tests/scheduler_test.go Removed empty line formatting issue
pkg/binder/controllers/*.go Added SkipNameValidation configuration for test compatibility
cmd/podgroupcontroller/main.go Refactored main function to support programmatic execution
cmd/podgroupcontroller/app/*.go Modified app structure to accept external configuration and context
cmd/binder/app/options.go Made InitOptions accept optional flag set parameter

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@itsomri itsomri force-pushed the omric/podgroupcontroller-env-tests branch from cf45ae8 to 857f379 Compare September 19, 2025 09:30
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/KAI-scheduler/cmd/binder 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/cmd/binder/app 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/app 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers 47.52% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests 73.86% (+1.14%) 👍
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/binder 0.00% (ø)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/podgroupcontroller 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/KAI-scheduler/cmd/binder/app/options.go 0.00% (ø) 23 (+1) 0 23 (+1)
github.com/NVIDIA/KAI-scheduler/cmd/binder/main.go 0.00% (ø) 28 0 28
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/app/app.go 0.00% (ø) 30 (-5) 0 30 (-5)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/app/options.go 0.00% (ø) 11 (+1) 0 11 (+1)
github.com/NVIDIA/KAI-scheduler/cmd/podgroupcontroller/main.go 0.00% (ø) 10 (+7) 0 10 (+7)
github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers/bindrequest_controller.go 69.07% (ø) 97 67 30
github.com/NVIDIA/KAI-scheduler/pkg/binder/controllers/pod_controller.go 0.00% (ø) 44 0 44
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/binder/binder.go 0.00% (ø) 23 (+2) 0 23 (+2)
github.com/NVIDIA/KAI-scheduler/pkg/env-tests/podgroupcontroller/podgroupcontroller.go 0.00% (ø) 9 (+9) 0 9 (+9)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/NVIDIA/KAI-scheduler/pkg/env-tests/podgroupcontroller_test.go
  • github.com/NVIDIA/KAI-scheduler/pkg/env-tests/scheduler_test.go

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.

1 participant