Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmay-db committed Sep 4, 2024
1 parent 93c023a commit a7ff8cc
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
13 changes: 0 additions & 13 deletions internal/acceptance/data_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,3 @@ func TestAccDataSourceCluster(t *testing.T) {
}`,
})
}

func TestAccDataSourceClusterPluginFramework(t *testing.T) {
workspaceLevel(t, step{
Template: `
data "databricks_cluster_pluginframework" "this" {
cluster_id = "{env.TEST_DEFAULT_CLUSTER_ID}"
}
output "cluster_info" {
value = data.databricks_cluster.this.cluster_info
}`,
})
}
21 changes: 2 additions & 19 deletions internal/acceptance/data_clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,17 @@ import (
)

func TestAccDataSourceClustersNoFilter(t *testing.T) {
WorkspaceLevel(t, Step{
workspaceLevel(t, step{

Check failure on line 8 in internal/acceptance/data_clusters_test.go

View workflow job for this annotation

GitHub Actions / tests

undefined: workspaceLevel

Check failure on line 8 in internal/acceptance/data_clusters_test.go

View workflow job for this annotation

GitHub Actions / tests

undefined: step
Template: `
data "databricks_clusters" "this" {
} `,
})
}

func TestAccDataSourceClustersWithFilter(t *testing.T) {
WorkspaceLevel(t, Step{
Template: `
data "databricks_clusters" "this" {
cluster_name_contains = "Default"
}`,
})
}

func TestAccDataSourceClustersNoFilterPluginFramework(t *testing.T) {
workspaceLevel(t, step{

Check failure on line 16 in internal/acceptance/data_clusters_test.go

View workflow job for this annotation

GitHub Actions / tests

undefined: workspaceLevel

Check failure on line 16 in internal/acceptance/data_clusters_test.go

View workflow job for this annotation

GitHub Actions / tests

undefined: step (compile)
Template: `
data "databricks_clusters_pluginframework" "this" {
} `,
})
}

func TestAccDataSourceClustersWithFilterPluginFramework(t *testing.T) {
workspaceLevel(t, step{
Template: `
data "databricks_clusters_pluginframework" "this" {
data "databricks_clusters" "this" {
cluster_name_contains = "Default"
}`,
})
Expand Down
3 changes: 3 additions & 0 deletions internal/providers/pluginfw/pluginfw.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/databricks/terraform-provider-databricks/commands"
"github.com/databricks/terraform-provider-databricks/common"
providercommon "github.com/databricks/terraform-provider-databricks/internal/providers/common"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/cluster"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/qualitymonitor"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/volume"

Expand Down Expand Up @@ -48,6 +49,8 @@ func (p *DatabricksProviderPluginFramework) Resources(ctx context.Context) []fun
func (p *DatabricksProviderPluginFramework) DataSources(ctx context.Context) []func() datasource.DataSource {
return []func() datasource.DataSource{
volume.DataSourceVolumes,
cluster.DataSourceCluster,
cluster.DataSourceClusters,
}
}

Expand Down
20 changes: 20 additions & 0 deletions internal/providers/pluginfw/resources/cluster/data_cluster_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cluster_test

import (
"testing"

"github.com/databricks/terraform-provider-databricks/internal/acceptance"
)

func TestAccDataSourceClusterPluginFramework(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: `
data "databricks_cluster_pluginframework" "this" {
cluster_id = "{env.TEST_DEFAULT_CLUSTER_ID}"
}
output "cluster_info" {
value = data.databricks_cluster.this.cluster_info
}`,
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cluster_test

import (
"testing"

"github.com/databricks/terraform-provider-databricks/internal/acceptance"
)

func TestAccDataSourceClustersNoFilterPluginFramework(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: `
data "databricks_clusters_pluginframework" "this" {
} `,
})
}

func TestAccDataSourceClustersWithFilterPluginFramework(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: `
data "databricks_clusters" "this" {
cluster_name_contains = "Default"
}`,
})
}

0 comments on commit a7ff8cc

Please sign in to comment.