Skip to content

Commit

Permalink
Add acceptance for test for sync.paths equal to two dots (#2196)
Browse files Browse the repository at this point in the history
Based on integration test from @andrewnester in #2194

Manually checked that this databricks.yml passes validation on v0.235.0
but fails on v0.236.0, very like it was broken in
#1945

This also adds replacements for tmpdir, it's parent and (just in case)
grand parent.
  • Loading branch information
denik authored Jan 21, 2025
1 parent 33613b5 commit de5155e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ 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")

scriptContents := readMergedScriptContents(t, dir)
testutil.WriteFile(t, filepath.Join(tmpDir, EntryPointScript), scriptContents)

Expand Down
5 changes: 5 additions & 0 deletions acceptance/bundle/sync-paths-dotdot/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bundle:
name: test-bundle
sync:
paths:
- ..
11 changes: 11 additions & 0 deletions acceptance/bundle/sync-paths-dotdot/output.txt
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions acceptance/bundle/sync-paths-dotdot/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI bundle validate

0 comments on commit de5155e

Please sign in to comment.