Skip to content

How can I unit test my run status sensors to verify they trigger the correct jobs in sequence? #25934

Discussion options

You must be logged in to vote
from dagster import (
    run_status_sensor,
    job,
    RunRequest,
    DagsterRunStatus,
    DagsterInstance,
    build_sensor_context,
)


@job
def certain_job(): ...


@job
def other_job(): ...


@job
def job_1(): ...


@job
def job_2(): ...


@job
def job_3(): ...


@run_status_sensor(
    monitored_jobs=[certain_job],
    request_job=job_1,
    run_status=DagsterRunStatus.SUCCESS,
)
def sensor_1():
    return RunRequest(
        job_name="job_1",
    )


@run_status_sensor(
    monitored_jobs=[certain_job],
    request_job=job_2,
    run_status=DagsterRunStatus.SUCCESS,
)
def sensor_2():
    return RunRequest(
        job_name="job_2",
    )


@run_status_sensor(
    monitored_jobs=[

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by garethbrickman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: sensor Related to Sensors
1 participant