-
Notifications
You must be signed in to change notification settings - Fork 0
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
cylc set stuffs #44
cylc set stuffs #44
Changes from all 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 |
---|---|---|
|
@@ -127,6 +127,11 @@ | |
''' | ||
|
||
|
||
SELECTOR_ERROR = ( | ||
'Use "--output={1}" to specify outputs, not "{0}:{1}"' | ||
) | ||
|
||
|
||
def get_option_parser() -> COP: | ||
parser = COP( | ||
__doc__, | ||
|
@@ -296,18 +301,19 @@ def get_output_opts(output_options: List[str]): | |
"""Convert outputs options to a flat list, and validate. | ||
|
||
Examples: | ||
Good: | ||
>>> get_output_opts(['a', 'b,c']) | ||
['a', 'b', 'c'] | ||
|
||
# OK: "required" is explicit default | ||
>>> get_output_opts(["required"]) | ||
>>> get_output_opts(["required"]) # "required" is explicit default | ||
[] | ||
|
||
|
||
Bad: | ||
>>> get_output_opts(["required", "a"]) # "required" must be used alone | ||
Traceback (most recent call last): | ||
InputError: | ||
# Error: "required" must be used alone | ||
>>> get_output_opts(["required", "a"]) | ||
>>> get_output_opts(["waiting"]) # cannot "reset" to waiting | ||
Traceback (most recent call last): | ||
... | ||
InputError: | ||
|
||
""" | ||
|
@@ -319,6 +325,10 @@ def get_output_opts(output_options: List[str]): | |
|
||
if "required" in outputs: | ||
raise InputError("--out=required must be used alone") | ||
if "waiting" in outputs: | ||
raise InputError( | ||
"Tasks can not be set to waiting, use a new flow to re-run" | ||
) | ||
|
||
return outputs | ||
|
||
|
@@ -341,11 +351,44 @@ def validate_opts(output_opt: List[str], prereq_opt: List[str]): | |
raise InputError("Use --prerequisite or --output, not both.") | ||
|
||
|
||
def validate_tokens(tokens_list): | ||
"""Check the cycles/tasks provided. | ||
|
||
This checks that cycle/task selectors have not been provided in the IDs. | ||
|
||
Examples: | ||
Good: | ||
>>> validate_tokens([Tokens('w//c')]) | ||
>>> validate_tokens([Tokens('w//c/t')]) | ||
|
||
Bad: | ||
>>> validate_tokens([Tokens('w//c:s')]) | ||
Traceback (most recent call last): | ||
cylc.flow.exceptions.InputError | ||
>>> validate_tokens([Tokens('w//c/t:s')]) | ||
Traceback (most recent call last): | ||
cylc.flow.exceptions.InputError | ||
|
||
""" | ||
for tokens in tokens_list: | ||
if tokens['cycle_sel']: | ||
raise InputError(SELECTOR_ERROR.format( | ||
tokens['cycle'], | ||
tokens['cycle_sel'], | ||
)) | ||
if tokens['task_sel']: | ||
raise InputError(SELECTOR_ERROR.format( | ||
tokens['task'], | ||
tokens['task_sel'], | ||
)) | ||
Comment on lines
+379
to
+383
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 absent-mindedly tried running a command like this The CLI accepted this, but it didn't match any tasks because it merged the output in with the task name. |
||
|
||
|
||
async def run( | ||
options: 'Values', | ||
workflow_id: str, | ||
*tokens_list | ||
) -> None: | ||
validate_tokens(tokens_list) | ||
|
||
pclient = get_client(workflow_id, timeout=options.comms_timeout) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,8 @@ WORKFLOW_LOG="${WORKFLOW_RUN_DIR}/log/scheduler/log" | |
# Note: double poll existence of workflow log on workflow host and then localhost to | ||
# avoid any issues with unstable mounting of the shared file system. | ||
poll ssh -oBatchMode=yes -n "${CYLC_TEST_HOST}" test -e "${WORKFLOW_LOG}" | ||
poll_grep_workflow_log -E '19700101T0000Z/t1 submitted .* => running' | ||
poll_grep_workflow_log -E '19700101T0000Z/t1 running .* => failed' | ||
poll_grep_workflow_log -E '19700101T0000Z/t1/01:submitted.* => running' | ||
poll_grep_workflow_log -E '19700101T0000Z/t1/01:running.* => failed' | ||
Comment on lines
+44
to
+45
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. Test got missed as it isn't run in CI |
||
|
||
run_ok "${TEST_NAME_BASE}-broadcast" \ | ||
cylc broadcast -n 't1' -s '[environment]CYLC_TEST_VAR_FOO=foo' "${WORKFLOW_NAME}" | ||
|
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.
Pre-empting people trying to
cylc set --out=waiting
.