-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove code that modifies ansible import paths #4380
Conversation
9a7d114
to
19b6a10
Compare
As part of new test-isolation strategy, molecule will no longer take care itself about modification of: - ANSIBLE_COLLECTIONS_PATH - ANSIBLE_ROLES_PATH - ANSIBLE_LIBRARY - ANSIBLE_FILTER_PLUGINS Test isolation is supposed to be covered transparently by ansible-compat runtime when code runs inside a virtual environment. Related: https://ansible.readthedocs.io/projects/dev-tools/user-guide/test-isolation/
19b6a10
to
68c96a4
Compare
@ssbarnea - This breaks my In cisagov/skeleton-ansible-role#217 I tried explicitly listing the role to be tested in If there are more changes forthcoming that will fix this then I can pin to |
Hello, I concurr with the above comment by @jsf9k. @ssbarnea Could you please explain the correct way to upgrade to version I understand the rationale of test isolation behind the change but my feeling is that testing a local role's code is the first and most common thing people do with molecule. I think this change could deter most the maintainers of the most common OSS roles from upgrading to this version of molecule and thus following current best practices. For instance all the First thing most people will be tempted to do is pin molecule to Happy do discuss this and available to help easing the migration. |
Molecule used to modify the roles path for us, but as of v25.2.0 no longer does. (See ansible/molecule#4380 for details.) As a result we must now modify it ourselves.
We fixed it by explicitly setting |
cisagov/skeleton-ansible-role#221 shows how I am intending to work around this. Very similar to @remod's solution. |
Molecule and Ansible must behave in exactly the same way when searching for roles. Ansible has its own rules, and Molecule must test that Ansible will work properly in production. Changing this on the Molecule side no longer guarantees that when Ansible is running, everything will work properly. Everything's broken with this new version, and a step backwards is imperative. How does Molecule benefit from managing things differently? Adding an environment variable to return to normal operation is not an efficient solution. |
git clean -xdf tar zcvf ../python-molecule_25.2.0.orig.tar.gz --exclude=.git . debuild -uc -us cp python-molecule.spec ../python-molecule_25.2.0-1.spec cp ../python*-molecule*25.2.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-25.2.0/ rm -rf ../python*-molecule*25.2.0*.* See ansible#4380 Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
Once I revert this PR my CI case working fine again: |
As part of new test-isolation strategy, molecule will no longer take
care itself about modification of:
Test isolation is supposed to be covered transparently by ansible-compat runtime when code runs inside a virtual environment. Molecule is already using it for running all its external commands.
Related: https://ansible.readthedocs.io/projects/dev-tools/user-guide/test-isolation/