Skip to content

Commit

Permalink
Fixed a bug where cylc set ... --pre=all was tokenized leading to
Browse files Browse the repository at this point in the history
a warning that the task was not dependent on "all".
  • Loading branch information
wxtim committed Feb 8, 2024
1 parent 973d53b commit a8586f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ def set_prereqs_and_outputs(
return

_prereqs: List[Tokens] = [
Tokens(prereq, relative=True)
Tokens(prereq, relative=True) if prereq != 'all' else 'all'
for prereq in (prereqs or [])
]

Expand Down
12 changes: 12 additions & 0 deletions tests/integration/scripts/test_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,15 @@ async def test_incomplete_detection(
async with start(schd) as log:
schd.pool.set_prereqs_and_outputs(['1/one'], ['failed'], None, ['1'])
assert log_filter(log, contains='1/one did not complete')


async def test_pre_all(flow, scheduler, run):
"""Ensure that --pre=all is interpreted as a special case
and _not_ tokenized.
"""
id_ = flow({'scheduling': {'graph': {'R1': 'a => z'}}})
schd = scheduler(id_, paused_start=False)
async with run(schd) as log:
schd.pool.set_prereqs_and_outputs(['1/z'], [], ['all'], ['all'])
warn_or_higher = [i for i in log.records if i.levelno > 20]
assert warn_or_higher == []

0 comments on commit a8586f5

Please sign in to comment.