fix test and improve error

This commit is contained in:
Shreyas Goenka 2024-09-15 23:31:04 +02:00
parent fa545777bd
commit 73826acb2f
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
2 changed files with 7 additions and 16 deletions

View File

@ -245,13 +245,14 @@ func GetFilerForLibraries(ctx context.Context, b *bundle.Bundle, uploadPath stri
// the schema was?
l, ok := locationForVolume(b, catalogName, schemaName, volumeName)
if !ok {
return nil, diag.Errorf("UC volume %s does not exist", volumePath)
return nil, diag.Errorf("the bundle is configured to upload artifacts to %s but a UC volume at %s does not exist", uploadPath, volumePath)
}
return nil, diag.Errorf(`UC volume %s does not exist. Note: We detected that
you have a UC volume defined that matched the path above at %s.
Please deploy the UC volume separately before using it in as a
destination to upload artifacts.`, l, volumePath)
return nil, diag.Errorf(`the bundle is configured to upload artifacts to %s but a
UC volume at %s does not exist. Note: We detected that you have a UC volume
defined that matched the path above at %s. Please deploy the UC volume
in a separate deployment before using it in as a destination to upload
artifacts.`, uploadPath, volumePath, l)
}
func locationForVolume(b *bundle.Bundle, catalogName, schemaName, volumeName string) (dyn.Location, bool) {

View File

@ -40,17 +40,7 @@ func TestParseTerraformActions(t *testing.T) {
},
}
res := filterDeleteOrRecreateActions(changes, func(typ string, actions tfjson.Actions) bool {
if typ != "databricks_pipeline" {
return false
}
if actions.Delete() || actions.Replace() {
return true
}
return false
})
res := filterDeleteOrRecreateActions(changes, "databricks_pipeline")
assert.Equal(t, []terraformlib.Action{
{