community-topics
community-topics copied to clipboard
Standardize of tests/requirements.yml
Summary
Apparently we currently have 18/19 collections that have a tests/requirements.yml
file that is not loaded by any tool and that is not compatible with our official requirements.yml
schema.
Current unsupported format looks inspired from old requirements v1 format:
---
integration_tests_dependencies:
- community.general
- amazon.aws >= 3.0.0
unit_tests_dependencies: []
In order to improve the development experience we should aim to find an answer to the following questions:
- Can we avoid using two different file formats and schemas for two files with identical names?
- Could we extend the existing root
requirements.yml
to allow it to specify test requirements? Obviously that this means that ansible-galaxy or hub should just ignore the unknown content instead of choking when encountering it. - Can we maybe make use of
tags
to mark dependencies that are used only for testing? - Do we need more than
unit
andintegration
type of dependencies? - What about roles? Current format does not allow users to define any standalone roles as being required for testing only.
Now is probably the right time to make suggestions and get these right and hopefully future proof.
Additional Information
Possible impact on other tools:
- ansible-galaxy command seems to not be able to allow adding any keys in addition to
roles:
andcollections:
on arequirements.yml
file. That is big bad because it does not allow us to extend the file for incorporating test requirements via new keys. If we try to add special tags for test requirements, they will install with older versions of ansible-galaxy that do not know to skip these tags. Bit bad, I wonder if core team can help use with some ideas here. - ansible-hub upload (TBD)
- ansible-builder v3 makes indirect use of official
requirements.yml
files - ansible-lint and molecule are easier to fix regardless what we decide
---
roles:
- name: geerlingguy.mysql
src: https://github.com/geerlingguy/ansible-role-mysql
version: 4.2.0
tags: [test, integration] # <-- ansible-galaxy ignores these
collections:
- name: https://galaxy.ansible.com/download/community-molecule-0.1.0.tar.gz
tags: [test] # <-- ansible-galaxy ignores these