2024-12-13 14:38:58 +00:00
|
|
|
package bundle_test
|
2024-04-22 11:44:34 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2024-12-17 07:45:58 +00:00
|
|
|
"github.com/databricks/cli/integration/internal/acc"
|
2024-04-22 11:44:34 +00:00
|
|
|
"github.com/google/uuid"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2024-12-13 14:47:50 +00:00
|
|
|
func TestPythonWheelTaskWithEnvironmentsDeployAndRun(t *testing.T) {
|
2024-04-22 11:44:34 +00:00
|
|
|
t.Skip("Skipping test until serveless is enabled")
|
|
|
|
|
|
|
|
ctx, _ := acc.WorkspaceTest(t)
|
|
|
|
|
2024-12-16 12:41:32 +00:00
|
|
|
bundleRoot := initTestTemplate(t, ctx, "python_wheel_task_with_environments", map[string]any{
|
2024-04-22 11:44:34 +00:00
|
|
|
"unique_id": uuid.New().String(),
|
|
|
|
})
|
|
|
|
|
2024-12-16 12:41:32 +00:00
|
|
|
deployBundle(t, ctx, bundleRoot)
|
2024-04-22 11:44:34 +00:00
|
|
|
|
|
|
|
t.Cleanup(func() {
|
2024-12-16 12:41:32 +00:00
|
|
|
destroyBundle(t, ctx, bundleRoot)
|
2024-04-22 11:44:34 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
out, err := runResource(t, ctx, bundleRoot, "some_other_job")
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.Contains(t, out, "Hello from my func")
|
|
|
|
require.Contains(t, out, "Got arguments:")
|
|
|
|
require.Contains(t, out, "['my_test_code', 'one', 'two']")
|
|
|
|
|
|
|
|
out, err = runResourceWithParams(t, ctx, bundleRoot, "some_other_job", "--python-params=param1,param2")
|
|
|
|
require.NoError(t, err)
|
|
|
|
require.Contains(t, out, "Hello from my func")
|
|
|
|
require.Contains(t, out, "Got arguments:")
|
|
|
|
require.Contains(t, out, "['my_test_code', 'param1', 'param2']")
|
|
|
|
}
|