-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/select appropriate hpa version (#248)
Signed-off-by: yandongxiao <[email protected]>
- Loading branch information
1 parent
51216ce
commit c5554ed
Showing
8 changed files
with
143 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package v1 | ||
|
||
import "testing" | ||
|
||
func TestAutoScalerVersion_Complete(t *testing.T) { | ||
type args struct { | ||
major string | ||
minor string | ||
} | ||
tests := []struct { | ||
name string | ||
version AutoScalerVersion | ||
args args | ||
want AutoScalerVersion | ||
}{ | ||
{ | ||
name: "test for version v1", | ||
version: AutoScalerV1, | ||
args: args{}, | ||
want: AutoScalerV1, | ||
}, | ||
{ | ||
name: "test for version v2", | ||
version: AutoScalerV2, | ||
args: args{}, | ||
want: AutoScalerV2, | ||
}, | ||
{ | ||
name: "test for version v2beta2", | ||
version: AutoScalerV2Beta2, | ||
args: args{}, | ||
want: AutoScalerV2Beta2, | ||
}, | ||
{ | ||
name: "test for empty version", | ||
version: "", | ||
args: args{ | ||
major: "1", | ||
minor: "26", | ||
}, | ||
want: AutoScalerV2, | ||
}, | ||
{ | ||
name: "test for empty version2", | ||
version: "", | ||
args: args{ | ||
major: "1", | ||
minor: "25", | ||
}, | ||
want: AutoScalerV2Beta2, | ||
}, | ||
{ | ||
name: "test for empty version3", | ||
version: "", | ||
args: args{ | ||
major: "1", | ||
minor: "23", | ||
}, | ||
want: AutoScalerV2Beta2, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := tt.version.Complete(tt.args.major, tt.args.minor); got != tt.want { | ||
t.Errorf("Complete() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters