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

Sort pairs to make errors deterministic. #62

Merged
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
2 changes: 1 addition & 1 deletion cylc/flow/graph_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def parse_graph(self, graph_string: str) -> None:
pairs_dict = dict(pairs)
terminals = set(pairs_dict.values()).difference(pairs_dict.keys())

for pair in pairs:
for pair in sorted(pairs, key=lambda p: str(p[0])):
self._proc_dep_pair(pair, terminals)

@classmethod
Expand Down
7 changes: 1 addition & 6 deletions tests/unit/test_graph_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,7 @@ def test_graph_syntax_errors_2(seq, graph, expected_err):
),
param(
"foo[-P1]:succeeded? | foo[-P1]:failed? => foo",
# Order of processing can result in different error messages
# (a) foo:succeeded can't be both optional and required
# (b) foo:succeeded and foo:failed most both be optional
# if both are used.
# The word "optional" is common to both. Not ideal!
'optional',
'Output foo:succeeded can\'t be both required and optional',
id='succeed-or-failed-implies-success-optional'
),
]
Expand Down
Loading