Cleaned up and removed legacy configuration surfaces
This commit is contained in:
@@ -39,6 +39,49 @@ storage:
|
||||
}
|
||||
}
|
||||
|
||||
func TestStorageLegacyTopLevelFieldsFailStrictDecode(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
storageYAML string
|
||||
wantField string
|
||||
}{
|
||||
{
|
||||
name: "bucket",
|
||||
storageYAML: `
|
||||
storage:
|
||||
bucket: my-dnd-archive
|
||||
`,
|
||||
wantField: "bucket",
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
storageYAML: `
|
||||
storage:
|
||||
prefix: dnd
|
||||
`,
|
||||
wantField: "prefix",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
pipelineYAML := testPipelineBaseYAML + tt.storageYAML
|
||||
pipelinePath, _ := writeConfigFiles(t, pipelineYAML, testSessionBaseYAML)
|
||||
|
||||
_, err := LoadPipeline(pipelinePath)
|
||||
if err == nil {
|
||||
t.Fatal("LoadPipeline() error = nil, want strict decode error")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "strict decode failed") {
|
||||
t.Fatalf("LoadPipeline() error = %v, want strict decode failed", err)
|
||||
}
|
||||
if !strings.Contains(err.Error(), tt.wantField) {
|
||||
t.Fatalf("LoadPipeline() error = %v, want field %q", err, tt.wantField)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestStorageS3CredentialEnvNamesLoadAndValidate(t *testing.T) {
|
||||
pipelineYAML := testPipelineBaseYAML + `
|
||||
storage:
|
||||
|
||||
Reference in New Issue
Block a user