Skip to content

Commit 8c6b1b2

Browse files
committed
Test sequencing job with task referencing non existing cluster
1 parent fc880fc commit 8c6b1b2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/integration/assessment/test_sequencing.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@ def test_migration_sequencing_job_with_task_referencing_cluster(
3434
steps = runtime_ctx.migration_sequencer.generate_steps()
3535
step_object_types = [step.object_type for step in steps]
3636
assert step_object_types == ["CLUSTER", "TASK", "JOB"]
37+
38+
39+
def test_migration_sequencing_job_with_task_referencing_non_existing_cluster(runtime_ctx) -> None:
40+
"""Sequence a job with a task referencing existing cluster"""
41+
# Cannot make an actual job referencing a non-exsting cluster
42+
task = jobs.Task(task_key="test-task", existing_cluster_id="non-existing-id")
43+
settings = jobs.JobSettings(name="test-job", tasks=[task])
44+
job = jobs.Job(job_id=1234, settings=settings)
45+
46+
maybe_job_node = runtime_ctx.migration_sequencer.register_job(job)
47+
assert maybe_job_node.failed
48+
49+
steps = runtime_ctx.migration_sequencer.generate_steps()
50+
step_object_types = [step.object_type for step in steps]
51+
assert step_object_types == ["CLUSTER", "TASK", "JOB"] # TODO: What do we expect?

0 commit comments

Comments
 (0)