Skip to content

Commit

Permalink
Merge pull request #69 from hjoliver/optional-outputs-extension
Browse files Browse the repository at this point in the history
Added some integration tests.
  • Loading branch information
oliver-sanders authored Apr 26, 2024
2 parents a41cd9d + 821cddb commit 99358b1
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion tests/integration/validate/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,28 @@ def test_messages(messages, valid, flow, validate):
'Use "submit_failed" not "submit_fail" in completion expressions',
id='alt-compvar2',
),
]
pytest.param(
'foo? & foo:submitted?',
'submit-failed or succeeded',
'Use "submit_failed" rather than "submit-failed"'
' in completion expressions.',
id='submit-failed used in completion expression',
),
pytest.param(
'foo:file-1',
'succeeded or file-1',
'Replace hyphens with underscores in task outputs when'
' used in completion expressions.',
id='Hyphen used in completion expression',
),
pytest.param(
'foo:x',
'not succeeded or x',
'Error in .*'
'\nInvalid expression',
id='Non-whitelisted syntax used in completion expression',
),
]
)
def test_completion_expression_invalid(
flow,
Expand Down Expand Up @@ -292,3 +313,29 @@ def test_completion_expression_valid(
},
})
validate(id_)


def test_completion_expression_cylc7_compat(
flow,
validate,
monkeypatch
):
id_ = flow({
'scheduling': {
'graph': {'R1': 'foo'},
},
'runtime': {
'foo': {
'completion': 'succeeded and x',
'outputs': {
'x': 'xxx',
},
},
},
})
monkeypatch.setattr('cylc.flow.flags.cylc7_back_compat', True)
with pytest.raises(
WorkflowConfigError,
match="completion cannot be used in Cylc 7 compatibility mode."
):
validate(id_)

0 comments on commit 99358b1

Please sign in to comment.