This commit is contained in:
Shreyas Goenka 2024-09-15 23:45:01 +02:00
parent de7eb94e45
commit f10038a20e
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
3 changed files with 9 additions and 1 deletions

View File

@ -119,6 +119,9 @@ func mockBundle(mode config.Mode) *bundle.Bundle {
Schemas: map[string]*resources.Schema{ Schemas: map[string]*resources.Schema{
"schema1": {CreateSchema: &catalog.CreateSchema{Name: "schema1"}}, "schema1": {CreateSchema: &catalog.CreateSchema{Name: "schema1"}},
}, },
Volumes: map[string]*resources.Volume{
"volume1": {CreateVolumeRequestContent: &catalog.CreateVolumeRequestContent{Name: "volume1"}},
},
}, },
}, },
// Use AWS implementation for testing. // Use AWS implementation for testing.
@ -281,6 +284,8 @@ func TestProcessTargetModeDefault(t *testing.T) {
assert.Equal(t, "servingendpoint1", b.Config.Resources.ModelServingEndpoints["servingendpoint1"].Name) assert.Equal(t, "servingendpoint1", b.Config.Resources.ModelServingEndpoints["servingendpoint1"].Name)
assert.Equal(t, "registeredmodel1", b.Config.Resources.RegisteredModels["registeredmodel1"].Name) assert.Equal(t, "registeredmodel1", b.Config.Resources.RegisteredModels["registeredmodel1"].Name)
assert.Equal(t, "qualityMonitor1", b.Config.Resources.QualityMonitors["qualityMonitor1"].TableName) assert.Equal(t, "qualityMonitor1", b.Config.Resources.QualityMonitors["qualityMonitor1"].TableName)
assert.Equal(t, "schema1", b.Config.Resources.Schemas["schema1"].Name)
assert.Equal(t, "volume1", b.Config.Resources.Volumes["volume1"].Name)
} }
func TestProcessTargetModeProduction(t *testing.T) { func TestProcessTargetModeProduction(t *testing.T) {
@ -322,6 +327,8 @@ func TestProcessTargetModeProduction(t *testing.T) {
assert.Equal(t, "servingendpoint1", b.Config.Resources.ModelServingEndpoints["servingendpoint1"].Name) assert.Equal(t, "servingendpoint1", b.Config.Resources.ModelServingEndpoints["servingendpoint1"].Name)
assert.Equal(t, "registeredmodel1", b.Config.Resources.RegisteredModels["registeredmodel1"].Name) assert.Equal(t, "registeredmodel1", b.Config.Resources.RegisteredModels["registeredmodel1"].Name)
assert.Equal(t, "qualityMonitor1", b.Config.Resources.QualityMonitors["qualityMonitor1"].TableName) assert.Equal(t, "qualityMonitor1", b.Config.Resources.QualityMonitors["qualityMonitor1"].TableName)
assert.Equal(t, "schema1", b.Config.Resources.Schemas["schema1"].Name)
assert.Equal(t, "volume1", b.Config.Resources.Volumes["volume1"].Name)
} }
func TestProcessTargetModeProductionOkForPrincipal(t *testing.T) { func TestProcessTargetModeProductionOkForPrincipal(t *testing.T) {

View File

@ -51,7 +51,7 @@ func TestConvertVolume(t *testing.T) {
"schema_name": "schema", "schema_name": "schema",
"storage_location": "s3://bucket/path", "storage_location": "s3://bucket/path",
"volume_type": "EXTERNAL", "volume_type": "EXTERNAL",
}, out.Schema["my_volume"]) }, out.Volume["my_volume"])
// Assert equality on the grants // Assert equality on the grants
assert.Equal(t, &schema.ResourceGrants{ assert.Equal(t, &schema.ResourceGrants{

View File

@ -244,6 +244,7 @@ func GetFilerForLibraries(ctx context.Context, b *bundle.Bundle, uploadPath stri
// The volume does not exist. Check if the volume is defined in the bundle. // The volume does not exist. Check if the volume is defined in the bundle.
// TODO: Note that this is not a breaking change. // TODO: Note that this is not a breaking change.
// TODO: Include error as well for why the stat call failed. It's more context.
l, ok := locationForVolume(b, catalogName, schemaName, volumeName) l, ok := locationForVolume(b, catalogName, schemaName, volumeName)
if !ok { if !ok {
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("the bundle is configured to upload artifacts to %s but a UC volume at %s does not exist", uploadPath, volumePath)