Skip to content

Commit

Permalink
add run mode skip to cylc show
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Jan 13, 2025
1 parent ab87e15 commit b01e496
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions changes.d/6554.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cylc show now displays that a task has been set to skip mode
7 changes: 7 additions & 0 deletions cylc/flow/scripts/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
}
runtime {
completion
runMode
}
}
}
Expand Down Expand Up @@ -346,9 +347,15 @@ async def prereqs_and_outputs_query(
attrs.append("queued")
if t_proxy['isRunahead']:
attrs.append("runahead")
if (
t_proxy['runtime']['runMode']
and t_proxy['runtime']['runMode'] == 'Skip'
):
attrs.append("skip")
state_msg = state
if attrs:
state_msg += f" ({','.join(attrs)})"

ansiprint(f'<bold>state:</bold> {state_msg}')

# flow numbers, if not just 1
Expand Down
15 changes: 11 additions & 4 deletions tests/integration/scripts/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def mod_my_conf():
'destroyedtheworldyet.com/'
),
'question': 'mutually exclusive',
}
}
},
},
},
}

Expand Down Expand Up @@ -128,6 +128,7 @@ async def test_task_meta_query(mod_my_schd, capsys):
)
assert ret == 0
out, err = capsys.readouterr()

assert out.splitlines() == [
'title: Task Title',
'question: mutually exclusive',
Expand Down Expand Up @@ -199,10 +200,13 @@ async def test_task_instance_query(
'attributes_bool, flow_nums, expected_state, expected_flows',
[
pytest.param(
False, [1], 'state: waiting', None,
False, [1], 'state: waiting (skip)', None,
),
pytest.param(
True, [1, 2], 'state: waiting (held,queued,runahead)', 'flows: [1,2]',
True,
[1, 2],
'state: waiting (held,queued,runahead,skip)',
'flows: [1,2]',
)
]
)
Expand All @@ -225,6 +229,9 @@ async def test_task_instance_state_flows(
'scheduling': {
'graph': {'R1': 'a'},
},
'runtime': {
'a': {'run mode': 'skip'}
}
}
),
paused_start=True
Expand Down

0 comments on commit b01e496

Please sign in to comment.