Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
afa2a1cf
Commit
afa2a1cf
authored
May 19, 2018
by
Guoliang Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing wrong unit test naming
parent
1e689a8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
37 deletions
+37
-37
legacy_horizontal_test.go
pkg/controller/podautoscaler/legacy_horizontal_test.go
+14
-14
legacy_replica_calculator_test.go
...ontroller/podautoscaler/legacy_replica_calculator_test.go
+23
-23
No files found.
pkg/controller/podautoscaler/legacy_horizontal_test.go
View file @
afa2a1cf
...
...
@@ -525,7 +525,7 @@ func (tc *legacyTestCase) runTest(t *testing.T) {
tc
.
verifyResults
(
t
)
}
func
LegacyTest
ScaleUp
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUp
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -540,7 +540,7 @@ func LegacyTestScaleUp(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpUnreadyLessScale
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpUnreadyLessScale
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -557,7 +557,7 @@ func LegacyTestScaleUpUnreadyLessScale(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpUnreadyNoScale
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpUnreadyNoScale
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -574,7 +574,7 @@ func LegacyTestScaleUpUnreadyNoScale(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpDeployment
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpDeployment
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -594,7 +594,7 @@ func LegacyTestScaleUpDeployment(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpReplicaSet
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpReplicaSet
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -614,7 +614,7 @@ func LegacyTestScaleUpReplicaSet(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpCM
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpCM
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -636,7 +636,7 @@ func LegacyTestScaleUpCM(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpCMUnreadyLessScale
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpCMUnreadyLessScale
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -659,7 +659,7 @@ func LegacyTestScaleUpCMUnreadyLessScale(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpCMUnreadyNoScaleWouldScaleDown
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpCMUnreadyNoScaleWouldScaleDown
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -682,7 +682,7 @@ func LegacyTestScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleDown
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleDown
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -697,7 +697,7 @@ func LegacyTestScaleDown(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleDownCM
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleDownCM
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -719,7 +719,7 @@ func LegacyTestScaleDownCM(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleDownIgnoresUnreadyPods
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleDownIgnoresUnreadyPods
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -841,7 +841,7 @@ func LegacyTestMaxReplicas(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
SuperfluousMetrics
(
t
*
testing
.
T
)
{
func
TestLegacy
SuperfluousMetrics
(
t
*
testing
.
T
)
{
tc
:=
legacyTestCase
{
minReplicas
:
2
,
maxReplicas
:
6
,
...
...
@@ -1023,7 +1023,7 @@ func LegacyTestComputedToleranceAlgImplementation(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ScaleUpRCImmediately
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleUpRCImmediately
(
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
LegacyTest
ScaleDownRCImmediately
(
t
*
testing
.
T
)
{
func
TestLegacy
ScaleDownRCImmediately
(
t
*
testing
.
T
)
{
time
:=
metav1
.
Time
{
Time
:
time
.
Now
()}
tc
:=
legacyTestCase
{
minReplicas
:
2
,
...
...
pkg/controller/podautoscaler/legacy_replica_calculator_test.go
View file @
afa2a1cf
...
...
@@ -227,7 +227,7 @@ func (tc *legacyReplicaCalcTestCase) runTest(t *testing.T) {
}
}
func
LegacyTest
ReplicaCalcDisjointResourcesMetrics
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcDisjointResourcesMetrics
(
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
LegacyTest
ReplicaCalcScaleUp
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleUp
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
5
,
...
...
@@ -260,7 +260,7 @@ func LegacyTestReplicaCalcScaleUp(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleUpUnreadyLessScale
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleUpUnreadyLessScale
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
4
,
...
...
@@ -278,7 +278,7 @@ func LegacyTestReplicaCalcScaleUpUnreadyLessScale(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleUpUnreadyNoScale
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleUpUnreadyNoScale
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
3
,
...
...
@@ -296,7 +296,7 @@ func LegacyTestReplicaCalcScaleUpUnreadyNoScale(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleUpCM
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleUpCM
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
4
,
...
...
@@ -310,7 +310,7 @@ func LegacyTestReplicaCalcScaleUpCM(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleUpCMUnreadyLessScale
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleUpCMUnreadyLessScale
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
4
,
...
...
@@ -325,7 +325,7 @@ func LegacyTestReplicaCalcScaleUpCMUnreadyLessScale(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleUpCMUnreadyNoScaleWouldScaleDown
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleUpCMUnreadyNoScaleWouldScaleDown
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
3
,
...
...
@@ -340,7 +340,7 @@ func LegacyTestReplicaCalcScaleUpCMUnreadyNoScaleWouldScaleDown(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleDown
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleDown
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
5
,
expectedReplicas
:
3
,
...
...
@@ -357,7 +357,7 @@ func LegacyTestReplicaCalcScaleDown(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleDownCM
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleDownCM
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
5
,
expectedReplicas
:
3
,
...
...
@@ -371,7 +371,7 @@ func LegacyTestReplicaCalcScaleDownCM(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcScaleDownIgnoresUnreadyPods
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcScaleDownIgnoresUnreadyPods
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
5
,
expectedReplicas
:
2
,
...
...
@@ -389,7 +389,7 @@ func LegacyTestReplicaCalcScaleDownIgnoresUnreadyPods(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcTolerance
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcTolerance
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
3
,
...
...
@@ -406,7 +406,7 @@ func LegacyTestReplicaCalcTolerance(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcToleranceCM
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcToleranceCM
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
3
,
...
...
@@ -420,7 +420,7 @@ func LegacyTestReplicaCalcToleranceCM(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcSuperfluousMetrics
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcSuperfluousMetrics
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
4
,
expectedReplicas
:
24
,
...
...
@@ -436,7 +436,7 @@ func LegacyTestReplicaCalcSuperfluousMetrics(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcMissingMetrics
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetrics
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
4
,
expectedReplicas
:
3
,
...
...
@@ -453,7 +453,7 @@ func LegacyTestReplicaCalcMissingMetrics(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcEmptyMetrics
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcEmptyMetrics
(
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
LegacyTest
ReplicaCalcEmptyCPURequest
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcEmptyCPURequest
(
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
LegacyTest
ReplicaCalcMissingMetricsNoChangeEq
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetricsNoChangeEq
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
2
,
expectedReplicas
:
2
,
...
...
@@ -500,7 +500,7 @@ func LegacyTestReplicaCalcMissingMetricsNoChangeEq(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcMissingMetricsNoChangeGt
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetricsNoChangeGt
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
2
,
expectedReplicas
:
2
,
...
...
@@ -517,7 +517,7 @@ func LegacyTestReplicaCalcMissingMetricsNoChangeGt(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcMissingMetricsNoChangeLt
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetricsNoChangeLt
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
2
,
expectedReplicas
:
2
,
...
...
@@ -534,7 +534,7 @@ func LegacyTestReplicaCalcMissingMetricsNoChangeLt(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcMissingMetricsUnreadyNoChange
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetricsUnreadyNoChange
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
3
,
...
...
@@ -552,7 +552,7 @@ func LegacyTestReplicaCalcMissingMetricsUnreadyNoChange(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcMissingMetricsUnreadyScaleUp
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetricsUnreadyScaleUp
(
t
*
testing
.
T
)
{
tc
:=
legacyReplicaCalcTestCase
{
currentReplicas
:
3
,
expectedReplicas
:
4
,
...
...
@@ -570,7 +570,7 @@ func LegacyTestReplicaCalcMissingMetricsUnreadyScaleUp(t *testing.T) {
tc
.
runTest
(
t
)
}
func
LegacyTest
ReplicaCalcMissingMetricsUnreadyScaleDown
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcMissingMetricsUnreadyScaleDown
(
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
LegacyTest
ReplicaCalcComputedToleranceAlgImplementation
(
t
*
testing
.
T
)
{
func
TestLegacy
ReplicaCalcComputedToleranceAlgImplementation
(
t
*
testing
.
T
)
{
startPods
:=
int32
(
10
)
// 150 mCPU per pod.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment