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

Added some integration tests. #69

Merged
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
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_)