Skip to content

Commit

Permalink
Remove old Warehouse sdk.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ngaberel committed May 12, 2023
1 parent 60c8987 commit 974ba1d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 170 deletions.
31 changes: 0 additions & 31 deletions pkg/resources/snowflake_sweeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,6 @@ func TestMain(m *testing.M) {
resource.TestMain(m)
}

func getWarehousesSweeper(name string) *resource.Sweeper {
return &resource.Sweeper{
Name: name,
F: func(ununsed string) error {
db, err := provider.GetDatabaseHandleFromEnv()
if err != nil {
return fmt.Errorf("Error getting db handle: %w", err)
}

warehouses, err := snowflake.ListWarehouses(db)
if err != nil {
return fmt.Errorf("Error listing warehouses: %w", err)
}

for _, wh := range warehouses {
log.Printf("[DEBUG] Testing if warehouse %s starts with tst-terraform", wh.Name)
if strings.HasPrefix(wh.Name, "tst-terraform") {
log.Printf("[DEBUG] deleting warehouse %s", wh.Name)
whBuilder := snowflake.NewWarehouseBuilder(name).Builder
stmt := whBuilder.Drop()
if err := snowflake.Exec(db, stmt); err != nil {
return fmt.Errorf("Error deleting warehouse %q %w", wh.Name, err)
}
}
}
return nil
},
}
}

func getDatabaseSweepers(name string) *resource.Sweeper {
return &resource.Sweeper{
Name: name,
Expand Down Expand Up @@ -161,7 +131,6 @@ func getIntegrationsSweeper(name string) *resource.Sweeper {
// Sweepers usually go along with the tests. In TF[CE]'s case everything depends on the organization,
// which means that if we delete it then all the other entities will be deleted automatically.
func init() {
resource.AddTestSweepers("wh_sweeper", getWarehousesSweeper("wh_sweeper"))
resource.AddTestSweepers("db_sweeper", getDatabaseSweepers("db_sweeper"))
resource.AddTestSweepers("role_sweeper", getRolesSweeper("role_sweeper"))
resource.AddTestSweepers("user_sweeper", getUsersSweeper("user_sweeper"))
Expand Down
139 changes: 0 additions & 139 deletions pkg/snowflake/warehouse.go

This file was deleted.

0 comments on commit 974ba1d

Please sign in to comment.