Matt,

I think there is valid stuff in what you're saying. Let me write out a
formula:

cd ~/Documents/test

git clone https://github.com/ansible-collections/community.aws.git

ansible-galaxy collection build

rm -rf ~/.ansible/collections/ansible_collections/community/aws/

ansible-galaxy collection install community-aws-1.0.0.tar.gz

cd ~/.ansible/collections/ansible_collections/community/aws/

ansible-test sanity

Disclosure: I have worked a lot with other collections. I have never ran
the community.aws collection tests before, to my knowledge.

Importantly - is there a good software development reason for all the steps
here? Absolutely. Testing the build as opposed to the source is
valuable, and at this point with collections, only supporting testing the
built version makes sense. Everyone developing needs to know the
build-install process, and people who know it tend to be thankful that we
have it. I think we need more advocacy of it.

The errors that come from ansible-test in particular are probably the
highest impact pain point. There is a very specific practice that it works
well for, but it's hard for people to get there with the error messages
that it gives.

However, that still winds me up with

> AttributeError: 'TypeError' object has no attribute 'errors'

Maybe I still need to upgrade something. This does work for other
collections, so it might be something specific to this content.

Alan
github: AlanCoding


On Tue, Jul 7, 2020 at 7:36 AM Matthew Davis <davisml...@gmail.com> wrote:

> Hi Felix,
>
> > it should go pretty fast
>
> I have literally spent hours on this, and there are just so many obstacles
> to a new person trying to run existing tests.
> Do you expect it to take hours? Or less than one hour?
>
> Please give me an actual numeric estimate of how long you expect it would
> take someone to test a one-line patch, if they:
>
> * already know Python
> * already know how to use Ansible
> * already know the line they want to change
> * already know the Ansible task they want to add as a test
> * already know generic git + GitHub workflows
>
> Are there any other newcomers on this mailing list? If so please let me
> know how long it took you to set up your environment, and figure out how to
> run tests in this new world. I would like to know if my experience is
> typical, or if I'm just a foolish developer.
>
> I've been documenting the issues and some documentation additions here
> <https://github.com/ansible-collections/community.aws/issues/120> . I
> also submitted a PR to modify documentation,
> <https://github.com/ansible-collections/community.aws/pull/124> but that
> was closed without explanation. (As was another of my PRs
> <https://github.com/ansible-collections/community.aws/pull/121>. May I
> suggest that when a PR is closed the closer should add a comment? I cannot
> overstate how much the lack of explanation makes me want to give up and
> stop contributing.)
>
> As an example of an issue with tests, when I do finally manage to start
> executing the sanity checks, I get a lot of errors.
>
> ERROR: plugins/modules/rds_param_group.py:0:0: traceback:
> ModuleNotFoundError: No module named
> 'ansible_collections.community.community'
> ERROR: plugins/modules/rds_snapshot.py:0:0: traceback:
> ModuleNotFoundError: No module named
> 'ansible_collections.community.community'
>
> Does that mean I'm meant to somehow install a collection called
> community.community as a dependency? That doesn't seem to exist. Only
> community.general. Either way, am I supposed to manually install other
> collections as dependencies? Isn't the point of running tests in docker
> that the dependencies are all there in the images? If I am meant to install
> them, how do I ensure that the files installed somewhere in the system by
> `ansible-galaxy collection install my_namespace.my_collection` (which does
> not install into the PWD) get mounted into the docker container somehow?
>
> What's the status of the split into many repos? Should I expect each
> collection to have sanity tests that pass when run in the master branch?
>
> Thanks,
> Matt
>
> On Tuesday, June 30, 2020 at 10:12:59 PM UTC+10, Felix Fontein wrote:
>>
>> Hi Matt,
>>
>> > Unfortunately I'm still very lost.
>> > (Which means there's probably lots of other potential contributors
>> > who are lost too.)
>> >
>> > > If you have the module in your collection path
>> >
>> > What's a collection path?
>> > Do you mean that iam_role.py needs to be in a directory within my OS
>> > $PATH variable?
>> >
>> > Or do you mean this:
>> >
>> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#collections-paths
>>
>> yes, that's meant.
>>
>> > If the latter, which folder do I put in that path?
>> >
>> https://github.com/ansible-collections/community.aws/tree/master/plugins/modules
>> > or
>> > https://github.com/ansible-collections/community.aws
>> > or a folder that contains the clone of
>> > https://github.com/ansible-collections/community.aws ?
>>
>> The folder which contains ansible_collections. That's a folder
>> containing the folder community/aws (which finally is the checkout of
>> https://github.com/ansible-collections/community.aws).
>>
>> This is all described in
>>
>> https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections
>>
>> > I tried a -m command and got:
>> >
>> > ERROR! this task 'community.aws/iam_role.py' has extra params, which
>> > is only allowed in the following modules: import_tasks, raw,
>> > ansible.windows. win_command, win_command, add_host, meta,
>> > include_role, command, include_vars, include, win_shell, import_role,
>> > ansible.windows.win_shell, shell, include_tasks, group_by, set_fact,
>> > script
>>
>> So you did `ansible localhost -m command`? Or what exactly did you do
>> to receive this error?
>>
>> > How long do you expect it will take a newcomer to start contributing
>> > under this new split repo setup?
>> > Is it supposed to take 20 minutes, 3 hours? What's a realistic
>> > timeframe you're aiming for?
>>
>> I would expect that with the instructions in
>>
>> https://docs.ansible.com/ansible/devel/dev_guide/developing_collections.html#contributing-to-collections
>> it should go pretty fast (assuming you already know Ansible).
>>
>> I'm sure this section can be improved, but I think it already contains
>> everything important. Which parts of it were confusing to you that you
>> didn't succeed in setting up your dev environment?
>>
>> Thanks,
>> Felix
>>
>>
>>
>> > I've contributed to Ansible before, and I'm still struggling. It was
>> > a struggle before, and even more of a struggle now.
>> > The relevant documentation just seems spread over too many pages.
>> > I think someone who knows how this works should make a quick start
>> > guide, like this
>> > <
>> https://github.com/ansible-collections/community.aws/issues/120#issuecomment-651715514>.
>>
>> > Just 4 paragraphs and 4 code blocks of commands.
>> >
>> > Thanks,
>> > Matt
>>
> --
> 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/f76216ce-95df-46ff-9693-5c57af0c96a5o%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-devel/f76216ce-95df-46ff-9693-5c57af0c96a5o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAADLLLgGsNydXzTMOZEQ-d25sV0-n5Hjxa%3Dx5cs%2BiFK7x%3D7Qbg%40mail.gmail.com.

Reply via email to