2024-04-03 10:40:29 +00:00
|
|
|
package config_tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRelativePathTranslationDefault(t *testing.T) {
|
2024-08-20 12:54:56 +00:00
|
|
|
b, diags := initializeTarget(t, "./relative_path_translation", "default")
|
2024-04-03 10:40:29 +00:00
|
|
|
require.NoError(t, diags.Error())
|
|
|
|
|
|
|
|
t0 := b.Config.Resources.Jobs["job"].Tasks[0]
|
|
|
|
assert.Equal(t, "/remote/src/file1.py", t0.SparkPythonTask.PythonFile)
|
|
|
|
t1 := b.Config.Resources.Jobs["job"].Tasks[1]
|
|
|
|
assert.Equal(t, "/remote/src/file1.py", t1.SparkPythonTask.PythonFile)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestRelativePathTranslationOverride(t *testing.T) {
|
2024-08-20 12:54:56 +00:00
|
|
|
b, diags := initializeTarget(t, "./relative_path_translation", "override")
|
2024-04-03 10:40:29 +00:00
|
|
|
require.NoError(t, diags.Error())
|
|
|
|
|
|
|
|
t0 := b.Config.Resources.Jobs["job"].Tasks[0]
|
|
|
|
assert.Equal(t, "/remote/src/file2.py", t0.SparkPythonTask.PythonFile)
|
|
|
|
t1 := b.Config.Resources.Jobs["job"].Tasks[1]
|
|
|
|
assert.Equal(t, "/remote/src/file2.py", t1.SparkPythonTask.PythonFile)
|
|
|
|
}
|