mirror of https://github.com/databricks/cli.git
fixed test
This commit is contained in:
parent
f135ecc799
commit
cfcb787fbc
|
@ -37,6 +37,8 @@ func Initialize() bundle.Mutator {
|
|||
mutator.MergeJobParameters(),
|
||||
mutator.MergeJobTasks(),
|
||||
mutator.MergePipelineClusters(),
|
||||
mutator.MergeApps(),
|
||||
|
||||
mutator.InitializeWorkspaceClient(),
|
||||
mutator.PopulateCurrentUser(),
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ variables:
|
|||
env:
|
||||
- name: SOME_ENV_VARIABLE
|
||||
value: "Some value"
|
||||
|
||||
resources:
|
||||
apps:
|
||||
my_app:
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package config_tests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/databricks/cli/bundle"
|
||||
"github.com/databricks/cli/bundle/config/mutator"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
@ -10,6 +13,13 @@ func TestApps(t *testing.T) {
|
|||
b := load(t, "./apps")
|
||||
assert.Equal(t, "apps", b.Config.Bundle.Name)
|
||||
|
||||
diags := bundle.Apply(context.Background(), b,
|
||||
bundle.Seq(
|
||||
mutator.SetVariables(),
|
||||
mutator.ResolveVariableReferences("variables"),
|
||||
))
|
||||
assert.Empty(t, diags)
|
||||
|
||||
app := b.Config.Resources.Apps["my_app"]
|
||||
assert.Equal(t, "my-app", app.Name)
|
||||
assert.Equal(t, "My App", app.Description)
|
||||
|
@ -27,6 +37,12 @@ func TestAppsOverride(t *testing.T) {
|
|||
b := loadTarget(t, "./apps", "development")
|
||||
assert.Equal(t, "apps", b.Config.Bundle.Name)
|
||||
|
||||
diags := bundle.Apply(context.Background(), b,
|
||||
bundle.Seq(
|
||||
mutator.SetVariables(),
|
||||
mutator.ResolveVariableReferences("variables"),
|
||||
))
|
||||
assert.Empty(t, diags)
|
||||
app := b.Config.Resources.Apps["my_app"]
|
||||
assert.Equal(t, "my-app", app.Name)
|
||||
assert.Equal(t, "My App", app.Description)
|
||||
|
@ -40,6 +56,6 @@ func TestAppsOverride(t *testing.T) {
|
|||
assert.Equal(t, "CAN_MANAGE", string(app.Resources[1].Job.Permission))
|
||||
assert.Equal(t, "key", app.Resources[2].Secret.Key)
|
||||
assert.Equal(t, "scope", app.Resources[2].Secret.Scope)
|
||||
assert.Equal(t, "CAN_USE", string(app.Resources[2].SqlWarehouse.Permission))
|
||||
assert.Equal(t, "CAN_USE", string(app.Resources[2].Secret.Permission))
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ func loadTargetWithDiags(path, env string) (*bundle.Bundle, diag.Diagnostics) {
|
|||
mutator.MergeJobParameters(),
|
||||
mutator.MergeJobTasks(),
|
||||
mutator.MergePipelineClusters(),
|
||||
mutator.MergeApps(),
|
||||
))
|
||||
return b, diags
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue