2023-08-14 06:43:45 +00:00
|
|
|
package config_tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestOverrideJobClusterDev(t *testing.T) {
|
2023-08-17 15:22:32 +00:00
|
|
|
b := loadTarget(t, "./override_job_cluster", "development")
|
2023-08-14 06:43:45 +00:00
|
|
|
assert.Equal(t, "job", b.Config.Resources.Jobs["foo"].Name)
|
|
|
|
assert.Len(t, b.Config.Resources.Jobs["foo"].JobClusters, 1)
|
|
|
|
|
|
|
|
c := b.Config.Resources.Jobs["foo"].JobClusters[0]
|
|
|
|
assert.Equal(t, "13.3.x-scala2.12", c.NewCluster.SparkVersion)
|
|
|
|
assert.Equal(t, "i3.xlarge", c.NewCluster.NodeTypeId)
|
|
|
|
assert.Equal(t, 1, c.NewCluster.NumWorkers)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestOverrideJobClusterStaging(t *testing.T) {
|
2023-08-17 15:22:32 +00:00
|
|
|
b := loadTarget(t, "./override_job_cluster", "staging")
|
2023-08-14 06:43:45 +00:00
|
|
|
assert.Equal(t, "job", b.Config.Resources.Jobs["foo"].Name)
|
|
|
|
assert.Len(t, b.Config.Resources.Jobs["foo"].JobClusters, 1)
|
|
|
|
|
|
|
|
c := b.Config.Resources.Jobs["foo"].JobClusters[0]
|
|
|
|
assert.Equal(t, "13.3.x-scala2.12", c.NewCluster.SparkVersion)
|
|
|
|
assert.Equal(t, "i3.2xlarge", c.NewCluster.NodeTypeId)
|
|
|
|
assert.Equal(t, 4, c.NewCluster.NumWorkers)
|
|
|
|
}
|