diff --git a/integration/bundle/syncroot_not_in_git_test.go b/integration/bundle/syncroot_not_in_git_test.go new file mode 100644 index 0000000000..70d31a0c05 --- /dev/null +++ b/integration/bundle/syncroot_not_in_git_test.go @@ -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"), + ) +} diff --git a/integration/bundle/testdata/syncroot_not_in_git/bundle_deploy.txt b/integration/bundle/testdata/syncroot_not_in_git/bundle_deploy.txt new file mode 100644 index 0000000000..c4ef49c46e --- /dev/null +++ b/integration/bundle/testdata/syncroot_not_in_git/bundle_deploy.txt @@ -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" +