-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Fix auto refresh for graph view #26926
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -993,3 +993,220 @@ def test_graph_view_doesnt_fail_on_recursion_error(app, dag_maker, admin_client) | |
url = f'/dags/{dag.dag_id}/graph' | ||
resp = admin_client.get(url, follow_redirects=True) | ||
assert resp.status_code == 200 | ||
|
||
|
||
def test_task_instances(app, dag_maker, admin_client): | ||
"""Test task_instances view.""" | ||
resp = admin_client.get( | ||
f'/object/task_instances?dag_id=example_bash_operator&execution_date={DEFAULT_DATE}', | ||
follow_redirects=True, | ||
) | ||
assert resp.status_code == 200 | ||
payload = resp.json | ||
for v in payload.values(): | ||
assert v.pop('updated_at') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to mock the server_default, for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed a commit to do this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @uranusjr, much cleaner this way. I naively froze time on the test, which had no effect since fixture init happens before 🤦♂️ |
||
assert payload == { | ||
'also_run_this': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'BashOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 2, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'also_run_this', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
'run_after_loop': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'BashOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 2, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'run_after_loop', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
'run_this_last': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'EmptyOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 1, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'run_this_last', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
'runme_0': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'BashOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 3, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'runme_0', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
'runme_1': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'BashOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 3, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'runme_1', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
'runme_2': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'BashOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 3, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'runme_2', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
'this_will_skip': { | ||
'dag_id': 'example_bash_operator', | ||
'duration': None, | ||
'end_date': None, | ||
'executor_config': {}, | ||
'external_executor_id': None, | ||
'hostname': '', | ||
'job_id': None, | ||
'map_index': -1, | ||
'max_tries': 0, | ||
'next_kwargs': None, | ||
'next_method': None, | ||
'operator': 'BashOperator', | ||
'pid': None, | ||
'pool': 'default_pool', | ||
'pool_slots': 1, | ||
'priority_weight': 2, | ||
'queue': 'default', | ||
'queued_by_job_id': None, | ||
'queued_dttm': None, | ||
'run_id': 'TEST_DAGRUN', | ||
'start_date': None, | ||
'state': None, | ||
'task_id': 'this_will_skip', | ||
'trigger_id': None, | ||
'trigger_timeout': None, | ||
'try_number': 1, | ||
'unixname': 'root', | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get rid of this line now