Skip to content
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

Apply CLI clean changes to correct list #6011

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes.d/6011.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a `cylc vip` bug causing remote re-invocation to fail if using `--workflow-name` option.
4 changes: 2 additions & 2 deletions cylc/flow/option_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,9 @@ def cleanup_sysargv(
new_args[1] = script_name

# replace source path with workflow ID.
if str(source) in sys.argv:
if str(source) in new_args:
new_args.remove(str(source))
if workflow_id not in sys.argv:
if workflow_id not in new_args:
new_args.append(workflow_id)

sys.argv = new_args
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/test_option_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,22 @@ def test_combine_options(inputs, expect):
'play --foo something myworkflow'.split(),
id='no path given'
),
param(
'vip -n myworkflow --no-run-name'.split(),
{
'script_name': 'play',
'workflow_id': 'myworkflow',
'compound_script_opts': [
OptionSettings(['--workflow-name', '-n']),
OptionSettings(['--no-run-name']),
],
'script_opts': [
OptionSettings(['--not-used']),
]
},
'play myworkflow'.split(),
id='workflow-id-added'
),
]
)
def test_cleanup_sysargv(monkeypatch, argv_before, kwargs, expect):
Expand Down
Loading