Matt,

Hopefully the documentation provided by Felix answered some of your questions. 
I'll try to add a little more clarity.

> Do I need to clone both the collection repo, and the main ansible/ansible 
> repo?

No, but with some short term caveats.

If you are only interested in working on collection content, then there is no 
need to clone the ansible/ansible repo or run the hacking setup script. You 
only need to clone the collection repo and make sure it is in your collection 
path.

The caveat is that Ansible 2.9, the current released version, has basic support 
for collections. This was improved greatly in 2.10, which has not been released.

Start by using the latest version of Ansible 2.9 rather than a source checkout 
of ansible/ansible. If you run into any issues, try using 2.10 which you can 
install via pip.

pip uninstall ansible && pip install ansible --pre

If you want to run the ansible source as well as the collection source, you 
certainly can do that (that's how I work). But it is not required to use a 
source checkout of ansible/ansible in order to develop collections.


> What is the new process for testing changes to the modules that have moved to 
> a collection?
> If I want to run my code locally 
> <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#exercising-module-code-locally>
>  what do I pass as the -m argument? What folder do I need to be in?

If you have the module in your collection path, you can test the module using 
its fully qualified collection name (FQCN). For example, if you module is 
located at:

~/.ansible/collection/ansible_collections/matt/my_collection/plugins/modules/my_module.py

You can run this module with this command:

ansible all -m matt.my_collection.my_module -a '[args]'

> What about unit tests 
> <https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html#unit-tests>.
>  Is the command the same? What folder do I need to be in?
> How do I run integration tests? The new AWS collection repo does not have the 
> policy file listed in the docs.

Per the docs 
<https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#testing-collections>,
 unit and integration tests must be run from the root directory of the 
collection. The command is the same.

Regarding the AWS test questions, I am not sure about the policy file. It would 
be best to ask in #ansible-aws on Freenode IRC


---

Respectfully,

Sam Doran

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/105B07BA-2271-45AE-B190-6427F25B6870%40redhat.com.

Reply via email to