Skip to content

Commit

Permalink
added acceptance tests and added the data source to pluginfw.go
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomez04 committed Oct 24, 2024
1 parent 4ab1e27 commit 8db0188
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/providers/pluginfw/pluginfw.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/notificationdestinations"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/qualitymonitor"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/registered_model"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/user"
"github.com/databricks/terraform-provider-databricks/internal/providers/pluginfw/resources/volume"

"github.com/hashicorp/terraform-plugin-framework/datasource"
Expand Down Expand Up @@ -56,6 +57,7 @@ func (p *DatabricksProviderPluginFramework) DataSources(ctx context.Context) []f
volume.DataSourceVolumes,
registered_model.DataSourceRegisteredModel,
notificationdestinations.DataSourceNotificationDestinations,
user.DataSourceUsers,
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package acceptance
package user_test

import (
"testing"

"github.com/databricks/terraform-provider-databricks/internal/acceptance"
"github.com/hashicorp/terraform-plugin-testing/terraform"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -47,7 +48,14 @@ func checkUsersDataSourcePopulated(t *testing.T) func(s *terraform.State) error
}

func TestAccDataSourceDataUsers(t *testing.T) {
AccountLevel(t, Step{
acceptance.AccountLevel(t, acceptance.Step{
Template: dataSourceTemplate,
Check: checkUsersDataSourcePopulated(t),
})
}

func TestWorkspaceDataSourceDataUsers(t *testing.T) {
acceptance.WorkspaceLevel(t, acceptance.Step{
Template: dataSourceTemplate,
Check: checkUsersDataSourcePopulated(t),
})
Expand Down

0 comments on commit 8db0188

Please sign in to comment.