ansible / ansible-builder

An Ansible execution environment builder
Other
289 stars 93 forks source link

Introduce a shared pattern for python test libraries #228

Open AlanCoding opened 3 years ago

AlanCoding commented 3 years ago

Lots of collections have pip requirements that are needed for testing but not for use. Probably most of them.

Right now we maintain the exclude list:

https://github.com/ansible/ansible-builder/blob/e531bafd06cadb954c7b8aaaeb52b29179d8a127/ansible_builder/requirements.py#L7-L17

A better way to configure this would be to allow the collection to specify a separate requirements file for test requirements.

Someone might also be interested in an ansible-builder option to produce an EE that includes test requirements. We would need to separate our exclude list into "always exclude" and "exclude for non-test".

Ping @thedoubl3j

Very much related to https://github.com/ansible/ansible-builder/issues/210, and we should think through a pattern that applies equally to both these topics.

AlanCoding commented 3 years ago

If we have a "default" location of build-requirements.txt top-level in a collection, then test-requirements.txt seems like the obvious place for test requirements. Of course, we would need a way to give a special location with the meta/ EE metadata for collections.

Some versions of this pattern have already occurred in collections.