mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Clean up unused variable from unit test.
This commit is contained in:
parent
2b304bf5e2
commit
81c6989ccc
@ -99,7 +99,6 @@ func TestRegister(t *testing.T) {
|
||||
var tests = []struct {
|
||||
desc string
|
||||
metrics []*Counter
|
||||
registryVersion *semver.Version
|
||||
expectedErrors []error
|
||||
expectedIsCreatedValues []bool
|
||||
expectedIsDeprecated []bool
|
||||
@ -108,7 +107,6 @@ func TestRegister(t *testing.T) {
|
||||
{
|
||||
desc: "test alpha metric",
|
||||
metrics: []*Counter{alphaCounter},
|
||||
registryVersion: &v115,
|
||||
expectedErrors: []error{nil},
|
||||
expectedIsCreatedValues: []bool{true},
|
||||
expectedIsDeprecated: []bool{false},
|
||||
@ -117,7 +115,6 @@ func TestRegister(t *testing.T) {
|
||||
{
|
||||
desc: "test registering same metric multiple times",
|
||||
metrics: []*Counter{alphaCounter, alphaCounter},
|
||||
registryVersion: &v115,
|
||||
expectedErrors: []error{nil, prometheus.AlreadyRegisteredError{}},
|
||||
expectedIsCreatedValues: []bool{true, true},
|
||||
expectedIsDeprecated: []bool{false, false},
|
||||
@ -126,7 +123,6 @@ func TestRegister(t *testing.T) {
|
||||
{
|
||||
desc: "test alpha deprecated metric",
|
||||
metrics: []*Counter{alphaDeprecatedCounter},
|
||||
registryVersion: &v115,
|
||||
expectedErrors: []error{nil},
|
||||
expectedIsCreatedValues: []bool{true},
|
||||
expectedIsDeprecated: []bool{true},
|
||||
@ -135,7 +131,6 @@ func TestRegister(t *testing.T) {
|
||||
{
|
||||
desc: "test alpha hidden metric",
|
||||
metrics: []*Counter{alphaHiddenCounter},
|
||||
registryVersion: &v115,
|
||||
expectedErrors: []error{nil},
|
||||
expectedIsCreatedValues: []bool{false},
|
||||
expectedIsDeprecated: []bool{true},
|
||||
@ -152,7 +147,7 @@ func TestRegister(t *testing.T) {
|
||||
})
|
||||
for i, m := range test.metrics {
|
||||
err := registry.Register(m)
|
||||
if err != test.expectedErrors[i] && err.Error() != test.expectedErrors[i].Error() {
|
||||
if err != nil && err.Error() != test.expectedErrors[i].Error() {
|
||||
t.Errorf("Got unexpected error %v, wanted %v", err, test.expectedErrors[i])
|
||||
}
|
||||
if m.IsCreated() != test.expectedIsCreatedValues[i] {
|
||||
|
Loading…
Reference in New Issue
Block a user