mirror of https://github.com/databricks/cli.git
Test that YAML anchors work (#96)
This commit is contained in:
parent
3b351d3b00
commit
ab1df558a2
|
@ -0,0 +1,13 @@
|
|||
bundle:
|
||||
name: yaml_anchors
|
||||
|
||||
resources:
|
||||
jobs:
|
||||
my_job:
|
||||
_: &common_cluster
|
||||
spark_version: "10.4.x-scala2.12"
|
||||
tasks:
|
||||
- task_key: "t1"
|
||||
new_cluster: *common_cluster
|
||||
- task_key: "t2"
|
||||
new_cluster: *common_cluster
|
|
@ -0,0 +1,24 @@
|
|||
package config_tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestYAMLAnchors(t *testing.T) {
|
||||
root := load(t, "./yaml_anchors")
|
||||
assert.Len(t, root.Resources.Jobs, 1)
|
||||
|
||||
j := root.Resources.Jobs["my_job"]
|
||||
require.Len(t, j.Tasks, 2)
|
||||
|
||||
t0 := j.Tasks[0]
|
||||
t1 := j.Tasks[1]
|
||||
require.NotNil(t, t0)
|
||||
require.NotNil(t, t1)
|
||||
|
||||
assert.Equal(t, "10.4.x-scala2.12", t0.NewCluster.SparkVersion)
|
||||
assert.Equal(t, "10.4.x-scala2.12", t1.NewCluster.SparkVersion)
|
||||
}
|
Loading…
Reference in New Issue