Skip to content

Commit

Permalink
update path and prefix test to use subdirectories
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Vidal <[email protected]>
  • Loading branch information
avidal committed May 13, 2024
1 parent 8f608ca commit 0c91926
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions internal/tiltfile/tiltextension/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,27 @@ v1alpha1.extension_repo(name='custom', url='file://%s/ext-repo', prefix='custom'
# Should load an extension from the custom repo at <repo.path>/my-ext
load("ext://custom/my-ext", "printExt")
printExt()
# Should load from <repo.path>/my-ext/subext
load("ext://custom/my-ext/subext", "printSub")
printSub()
`, f.tmp.Path()))

extContent := `
def printExt():
print("main ext")
`

subExtContent := `
def printSub():
print("sub ext")
`

f.tmp.WriteFile(filepath.Join("ext-repo", "subdir", "my-ext", "Tiltfile"), extContent)
f.tmp.WriteFile(filepath.Join("ext-repo", "subdir", "my-ext", "subext", "Tiltfile"), subExtContent)

res := f.assertExecOutput("main ext")
f.assertLoadRecorded(res, "custom/my-ext")
res := f.assertExecOutput("main ext\nsub ext")
f.assertLoadRecorded(res, "custom/my-ext", "custom/my-ext/subext")
}

type extensionFixture struct {
Expand Down

0 comments on commit 0c91926

Please sign in to comment.