mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #64059 from wgliang/master.rename-controller-unit-test
Automatic merge from submit-queue (batch tested with PRs 64034, 64072, 64146, 64059, 64161). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fixing wrong unit test naming of (pkg/controller/podautoscaler) **What this PR does / why we need it**: /kind cleanup Fixing wrong unit test naming of (pkg/controller/podautoscaler). Unit tests will not be executed, function name of _test.go file must start with Test*. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
0ba60a3eed
@ -525,7 +525,7 @@ func (tc *legacyTestCase) runTest(t *testing.T) {
|
||||
tc.verifyResults(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUp(t *testing.T) {
|
||||
func TestLegacyScaleUp(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -540,7 +540,7 @@ func LegacyTestScaleUp(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpUnreadyLessScale(t *testing.T) {
|
||||
func TestLegacyScaleUpUnreadyLessScale(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -557,7 +557,7 @@ func LegacyTestScaleUpUnreadyLessScale(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpUnreadyNoScale(t *testing.T) {
|
||||
func TestLegacyScaleUpUnreadyNoScale(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -574,7 +574,7 @@ func LegacyTestScaleUpUnreadyNoScale(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpDeployment(t *testing.T) {
|
||||
func TestLegacyScaleUpDeployment(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -594,7 +594,7 @@ func LegacyTestScaleUpDeployment(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpReplicaSet(t *testing.T) {
|
||||
func TestLegacyScaleUpReplicaSet(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -614,7 +614,7 @@ func LegacyTestScaleUpReplicaSet(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpCM(t *testing.T) {
|
||||
func TestLegacyScaleUpCM(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -636,7 +636,7 @@ func LegacyTestScaleUpCM(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpCMUnreadyLessScale(t *testing.T) {
|
||||
func TestLegacyScaleUpCMUnreadyLessScale(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -659,7 +659,7 @@ func LegacyTestScaleUpCMUnreadyLessScale(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
|
||||
func TestLegacyScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -682,7 +682,7 @@ func LegacyTestScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleDown(t *testing.T) {
|
||||
func TestLegacyScaleDown(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -697,7 +697,7 @@ func LegacyTestScaleDown(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleDownCM(t *testing.T) {
|
||||
func TestLegacyScaleDownCM(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -719,7 +719,7 @@ func LegacyTestScaleDownCM(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleDownIgnoresUnreadyPods(t *testing.T) {
|
||||
func TestLegacyScaleDownIgnoresUnreadyPods(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -841,7 +841,7 @@ func LegacyTestMaxReplicas(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestSuperfluousMetrics(t *testing.T) {
|
||||
func TestLegacySuperfluousMetrics(t *testing.T) {
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
maxReplicas: 6,
|
||||
@ -1023,7 +1023,7 @@ func LegacyTestComputedToleranceAlgImplementation(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleUpRCImmediately(t *testing.T) {
|
||||
func TestLegacyScaleUpRCImmediately(t *testing.T) {
|
||||
time := metav1.Time{Time: time.Now()}
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
@ -1039,7 +1039,7 @@ func LegacyTestScaleUpRCImmediately(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestScaleDownRCImmediately(t *testing.T) {
|
||||
func TestLegacyScaleDownRCImmediately(t *testing.T) {
|
||||
time := metav1.Time{Time: time.Now()}
|
||||
tc := legacyTestCase{
|
||||
minReplicas: 2,
|
||||
|
@ -227,7 +227,7 @@ func (tc *legacyReplicaCalcTestCase) runTest(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcDisjointResourcesMetrics(t *testing.T) {
|
||||
func TestLegacyReplicaCalcDisjointResourcesMetrics(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 1,
|
||||
expectedError: fmt.Errorf("no metrics returned matched known pods"),
|
||||
@ -243,7 +243,7 @@ func LegacyTestReplicaCalcDisjointResourcesMetrics(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleUp(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleUp(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 5,
|
||||
@ -260,7 +260,7 @@ func LegacyTestReplicaCalcScaleUp(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleUpUnreadyLessScale(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleUpUnreadyLessScale(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 4,
|
||||
@ -278,7 +278,7 @@ func LegacyTestReplicaCalcScaleUpUnreadyLessScale(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleUpUnreadyNoScale(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleUpUnreadyNoScale(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 3,
|
||||
@ -296,7 +296,7 @@ func LegacyTestReplicaCalcScaleUpUnreadyNoScale(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleUpCM(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleUpCM(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 4,
|
||||
@ -310,7 +310,7 @@ func LegacyTestReplicaCalcScaleUpCM(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleUpCMUnreadyLessScale(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleUpCMUnreadyLessScale(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 4,
|
||||
@ -325,7 +325,7 @@ func LegacyTestReplicaCalcScaleUpCMUnreadyLessScale(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 3,
|
||||
@ -340,7 +340,7 @@ func LegacyTestReplicaCalcScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleDown(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleDown(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 5,
|
||||
expectedReplicas: 3,
|
||||
@ -357,7 +357,7 @@ func LegacyTestReplicaCalcScaleDown(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleDownCM(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleDownCM(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 5,
|
||||
expectedReplicas: 3,
|
||||
@ -371,7 +371,7 @@ func LegacyTestReplicaCalcScaleDownCM(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcScaleDownIgnoresUnreadyPods(t *testing.T) {
|
||||
func TestLegacyReplicaCalcScaleDownIgnoresUnreadyPods(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 5,
|
||||
expectedReplicas: 2,
|
||||
@ -389,7 +389,7 @@ func LegacyTestReplicaCalcScaleDownIgnoresUnreadyPods(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcTolerance(t *testing.T) {
|
||||
func TestLegacyReplicaCalcTolerance(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 3,
|
||||
@ -406,7 +406,7 @@ func LegacyTestReplicaCalcTolerance(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcToleranceCM(t *testing.T) {
|
||||
func TestLegacyReplicaCalcToleranceCM(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 3,
|
||||
@ -420,7 +420,7 @@ func LegacyTestReplicaCalcToleranceCM(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcSuperfluousMetrics(t *testing.T) {
|
||||
func TestLegacyReplicaCalcSuperfluousMetrics(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 4,
|
||||
expectedReplicas: 24,
|
||||
@ -436,7 +436,7 @@ func LegacyTestReplicaCalcSuperfluousMetrics(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetrics(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetrics(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 4,
|
||||
expectedReplicas: 3,
|
||||
@ -453,7 +453,7 @@ func LegacyTestReplicaCalcMissingMetrics(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcEmptyMetrics(t *testing.T) {
|
||||
func TestLegacyReplicaCalcEmptyMetrics(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 4,
|
||||
expectedError: fmt.Errorf("unable to get metrics for resource cpu: no metrics returned from heapster"),
|
||||
@ -468,7 +468,7 @@ func LegacyTestReplicaCalcEmptyMetrics(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcEmptyCPURequest(t *testing.T) {
|
||||
func TestLegacyReplicaCalcEmptyCPURequest(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 1,
|
||||
expectedError: fmt.Errorf("missing request for"),
|
||||
@ -483,7 +483,7 @@ func LegacyTestReplicaCalcEmptyCPURequest(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetricsNoChangeEq(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetricsNoChangeEq(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 2,
|
||||
expectedReplicas: 2,
|
||||
@ -500,7 +500,7 @@ func LegacyTestReplicaCalcMissingMetricsNoChangeEq(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetricsNoChangeGt(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetricsNoChangeGt(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 2,
|
||||
expectedReplicas: 2,
|
||||
@ -517,7 +517,7 @@ func LegacyTestReplicaCalcMissingMetricsNoChangeGt(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetricsNoChangeLt(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetricsNoChangeLt(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 2,
|
||||
expectedReplicas: 2,
|
||||
@ -534,7 +534,7 @@ func LegacyTestReplicaCalcMissingMetricsNoChangeLt(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetricsUnreadyNoChange(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetricsUnreadyNoChange(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 3,
|
||||
@ -552,7 +552,7 @@ func LegacyTestReplicaCalcMissingMetricsUnreadyNoChange(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetricsUnreadyScaleUp(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetricsUnreadyScaleUp(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 3,
|
||||
expectedReplicas: 4,
|
||||
@ -570,7 +570,7 @@ func LegacyTestReplicaCalcMissingMetricsUnreadyScaleUp(t *testing.T) {
|
||||
tc.runTest(t)
|
||||
}
|
||||
|
||||
func LegacyTestReplicaCalcMissingMetricsUnreadyScaleDown(t *testing.T) {
|
||||
func TestLegacyReplicaCalcMissingMetricsUnreadyScaleDown(t *testing.T) {
|
||||
tc := legacyReplicaCalcTestCase{
|
||||
currentReplicas: 4,
|
||||
expectedReplicas: 3,
|
||||
@ -591,7 +591,7 @@ func LegacyTestReplicaCalcMissingMetricsUnreadyScaleDown(t *testing.T) {
|
||||
// TestComputedToleranceAlgImplementation is a regression test which
|
||||
// back-calculates a minimal percentage for downscaling based on a small percentage
|
||||
// increase in pod utilization which is calibrated against the tolerance value.
|
||||
func LegacyTestReplicaCalcComputedToleranceAlgImplementation(t *testing.T) {
|
||||
func TestLegacyReplicaCalcComputedToleranceAlgImplementation(t *testing.T) {
|
||||
|
||||
startPods := int32(10)
|
||||
// 150 mCPU per pod.
|
||||
|
Loading…
Reference in New Issue
Block a user