Skip to content

workflow: Fix errors from ansible-test action - #59

Closed
marcelmamula wants to merge 12 commits into
sap-linuxlab:devfrom
marcelmamula:sanity-fixes
Closed

workflow: Fix errors from ansible-test action#59
marcelmamula wants to merge 12 commits into
sap-linuxlab:devfrom
marcelmamula:sanity-fixes

Conversation

@marcelmamula

@marcelmamula marcelmamula commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Premise

CI Action provided by Ansible team must be executed and passing in order to mark our collection as maintained and in good shape.

Changes

Tests

Tests were done by CI workflow in question.

@marcelmamula marcelmamula self-assigned this Sep 22, 2025
@felixfontein

felixfontein commented Sep 22, 2025

Copy link
Copy Markdown

@marcelmamula

Copy link
Copy Markdown
Contributor Author

@felixfontein @samccann Issues were resolved and CI test has passed https://github.com/sap-linuxlab/community.sap_libs/actions/runs/17938922936

I might have overshot some changes so I will test it out separately as this was not meant to be refactor. If I find that I can do with less changes, I will raise separate PR.

@marcelmamula

Copy link
Copy Markdown
Contributor Author

Regarding your latest CI failures, this might help: https://forum.ansible.com/t/making-a-collection-compatible-with-core-2-19-and-templating-changes/41717/2

@felixfontein CI works now, but I am using python matrix to force specific version. Your fix works, but it does not work on Python 2, which is not supported anyway, but github action will pick it.

I just tried with removed target-python-version and it failed on Python 2.

E     File "/root/ansible_collections/community/sap_libs/tests/unit/compat/mock.py", line 54
E       yield from data_as_list
E                ^
E   SyntaxError: invalid syntax
- generated xml file: /root/ansible_collections/community/sap_libs/tests/output/junit/python2.7-modules-units.xml -

Comment thread tests/unit/compat/mock.py

for line in data_as_list:
yield line
yield from data_as_list

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you replace for ... yield by yield from, then it won't work with Python 2 anymore. You have to decide whether you actively want to break support for Python 2 in tests.

@felixfontein

Copy link
Copy Markdown

Your fix works, but it does not work on Python 2, which is not supported anyway, but github action will pick it.

Your collection still supports it by supporting ansible-core versions that support Python 2 on the target side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants