delete unused config test (#202)

Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
Fabian Kammel 2022-09-28 16:31:00 +02:00 committed by GitHub
parent 130c61ffcf
commit dfa4dd9b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,52 +108,6 @@ func TestFromFile(t *testing.T) {
} }
} }
func TestFromFileStrictErrors(t *testing.T) {
testCases := map[string]struct {
yamlConfig string
wantErr bool
}{
"valid config": {
yamlConfig: `
autoscalingNodeGroupMin: 5
autoscalingNodeGroupMax: 10
stateDisksizeGB: 25
`,
},
"typo": {
yamlConfig: `
autoscalingNodeGroupMini: 5
autoscalingNodeGroupMax: 10
stateDisksizeGB: 25
`,
wantErr: true,
},
"unsupported version": {
yamlConfig: `
version: v5
autoscalingNodeGroupMin: 1
autoscalingNodeGroupMax: 10
stateDisksizeGB: 30
`,
wantErr: true,
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
assert := assert.New(t)
fileHandler := file.NewHandler(afero.NewMemMapFs())
err := fileHandler.Write(constants.ConfigFilename, []byte(tc.yamlConfig), file.OptNone)
assert.NoError(err)
// TODO: Test should fail because of unknown field "autoscalingNodeGroupMin" but it doesn't.
_, err = FromFile(fileHandler, constants.ConfigFilename)
assert.Error(err)
})
}
}
func TestValidate(t *testing.T) { func TestValidate(t *testing.T) {
const defaultMsgCount = 15 // expect this number of error messages by default because user-specific values are not set and multiple providers are defined by default const defaultMsgCount = 15 // expect this number of error messages by default because user-specific values are not set and multiple providers are defined by default