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

Update lint error test to be inclusive of newer output format. #2158

Merged
merged 2 commits into from
Jun 6, 2024
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
25 changes: 21 additions & 4 deletions galaxy_ng/tests/integration/api/test_artifact_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,18 @@ def test_ansible_lint_exception_AAH_2606(galaxy_client, hub_version):
"plugins/modules/lm_otel_collector.py validate-modules:use-run-command-not-popen\n"

expected = [

(
"meta/runtime.yml:1: meta-runtime[unsupported-version]:"
+ " requires_ansible key must be set to a supported version."
(
"meta/runtime.yml:1: meta-runtime[unsupported-version]:"
+ " requires_ansible key must be set to a supported version."
),
(
"meta/runtime.yml:1: meta-runtime[unsupported-version]:"
+ " 'requires_ansible' key must refer to a currently supported version such as:"
),
),

(
"meta/runtime.yml:1: yaml[new-line-at-end-of-file]:"
+ " No new line character at the end of file"
Expand All @@ -419,8 +427,17 @@ def test_ansible_lint_exception_AAH_2606(galaxy_client, hub_version):
resp = wait_for_task(gc, resp)
log_messages = [item["message"] for item in resp["messages"]]
log_messages = "\n".join(log_messages)
for line in expected:
assert line in log_messages, log_messages
for lines in expected:
if not isinstance(lines, tuple):
assert lines in log_messages, log_messages
else:
found = False
for line in lines:
if line in log_messages:
found = True
break
if not found:
raise Exception(f"did not find any of {lines} in the log output")


@pytest.mark.importer
Expand Down
Loading