mirror of https://github.com/databricks/cli.git
Test transform when no Python wheel tasks defined (#714)
## Changes Fixed panic from Python transform when no python wheel tasks defined ## Tests Added regression test
This commit is contained in:
parent
46b999ed42
commit
a548eba492
|
@ -1,6 +1,7 @@
|
||||||
package python
|
package python
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -99,3 +100,34 @@ func TestTransformFiltersWheelTasksOnly(t *testing.T) {
|
||||||
require.Equal(t, "key1", tasks[0].Task.TaskKey)
|
require.Equal(t, "key1", tasks[0].Task.TaskKey)
|
||||||
require.NotNil(t, tasks[0].Task.PythonWheelTask)
|
require.NotNil(t, tasks[0].Task.PythonWheelTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNoPanicWithNoPythonWheelTasks(t *testing.T) {
|
||||||
|
tmpDir := t.TempDir()
|
||||||
|
b := &bundle.Bundle{
|
||||||
|
Config: config.Root{
|
||||||
|
Path: tmpDir,
|
||||||
|
Bundle: config.Bundle{
|
||||||
|
Target: "development",
|
||||||
|
},
|
||||||
|
Resources: config.Resources{
|
||||||
|
Jobs: map[string]*resources.Job{
|
||||||
|
"test": {
|
||||||
|
Paths: resources.Paths{
|
||||||
|
ConfigFilePath: tmpDir,
|
||||||
|
},
|
||||||
|
JobSettings: &jobs.JobSettings{
|
||||||
|
Tasks: []jobs.Task{
|
||||||
|
{
|
||||||
|
TaskKey: "notebook_task",
|
||||||
|
NotebookTask: &jobs.NotebookTask{}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
trampoline := TransformWheelTask()
|
||||||
|
err := bundle.Apply(context.Background(), b, trampoline)
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue