From 451141704d6926faca6838d74ebdf9559c7ae116 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 20 Jan 2025 21:56:42 +0100 Subject: [PATCH 1/2] Add acceptance for test for sync.paths: ".." Based on integration test from @andrewnester in #2194 --- acceptance/acceptance_test.go | 4 ++++ acceptance/bundle/sync-paths-dotdot/databricks.yml | 5 +++++ acceptance/bundle/sync-paths-dotdot/output.txt | 11 +++++++++++ acceptance/bundle/sync-paths-dotdot/script | 1 + 4 files changed, 21 insertions(+) create mode 100644 acceptance/bundle/sync-paths-dotdot/databricks.yml create mode 100644 acceptance/bundle/sync-paths-dotdot/output.txt create mode 100644 acceptance/bundle/sync-paths-dotdot/script diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 5f1181313c..dd84ed44fc 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -137,6 +137,10 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont tmpDir = t.TempDir() } + repls.Set(tmpDir, "$TMPDIR") + repls.Set(filepath.Dir(tmpDir), "$TMPPARENT") + repls.Set(filepath.Dir(filepath.Dir(tmpDir)), "$TMPGPARENT") + scriptContents := readMergedScriptContents(t, dir) testutil.WriteFile(t, filepath.Join(tmpDir, EntryPointScript), scriptContents) diff --git a/acceptance/bundle/sync-paths-dotdot/databricks.yml b/acceptance/bundle/sync-paths-dotdot/databricks.yml new file mode 100644 index 0000000000..7215ffea29 --- /dev/null +++ b/acceptance/bundle/sync-paths-dotdot/databricks.yml @@ -0,0 +1,5 @@ +bundle: + name: test-bundle +sync: + paths: + - .. diff --git a/acceptance/bundle/sync-paths-dotdot/output.txt b/acceptance/bundle/sync-paths-dotdot/output.txt new file mode 100644 index 0000000000..11db3e9ee0 --- /dev/null +++ b/acceptance/bundle/sync-paths-dotdot/output.txt @@ -0,0 +1,11 @@ +Error: path "$TMPPARENT" is not within repository root "$TMPDIR" + +Name: test-bundle +Target: default +Workspace: + User: $USERNAME + Path: /Workspace/Users/$USERNAME/.bundle/test-bundle/default + +Found 1 error + +Exit code: 1 diff --git a/acceptance/bundle/sync-paths-dotdot/script b/acceptance/bundle/sync-paths-dotdot/script new file mode 100644 index 0000000000..72555b332a --- /dev/null +++ b/acceptance/bundle/sync-paths-dotdot/script @@ -0,0 +1 @@ +$CLI bundle validate From 8c8885d9f0a926b78cb458dc2621fc0e50730374 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 20 Jan 2025 22:07:07 +0100 Subject: [PATCH 2/2] try to address /private prefix issue on macos on CI --- acceptance/acceptance_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index dd84ed44fc..850d3bf9d6 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -137,6 +137,9 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont tmpDir = t.TempDir() } + repls.Set("/private"+tmpDir, "$TMPDIR") + repls.Set("/private"+filepath.Dir(tmpDir), "$TMPPARENT") + repls.Set("/private"+filepath.Dir(filepath.Dir(tmpDir)), "$TMPGPARENT") repls.Set(tmpDir, "$TMPDIR") repls.Set(filepath.Dir(tmpDir), "$TMPPARENT") repls.Set(filepath.Dir(filepath.Dir(tmpDir)), "$TMPGPARENT")