Skip to content

Commit d976ed3

Browse files
authored
Disable rate limit in tnresources unit tests (#3579)
## Why This is running against local testserver. Before: ``` --- PASS: TestAll (3.74s) --- PASS: TestAll/pipelines (0.34s) --- PASS: TestAll/schemas (0.40s) --- PASS: TestAll/volumes (0.40s) --- PASS: TestAll/apps (0.47s) --- PASS: TestAll/sql_warehouses (0.40s) --- PASS: TestAll/database_instances (0.47s) --- PASS: TestAll/database_catalogs (0.47s) --- PASS: TestAll/synced_database_tables (0.40s) --- PASS: TestAll/jobs (0.40s) ``` After: ``` --- PASS: TestAll (0.01s) --- PASS: TestAll/schemas (0.00s) --- PASS: TestAll/database_instances (0.00s) --- PASS: TestAll/synced_database_tables (0.00s) --- PASS: TestAll/jobs (0.00s) --- PASS: TestAll/pipelines (0.00s) --- PASS: TestAll/volumes (0.00s) --- PASS: TestAll/apps (0.00s) --- PASS: TestAll/sql_warehouses (0.00s) --- PASS: TestAll/database_catalogs (0.00s) ```
1 parent e5a4da5 commit d976ed3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bundle/terranova/tnresources/all_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package tnresources
22

33
import (
44
"context"
5+
"math"
56
"reflect"
67
"testing"
78

@@ -186,9 +187,11 @@ func TestRecreateFields(t *testing.T) {
186187
func setupTestServerClient(t *testing.T) (*testserver.Server, *databricks.WorkspaceClient) {
187188
server := testserver.New(t)
188189
testserver.AddDefaultHandlers(server)
189-
t.Setenv("DATABRICKS_HOST", server.URL)
190-
t.Setenv("DATABRICKS_TOKEN", "testtoken")
191-
client, err := databricks.NewWorkspaceClient()
190+
client, err := databricks.NewWorkspaceClient(&databricks.Config{
191+
Host: server.URL,
192+
Token: "testtoken",
193+
RateLimitPerSecond: math.MaxInt,
194+
})
192195
require.NoError(t, err)
193196
return server, client
194197
}

0 commit comments

Comments
 (0)