Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfeng-db committed Oct 16, 2024
1 parent ae87858 commit 5875c59
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion internal/providers/pluginfw/pluginfw_rollout_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var migratedResourceMap = map[string]func() resource.Resource{

// Map of data sources that have been migrated from SDK V2 to plugin framework
var migratedDataSourceMap = map[string]func() datasource.DataSource{
"databricks_qualitymonitor": cluster.DataSourceCluster,
"databricks_cluster": cluster.DataSourceCluster,
"databricks_volumes": volume.DataSourceVolumes,
"databricks_registered_model": registered_model.DataSourceRegisteredModel,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const dataClusterTemplateById = `
data "databricks_cluster_pluginframework" "by_id" {
data "databricks_cluster "by_id" {
cluster_id = "{env.TEST_DEFAULT_CLUSTER_ID}"
}
`
Expand All @@ -21,8 +21,8 @@ func TestAccDataSourceClusterByID(t *testing.T) {
func TestAccDataSourceClusterByName(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: dataClusterTemplateById + `
data "databricks_cluster_pluginframework" "by_name" {
cluster_name = data.databricks_cluster_pluginframework.by_id.cluster_name
data "databricks_cluster" "by_name" {
cluster_name = data.databricks_cluster.by_id.cluster_name
}`,
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestAccLibraryCreationPluginFramework(t *testing.T) {
"ResourceClass" = "SingleNode"
}
}
resource "databricks_library_pluginframework" "new_library" {
resource "databricks_library" "new_library" {
cluster_id = databricks_cluster.this.id
pypi {
repo = "https://pypi.org/dummy"
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestAccLibraryUpdatePluginFramework(t *testing.T) {
"ResourceClass" = "SingleNode"
}
}
resource "databricks_library_pluginframework" "new_library" {
resource "databricks_library" "new_library" {
cluster_id = databricks_cluster.this.id
pypi {
repo = "https://pypi.org/simple"
Expand All @@ -80,7 +80,7 @@ func TestAccLibraryUpdatePluginFramework(t *testing.T) {
"ResourceClass" = "SingleNode"
}
}
resource "databricks_library_pluginframework" "new_library" {
resource "databricks_library" "new_library" {
cluster_id = databricks_cluster.this.id
pypi {
package = "networkx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestUcAccQualityMonitor(t *testing.T) {
acceptance.UnityWorkspaceLevel(t, acceptance.Step{
Template: commonPartQualityMonitoring + `
resource "databricks_quality_monitor_pluginframework" "testMonitorInference" {
resource "databricks_quality_monitor" "testMonitorInference" {
table_name = databricks_sql_table.myInferenceTable.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myInferenceTable.name}"
output_schema_name = databricks_schema.things.id
Expand All @@ -81,7 +81,7 @@ func TestUcAccQualityMonitor(t *testing.T) {
}
}
resource "databricks_quality_monitor_pluginframework" "testMonitorTimeseries" {
resource "databricks_quality_monitor" "testMonitorTimeseries" {
table_name = databricks_sql_table.myTimeseries.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myTimeseries.name}"
output_schema_name = databricks_schema.things.id
Expand All @@ -104,7 +104,7 @@ func TestUcAccQualityMonitor(t *testing.T) {
}
}
resource "databricks_quality_monitor_pluginframework" "testMonitorSnapshot" {
resource "databricks_quality_monitor" "testMonitorSnapshot" {
table_name = databricks_sql_table.mySnapshot.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myTimeseries.name}"
output_schema_name = databricks_schema.things.id
Expand All @@ -121,7 +121,7 @@ func TestUcAccUpdateQualityMonitor(t *testing.T) {
}
acceptance.UnityWorkspaceLevel(t, acceptance.Step{
Template: commonPartQualityMonitoring + `
resource "databricks_quality_monitor_pluginframework" "testMonitorInference" {
resource "databricks_quality_monitor" "testMonitorInference" {
table_name = databricks_sql_table.myInferenceTable.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myInferenceTable.name}"
output_schema_name = databricks_schema.things.id
Expand All @@ -136,7 +136,7 @@ func TestUcAccUpdateQualityMonitor(t *testing.T) {
`,
}, acceptance.Step{
Template: commonPartQualityMonitoring + `
resource "databricks_quality_monitor_pluginframework" "testMonitorInference" {
resource "databricks_quality_monitor" "testMonitorInference" {
table_name = databricks_sql_table.myInferenceTable.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myInferenceTable.name}"
output_schema_name = databricks_schema.things.id
Expand All @@ -160,7 +160,7 @@ func TestUcAccQualityMonitorImportPluginFramework(t *testing.T) {
acceptance.Step{
Template: commonPartQualityMonitoring + `
resource "databricks_quality_monitor_pluginframework" "testMonitorInference" {
resource "databricks_quality_monitor" "testMonitorInference" {
table_name = databricks_sql_table.myInferenceTable.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myInferenceTable.name}"
output_schema_name = databricks_schema.things.id
Expand All @@ -176,8 +176,8 @@ func TestUcAccQualityMonitorImportPluginFramework(t *testing.T) {
},
acceptance.Step{
ImportState: true,
ResourceName: "databricks_quality_monitor_pluginframework.testMonitorInference",
ImportStateIdFunc: acceptance.BuildImportStateIdFunc("databricks_quality_monitor_pluginframework.testMonitorInference", "table_name"),
ResourceName: "databricks_quality_monitor.testMonitorInference",
ImportStateIdFunc: acceptance.BuildImportStateIdFunc("databricks_quality_monitor.testMonitorInference", "table_name"),
ImportStateVerify: true,
ImportStateVerifyIdentifierAttribute: "table_name",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

func checkDataSourceVolumesPopulated(t *testing.T) func(s *terraform.State) error {
return func(s *terraform.State) error {
_, ok := s.Modules[0].Resources["data.databricks_volumes_pluginframework.this"]
require.True(t, ok, "data.databricks_volumes_pluginframework.this has to be there")
_, ok := s.Modules[0].Resources["data.databricks_volumes.this"]
require.True(t, ok, "data.databricks_volumes.this has to be there")
num_volumes, _ := strconv.Atoi(s.Modules[0].Outputs["volumes"].Value.(string))
assert.GreaterOrEqual(t, num_volumes, 1)
return nil
Expand Down Expand Up @@ -45,13 +45,13 @@ func TestUcAccDataSourceVolumes(t *testing.T) {
schema_name = databricks_schema.things.name
volume_type = "MANAGED"
}
data "databricks_volumes_pluginframework" "this" {
data "databricks_volumes" "this" {
catalog_name = databricks_catalog.sandbox.name
schema_name = databricks_schema.things.name
depends_on = [ databricks_volume.this ]
}
output "volumes" {
value = length(data.databricks_volumes_pluginframework.this.ids)
value = length(data.databricks_volumes.this.ids)
}
`,
Check: checkDataSourceVolumesPopulated(t),
Expand Down

0 comments on commit 5875c59

Please sign in to comment.