Differential D6214 Diff 30519 python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_scheduler.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_scheduler.py
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | ... on Schedule { | ||||
message | message | ||||
stack | stack | ||||
} | } | ||||
skipReason | skipReason | ||||
} | } | ||||
} | } | ||||
cursor | cursor | ||||
} | } | ||||
scheduleState { | |||||
id | |||||
ticks { | |||||
id | |||||
timestamp | |||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
GET_UNLOADABLE_QUERY = """ | GET_UNLOADABLE_QUERY = """ | ||||
query getUnloadableSchedules { | query getUnloadableSchedules { | ||||
unloadableJobStatesOrError(jobType: SCHEDULE) { | unloadableJobStatesOrError(jobType: SCHEDULE) { | ||||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | assert ( | ||||
== JobStatus.STOPPED.value | == JobStatus.STOPPED.value | ||||
) | ) | ||||
def test_get_single_schedule_definition(graphql_context): | def test_get_single_schedule_definition(graphql_context): | ||||
context = graphql_context | context = graphql_context | ||||
instance = context.instance | instance = context.instance | ||||
schedule_selector = infer_schedule_selector(context, "partition_based_multi_mode_decorator") | |||||
# fetch schedule before reconcile | |||||
result = execute_dagster_graphql( | |||||
context, GET_SCHEDULE_QUERY, variables={"scheduleSelector": schedule_selector} | |||||
) | |||||
assert result.data | |||||
assert result.data["scheduleOrError"]["__typename"] == "Schedule" | |||||
assert result.data["scheduleOrError"]["scheduleState"] | |||||
instance.reconcile_scheduler_state( | instance.reconcile_scheduler_state( | ||||
external_repository=context.get_repository_location( | external_repository=context.get_repository_location( | ||||
main_repo_location_name() | main_repo_location_name() | ||||
).get_repository(main_repo_name()), | ).get_repository(main_repo_name()), | ||||
) | ) | ||||
schedule_selector = infer_schedule_selector(context, "partition_based_multi_mode_decorator") | |||||
result = execute_dagster_graphql( | result = execute_dagster_graphql( | ||||
context, GET_SCHEDULE_QUERY, variables={"scheduleSelector": schedule_selector} | context, GET_SCHEDULE_QUERY, variables={"scheduleSelector": schedule_selector} | ||||
) | ) | ||||
assert result.data | assert result.data | ||||
assert result.data["scheduleOrError"]["__typename"] == "Schedule" | assert result.data["scheduleOrError"]["__typename"] == "Schedule" | ||||
assert result.data["scheduleOrError"]["partitionSet"] | assert result.data["scheduleOrError"]["partitionSet"] | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |