Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case in scheduler/profile/profile_test.go #90201

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 43 additions & 0 deletions pkg/scheduler/profile/profile_test.go
Expand Up @@ -82,6 +82,20 @@ func TestNewProfile(t *testing.T) {
},
wantErr: "at least one bind plugin is needed",
},
{
name: "one queue sort plugin required for profile",
cfg: config.KubeSchedulerProfile{
SchedulerName: "profile-1",
Plugins: &config.Plugins{
Bind: &config.PluginSet{
Enabled: []config.Plugin{
{Name: "Bind1"},
},
},
},
},
wantErr: "no queue sort plugin is enabled",
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand Down Expand Up @@ -273,6 +287,35 @@ func TestNewMap(t *testing.T) {
},
wantErr: "duplicate profile",
},
{
name: "scheduler name is needed",
cfgs: []config.KubeSchedulerProfile{
{
Plugins: &config.Plugins{
QueueSort: &config.PluginSet{
Enabled: []config.Plugin{
{Name: "QueueSort"},
},
},
Bind: &config.PluginSet{
Enabled: []config.Plugin{
{Name: "Bind1"},
},
},
},
},
},
wantErr: "scheduler name is needed",
},
{
name: "plugins required for profile",
cfgs: []config.KubeSchedulerProfile{
{
SchedulerName: "profile-1",
},
},
wantErr: "plugins required for profile",
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand Down