mirror of https://github.com/databricks/cli.git
Compare commits
No commits in common. "e44eebc58f2746ecdc107580dccccc948365edea" and "198690d050cbc5d97f508705684422bdd6ebeb34" have entirely different histories.
e44eebc58f
...
198690d050
|
@ -246,7 +246,7 @@ func TestBundleInitTelemetryForCustomTemplates(t *testing.T) {
|
||||||
require.Equal(t, 1, len(logs))
|
require.Equal(t, 1, len(logs))
|
||||||
event := logs[0].Entry.DatabricksCliLog.BundleInitEvent
|
event := logs[0].Entry.DatabricksCliLog.BundleInitEvent
|
||||||
assert.Equal(t, event.TemplateName, "custom")
|
assert.Equal(t, event.TemplateName, "custom")
|
||||||
assert.Empty(t, event.TemplateEnumArgs)
|
assert.Nil(t, event.TemplateEnumArgs)
|
||||||
|
|
||||||
// Ensure that the UUID returned by the `bundle_uuid` helper is the same UUID
|
// Ensure that the UUID returned by the `bundle_uuid` helper is the same UUID
|
||||||
// that's logged in the telemetry event.
|
// that's logged in the telemetry event.
|
||||||
|
|
|
@ -11,24 +11,18 @@ import (
|
||||||
func TestBuiltin(t *testing.T) {
|
func TestBuiltin(t *testing.T) {
|
||||||
out, err := Builtin()
|
out, err := Builtin()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.GreaterOrEqual(t, len(out), 3)
|
assert.Len(t, out, 3)
|
||||||
|
|
||||||
// Create a map of templates by name for easier lookup
|
// Confirm names.
|
||||||
templates := make(map[string]*BuiltinTemplate)
|
assert.Equal(t, "dbt-sql", out[0].Name)
|
||||||
for _, tmpl := range out {
|
assert.Equal(t, "default-python", out[1].Name)
|
||||||
templates[tmpl.Name] = &tmpl
|
assert.Equal(t, "default-sql", out[2].Name)
|
||||||
}
|
|
||||||
|
|
||||||
// Verify all expected templates exist
|
// Confirm that the filesystems work.
|
||||||
assert.Contains(t, templates, "dbt-sql")
|
_, err = fs.Stat(out[0].FS, `template/{{.project_name}}/dbt_project.yml.tmpl`)
|
||||||
assert.Contains(t, templates, "default-python")
|
|
||||||
assert.Contains(t, templates, "default-sql")
|
|
||||||
|
|
||||||
// Verify the filesystems work for each template
|
|
||||||
_, err = fs.Stat(templates["dbt-sql"].FS, `template/{{.project_name}}/dbt_project.yml.tmpl`)
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = fs.Stat(templates["default-python"].FS, `template/{{.project_name}}/tests/main_test.py.tmpl`)
|
_, err = fs.Stat(out[1].FS, `template/{{.project_name}}/tests/main_test.py.tmpl`)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
_, err = fs.Stat(templates["default-sql"].FS, `template/{{.project_name}}/src/orders_daily.sql.tmpl`)
|
_, err = fs.Stat(out[2].FS, `template/{{.project_name}}/src/orders_daily.sql.tmpl`)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue