Skip to content

Commit 914ab6b

Browse files
authored
[Internal] Scope the traversing directory in the Recursive list workspace test (#1120)
## What changes are proposed in this pull request? What - The PR modifies the scope of directory traversal in the recursive list test. It limits the search to the ".sdk" directory, where the relevant notebook is created. Why - The test was previously hitting API rate limits because it was scanning too many elements in the current traversing directory. By narrowing the scope to the ".sdk" directory, the test can now run more efficiently without encountering these limits. ## How is this tested? This is itself an integration test.
1 parent b83a726 commit 914ab6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/workspace_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
func myNotebookPath(t *testing.T, w *databricks.WorkspaceClient) string {
1818
ctx := context.Background()
19-
testDir := filepath.Join("/Users", me(t, w).UserName, ".sdk", RandomName("t-"))
19+
testDir := filepath.Join("/Users", me(t, w).UserName, ".sdk", "notebooks", RandomName("t-"))
2020
notebook := filepath.Join(testDir, RandomName("n-"))
2121

2222
err := w.Workspace.MkdirsByPath(ctx, testDir)
@@ -224,7 +224,7 @@ func TestAccWorkspaceRecursiveListNoTranspile(t *testing.T) {
224224
workspace.UploadOverwrite())
225225
require.NoError(t, err)
226226

227-
allMyNotebooks, err := w.Workspace.RecursiveList(ctx, filepath.Join("/Users", me(t, w).UserName))
227+
allMyNotebooks, err := w.Workspace.RecursiveList(ctx, filepath.Join("/Users", me(t, w).UserName, ".sdk"))
228228
require.NoError(t, err)
229229
assert.True(t, len(allMyNotebooks) >= 1)
230230
}

0 commit comments

Comments
 (0)