Added test to verify scripts.Execute mutator works correctly (#1237)

## Changes
Follow up to https://github.com/databricks/cli/pull/1232
This commit is contained in:
Andrew Nester 2024-02-26 11:08:03 +01:00 committed by GitHub
parent fb8f415e29
commit 0839e6f66a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -34,3 +34,18 @@ func TestExecutesHook(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, "Hello", strings.TrimSpace(line)) require.Equal(t, "Hello", strings.TrimSpace(line))
} }
func TestExecuteMutator(t *testing.T) {
b := &bundle.Bundle{
Config: config.Root{
Experimental: &config.Experimental{
Scripts: map[config.ScriptHook]config.Command{
config.ScriptPreBuild: "echo 'Hello'",
},
},
},
}
err := bundle.Apply(context.Background(), b, Execute(config.ScriptPreInit))
require.NoError(t, err)
}