Skip to content

Commit

Permalink
Merge pull request #62 from wxtim/hilary.fix-graph-offset-opt
Browse files Browse the repository at this point in the history
Sort pairs to make errors deterministic.
  • Loading branch information
hjoliver authored Dec 16, 2024
2 parents 697f923 + 335bc4f commit 4daaf8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
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

0 comments on commit 4daaf8a

Please sign in to comment.