Add acceptance for test for sync.paths equal to two dots (#2196)

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
https://github.com/databricks/cli/pull/1945

This also adds replacements for tmpdir, it's parent and (just in case)
grand parent.
This commit is contained in:
Denis Bilenko 2025-01-21 12:50:28 +01:00 committed by GitHub
parent 33613b5d2a
commit de5155ed0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 0 deletions

View File

@ -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)

View File

@ -0,0 +1,5 @@
bundle:
name: test-bundle
sync:
paths:
- ..

View File

@ -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

View File

@ -0,0 +1 @@
$CLI bundle validate