-
Notifications
You must be signed in to change notification settings - Fork 94
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
Better queue config warning. #3618
Conversation
This trivial change really demands a simple unit test, except that it requires the whole monolithic suite config class so at the moment a functional test would be much easier to write 😬 Might be best to wait on @oliver-sanders latest experiment? #3616 (which I have seen but not read yet...). |
That's weird, style fail in |
@hjoliver I merged a PR that had https://github.com/cylc/cylc-flow/pull/3559/checks?check_run_id=685749339 |
This is definitely a unit-test problem rather than an integration-test. Unit-testing this isn't especially easy due to complex objects getting in the way, it would be a lot easier if the code was functional, however, it is still doable: Create a # untested
def test_queue_thinggy(caplog):
config = Mock()
config.Q_DEFAULT = 'default'
config.cfg = {
'scheduling': {
'queues': {
'default': {}
}
},
'runtime': {}
}
config.runtime = {
'descendents': []
}
caplog.set_level(logging.INFO, logger='cylc')
Config.configure_queues(config)
assert caplog.reccord_tuples = [
# expected log messages
] Some examples of this mocking based approach to testing methods here: https://github.com/cylc/cylc-flow/tree/master/cylc/flow/tests/main_loop |
Ha, there's already a |
Rebased to pick up the off-topic style fix; unit test added. |
members = bar | ||
[[dependencies]] | ||
# foo and bar not used | ||
graph = "beef => wellington" |
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.
🍌
This is a small change with no associated Issue. Result of a user complaint today.
The following queue validation warning applies if the task
bar
(assigned to a queue) is not defined under[runtime]
or if it is defined there but is simply not used in the graph:On this branch, the warning in the latter case changes to:
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.