executing community.windows integration tests?

Hi
I am trying to execute community.windows integration tests, specifically win_regmerge’s
I cloned the repo: https://github.com/ansible-collections/community.windows
and ran,

ansible-test windows-integration --inventory inventory.winrm win_regmerge

assuming no special steps need to be done: https://github.com/ansible-collections/community.windows#testing-with-ansible-test
but I am experiencing an error:

Running win_regmerge integration test role
[WARNING]: running playbook inside collection community.windows
ERROR! couldn’t resolve module/action ‘ansible.windows.win_tempfile’. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in ‘/root/ansible/ansible_collections/community/windows/tests/output/.tmp/integration/win_regmerge-moxrbr8o-ÅÑŚÌβŁÈ/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml’: line 1, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  • name: create temporary directory
    ^ here
    NOTICE: To resume at this test target, use the option: --start-at win_regmerge

I am sure ansible.windows is installed on my system as I can call it from adhoc, playbooks and docs;

ansible-doc -t module ansible.windows.win_tempfile

I am able to execute the task in main.yml with an adhoc include_tasks (it “fails” but it’s unrelated to the current issue)

ansible -m include_tasks -i inventory.winrm -a “file=~/ansible/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml” windows
win | SUCCESS => {
“changed”: false,
“include”: “~/ansible/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml”,
“include_args”: {}
}
win | SUCCESS => {
“changed”: false,
“data_changed”: false,
“data_type_changed”: false
}
win | FAILED! => {
“msg”: “The task includes an option with an undefined variable. The error was: ‘remote_tmp_dir’ is undefined\n\nThe error appears to be in ‘/root/ansible/ansible_collections/community/windows/tests/integration/targets/win_regmerge/tasks/main.yml’: line 26, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# copy over some registry files to work with\n- name: copy over some registry files to work with\n ^ here\n”
}

What am I missing?

The community.windows tests require the ansible.windows, and chocolatey.chocolatey to be installed as per the requirements https://github.com/ansible-collections/community.windows/blob/main/tests/requirements.yml. Unfortunately it is very particular as to where the collection actually is installed to and you must have it installed in the same collection root as community.windows. For example say you have setup community.windows in ~/ansible-dev/ansible_collections/community/windows you will need the other collections to be in ~/ansible-dev/ansible_collections. This is a requirement of ansible-test as it only searches that root rather than all your collections paths.