Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Spark JAR task test #1658

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"artifact_path": {
"type": "string",
"description": "Path to the remote base path for artifacts"
},
"instance_pool_id": {
"type": "string",
"description": "Instance pool id for job cluster"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ resources:
num_workers: 1
spark_version: "{{.spark_version}}"
node_type_id: "{{.node_type_id}}"
instance_pool_id: "{{.instance_pool_id}}"
spark_jar_task:
main_class_name: PrintArgs
libraries:
Expand Down
21 changes: 11 additions & 10 deletions internal/bundle/spark_jar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (

"github.com/databricks/cli/internal"
"github.com/databricks/cli/internal/acc"
"github.com/databricks/cli/libs/env"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
)

func runSparkJarTest(t *testing.T, sparkVersion string) {
t.Skip("Temporarily skipping the test until auth / permission issues for UC volumes are resolved.")

env := internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(env)
cloudEnv := internal.GetEnvOrSkipTest(t, "CLOUD_ENV")
t.Log(cloudEnv)

if os.Getenv("TEST_METASTORE_ID") == "" {
t.Skip("Skipping tests that require a UC Volume when metastore id is not set.")
Expand All @@ -24,14 +23,16 @@ func runSparkJarTest(t *testing.T, sparkVersion string) {
w := wt.W
volumePath := internal.TemporaryUcVolume(t, w)

nodeTypeId := internal.GetNodeTypeId(env)
nodeTypeId := internal.GetNodeTypeId(cloudEnv)
tmpDir := t.TempDir()
instancePoolId := env.Get(ctx, "TEST_INSTANCE_POOL_ID")
bundleRoot, err := initTestTemplateWithBundleRoot(t, ctx, "spark_jar_task", map[string]any{
"node_type_id": nodeTypeId,
"unique_id": uuid.New().String(),
"spark_version": sparkVersion,
"root": tmpDir,
"artifact_path": volumePath,
"node_type_id": nodeTypeId,
"unique_id": uuid.New().String(),
"spark_version": sparkVersion,
"root": tmpDir,
"artifact_path": volumePath,
"instance_pool_id": instancePoolId,
}, tmpDir)
require.NoError(t, err)

Expand Down
Loading