Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions pkg/scheduler/framework/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4540,7 +4540,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
dummyScorePluginNameA := fmt.Sprintf(dummyAllPurposePluginNameFormat, 6)
dummyScorePluginNameB := fmt.Sprintf(dummyAllPurposePluginNameFormat, 7)

clusters := []fleetv1beta1.MemberCluster{
clusters := []clusterv1beta1.MemberCluster{
{
ObjectMeta: metav1.ObjectMeta{
Name: clusterName,
Expand All @@ -4558,7 +4558,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
},
}

policy := &fleetv1beta1.ClusterSchedulingPolicySnapshot{
policy := &placementv1beta1.ClusterSchedulingPolicySnapshot{
ObjectMeta: metav1.ObjectMeta{
Name: policyName,
},
Expand All @@ -4585,7 +4585,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
postBatchPlugins: []PostBatchPlugin{
&DummyAllPurposePlugin{
name: dummyPostBatchPluginNameA,
postBatchRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (size int, status *Status) {
postBatchRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (size int, status *Status) {
return 0, FromError(fmt.Errorf("internal error"), dummyFilterPluginNameA)
},
},
Expand All @@ -4599,7 +4599,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
preFilterPlugins: []PreFilterPlugin{
&DummyAllPurposePlugin{
name: dummyPreFilterPluginNameA,
preFilterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
preFilterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
return FromError(fmt.Errorf("internal error"), dummyPreFilterPluginNameA)
},
},
Expand All @@ -4613,7 +4613,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
filterPlugins: []FilterPlugin{
&DummyAllPurposePlugin{
name: dummyFilterPluginNameA,
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (status *Status) {
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (status *Status) {
return FromError(fmt.Errorf("internal error"), dummyFilterPluginNameA)
},
},
Expand All @@ -4627,7 +4627,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
preScorePlugins: []PreScorePlugin{
&DummyAllPurposePlugin{
name: dummyPreScorePluginNameA,
preScoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
preScoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
return FromError(fmt.Errorf("internal error"), dummyPreScorePluginNameA)
},
},
Expand All @@ -4641,7 +4641,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
scorePlugins: []ScorePlugin{
&DummyAllPurposePlugin{
name: dummyScorePluginNameA,
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
return nil, FromError(fmt.Errorf("internal error"), dummyScorePluginNameA)
},
},
Expand All @@ -4658,15 +4658,15 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
preScorePlugins: []PreScorePlugin{
&DummyAllPurposePlugin{
name: dummyPreScorePluginNameA,
preScoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
preScoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
return nil
},
},
},
scorePlugins: []ScorePlugin{
&DummyAllPurposePlugin{
name: dummyScorePluginNameA,
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
switch cluster.Name {
case clusterName:
return &ClusterScore{
Expand All @@ -4687,7 +4687,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
},
&DummyAllPurposePlugin{
name: dummyScorePluginNameB,
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
switch cluster.Name {
case clusterName:
return &ClusterScore{
Expand Down Expand Up @@ -4747,15 +4747,15 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
preFilterPlugins: []PreFilterPlugin{
&DummyAllPurposePlugin{
name: dummyPreFilterPluginNameA,
preFilterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
preFilterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
return nil
},
},
},
filterPlugins: []FilterPlugin{
&DummyAllPurposePlugin{
name: dummyFilterPluginNameA,
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (status *Status) {
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (status *Status) {
switch cluster.Name {
case clusterName:
return NewNonErrorStatus(ClusterUnschedulable, dummyFilterPluginNameA)
Expand All @@ -4768,7 +4768,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
},
&DummyAllPurposePlugin{
name: dummyFilterPluginNameB,
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (status *Status) {
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (status *Status) {
if cluster.Name == altClusterName {
return NewNonErrorStatus(ClusterUnschedulable, dummyFilterPluginNameB)
}
Expand All @@ -4780,7 +4780,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
scorePlugins: []ScorePlugin{
&DummyAllPurposePlugin{
name: dummyScorePluginNameA,
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
return nil, FromError(fmt.Errorf("internal error"), dummyScorePluginNameA)
},
},
Expand Down Expand Up @@ -4812,29 +4812,29 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
postBatchPlugins: []PostBatchPlugin{
&DummyAllPurposePlugin{
name: dummyPostBatchPluginNameA,
postBatchRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (size int, status *Status) {
postBatchRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (size int, status *Status) {
return 1, nil
},
},
&DummyAllPurposePlugin{
name: dummyPostBatchPluginNameB,
postBatchRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (size int, status *Status) {
postBatchRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (size int, status *Status) {
return 2, nil
},
},
},
preFilterPlugins: []PreFilterPlugin{
&DummyAllPurposePlugin{
name: dummyPreFilterPluginNameA,
preFilterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
preFilterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
return nil
},
},
},
filterPlugins: []FilterPlugin{
&DummyAllPurposePlugin{
name: dummyFilterPluginNameA,
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (status *Status) {
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (status *Status) {
if cluster.Name == clusterName {
return NewNonErrorStatus(ClusterUnschedulable, dummyFilterPluginNameA)
}
Expand All @@ -4843,23 +4843,23 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
},
&DummyAllPurposePlugin{
name: dummyFilterPluginNameB,
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (status *Status) {
filterRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (status *Status) {
return nil
},
},
},
preScorePlugins: []PreScorePlugin{
&DummyAllPurposePlugin{
name: dummyPreScorePluginNameA,
preScoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
preScoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot) (status *Status) {
return nil
},
},
},
scorePlugins: []ScorePlugin{
&DummyAllPurposePlugin{
name: dummyScorePluginNameA,
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
switch cluster.Name {
case clusterName:
return nil, FromError(fmt.Errorf("internal error"), dummyScorePluginNameA)
Expand All @@ -4878,7 +4878,7 @@ func TestRunAllPluginsForPickNPlacementType(t *testing.T) {
},
&DummyAllPurposePlugin{
name: dummyScorePluginNameB,
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *fleetv1beta1.ClusterSchedulingPolicySnapshot, cluster *fleetv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
scoreRunner: func(ctx context.Context, state CycleStatePluginReadWriter, policy *placementv1beta1.ClusterSchedulingPolicySnapshot, cluster *clusterv1beta1.MemberCluster) (score *ClusterScore, status *Status) {
switch cluster.Name {
case clusterName:
return nil, FromError(fmt.Errorf("internal error"), dummyScorePluginNameB)
Expand Down