ansible-builder icon indicating copy to clipboard operation
ansible-builder copied to clipboard

Introduce a shared pattern for python test libraries

Open AlanCoding opened this issue 4 years ago • 1 comments

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 avatar May 27 '21 14:05 AlanCoding

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.

AlanCoding avatar May 27 '21 14:05 AlanCoding