Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions integration/bundle/syncroot_not_in_git_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package bundle

import (
"path/filepath"
"testing"

"github.com/databricks/cli/integration/internal/acc"
"github.com/databricks/cli/internal/testcli"
"github.com/databricks/cli/internal/testutil"
"github.com/databricks/cli/libs/testdiff"
)

// TODO: We should not receive an error here
func TestSyncRootNotInGitError(t *testing.T) {
ctx, _ := acc.WorkspaceTest(t)
tmp := t.TempDir()
root := filepath.Join(tmp, "bundle")
ctx, replacements := testdiff.WithReplacementsMap(ctx)
replacements.Set(tmp, "$TMP_DIR")

testutil.WriteFile(t, filepath.Join(root, "databricks.yml"), `bundle:
name: test-bundle

sync:
paths:
- ..`)

testutil.Chdir(t, root)
testcli.AssertOutput(
t,
ctx,
[]string{"bundle", "deploy", "--force-lock", "--auto-approve"},
testutil.TestData("testdata/syncroot_not_in_git/bundle_deploy.txt"),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Uploading bundle files to /Workspace/Users/61b77d30-bc10-4214-9650-29cf5db0e941/.bundle/test-bundle/default/files...
Error: path "/private$TMP_DIR" is not within repository root "/private$TMP_DIR/bundle"

Loading