From 14a589b1223caf67be71b2a0afd5cd9197a4e3dd Mon Sep 17 00:00:00 2001 From: Joachim Bartosik Date: Thu, 9 May 2019 16:53:07 +0200 Subject: [PATCH] Drop an uninteresting test I think it's useful to revers condtions in the tests when dropping capping to limits to make sure are the relevant code is gone. I don't think it's an useful test to keep around. --- .../pkg/utils/vpa/capping_test.go | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/vertical-pod-autoscaler/pkg/utils/vpa/capping_test.go b/vertical-pod-autoscaler/pkg/utils/vpa/capping_test.go index e0ad3d342a83..ad80dff1f5dc 100644 --- a/vertical-pod-autoscaler/pkg/utils/vpa/capping_test.go +++ b/vertical-pod-autoscaler/pkg/utils/vpa/capping_test.go @@ -47,47 +47,6 @@ func TestRecommendationNotAvailable(t *testing.T) { assert.Empty(t, res.ContainerRecommendations) } -func TestRecommendationNotCappedToLimit(t *testing.T) { - pod := test.Pod().WithName("pod1").AddContainer(test.BuildTestContainer("ctr-name", "", "")).Get() - pod.Spec.Containers[0].Resources.Limits = - apiv1.ResourceList{ - apiv1.ResourceCPU: *resource.NewScaledQuantity(3, 1), - apiv1.ResourceMemory: *resource.NewScaledQuantity(7000, 1), - } - - podRecommendation := vpa_types.RecommendedPodResources{ - ContainerRecommendations: []vpa_types.RecommendedContainerResources{ - { - ContainerName: "ctr-name", - Target: apiv1.ResourceList{ - apiv1.ResourceCPU: *resource.NewScaledQuantity(10, 1), - apiv1.ResourceMemory: *resource.NewScaledQuantity(8000, 1), - }, - UpperBound: apiv1.ResourceList{ - apiv1.ResourceCPU: *resource.NewScaledQuantity(2, 1), - apiv1.ResourceMemory: *resource.NewScaledQuantity(9000, 1), - }, - }, - }, - } - policy := vpa_types.PodResourcePolicy{} - - res, annotations, err := NewCappingRecommendationProcessor().Apply(&podRecommendation, &policy, nil, pod) - assert.Nil(t, err) - assert.Equal(t, apiv1.ResourceList{ - apiv1.ResourceCPU: *resource.NewScaledQuantity(10, 1), - apiv1.ResourceMemory: *resource.NewScaledQuantity(8000, 1), - }, res.ContainerRecommendations[0].Target) - - assert.NotContains(t, annotations, "ctr-name") - assert.NotContains(t, annotations["ctr-name"], "memory capped to container limit") - - assert.Equal(t, apiv1.ResourceList{ - apiv1.ResourceCPU: *resource.NewScaledQuantity(2, 1), - apiv1.ResourceMemory: *resource.NewScaledQuantity(9000, 1), - }, res.ContainerRecommendations[0].UpperBound) -} - func TestRecommendationCappedToMinMaxPolicy(t *testing.T) { pod := test.Pod().WithName("pod1").AddContainer(test.BuildTestContainer("ctr-name", "", "")).Get() podRecommendation := vpa_types.RecommendedPodResources{