Skip to content

Commit fc880fc

Browse files
committed
Test sequencing job with task referencing existing cluster
1 parent 522a864 commit fc880fc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/integration/assessment/test_sequencing.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from databricks.sdk.service import jobs
2+
3+
14
def test_migration_sequencing_simple_job(make_job, runtime_ctx) -> None:
25
"""Sequence a simple job"""
36
job = make_job()
@@ -8,3 +11,26 @@ def test_migration_sequencing_simple_job(make_job, runtime_ctx) -> None:
811
steps = runtime_ctx.migration_sequencer.generate_steps()
912
step_object_types = [step.object_type for step in steps]
1013
assert step_object_types == ["TASK", "JOB"]
14+
15+
16+
def test_migration_sequencing_job_with_task_referencing_cluster(
17+
make_job,
18+
make_notebook,
19+
runtime_ctx,
20+
env_or_skip,
21+
) -> None:
22+
"""Sequence a job with a task"""
23+
cluster_id = env_or_skip("TEST_DEFAULT_CLUSTER_ID")
24+
task = jobs.Task(
25+
task_key="test-task",
26+
existing_cluster_id=cluster_id,
27+
notebook_task=jobs.NotebookTask(notebook_path=str(make_notebook())),
28+
)
29+
job = make_job(tasks=[task])
30+
31+
maybe_job_node = runtime_ctx.migration_sequencer.register_job(job)
32+
assert not maybe_job_node.failed
33+
34+
steps = runtime_ctx.migration_sequencer.generate_steps()
35+
step_object_types = [step.object_type for step in steps]
36+
assert step_object_types == ["CLUSTER", "TASK", "JOB"]

0 commit comments

Comments
 (0)