-
Notifications
You must be signed in to change notification settings - Fork 11
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
clean the options with information for cylc rose after dumping thier … #308
Conversation
…content in rose-suite-cylc-install.conf
def test_CLI_opts_cleared(monkeypatch): | ||
"""The post install entry point should clear the three rose opts""" | ||
path = 'cylc.rose.entry_points.' | ||
monkeypatch.setattr( | ||
f'{path}record_cylc_install_options', lambda *_, **__: False) | ||
monkeypatch.setattr(f'{path}copy_config_file', lambda *_, **__: False) | ||
monkeypatch.setattr(f'{path}rose_config_exists', lambda *_, **__: True) | ||
|
||
opts = SimpleNamespace( | ||
rose_template_vars=['gee', 'whiz'], | ||
defines=['foo', 'bar'], | ||
opt_conf_keys=['thomas', 'percy']) | ||
|
||
post_install('', '', opts) | ||
assert any(opts.__dict__.values()) is False |
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.
For a functional test, how about something installs and then reinstalls a workflow using the same opts
object e.g:
def test_something(cylc_install_cl):
opts = SimpleNamespace(
rose_template_vars=['gee', 'whiz'],
defines=['foo', 'bar'],
opt_conf_keys=['thomas', 'percy']
)
# install
run_dir = cylc_install_cli(..., opts)
# check installed rose config
RoseConfigTree(run_dir).get(('template variables', 'gee')) == 'whatever'
# reinstall using same opts object (just like cylc-flow does)
run_dir = cylc_install_cli(..., opts)
# check the installed rose config again
RoseConfigTree(run_dir).get(('template variables', 'gee')) == 'whatever'
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.
I don't actually think that this change makes sense, since the original bug surfaces in cylc play
(which never runs the post install plugin) and not just cylc vip
. I think that these two PR's may both need to be scrapped and the 8.2.x solution used after all (cylc/cylc-flow#6059).
…content in rose-suite-cylc-install.conf
Partner of cylc/cylc-flow#6060
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.