ansible / molecule

Molecule aids in the development and testing of Ansible content: collections, playbooks and roles
https://ansible.readthedocs.io/projects/molecule/
MIT License
3.89k stars 664 forks source link

Latest released Molecule is broken if Ansible 2.4.0 is installed #980

Closed tvieira closed 7 years ago

tvieira commented 7 years ago

Issue Type

The current released molecule, 2.1.0, requires testinfra 1.6.3. This version of testinfra is broken with Ansible 2.4.0 due to restructure of the Ansible API.

Molecule and Ansible details

ansible 2.4.0.0 molecule, version 2.1.0

Desired Behaviour

Basic tests run successfully.

Actual Behaviour (Bug report only)

Test breaks during the 'verify' Action, executing testinfra.

    ==================================== ERRORS ====================================
    ____________________ ERROR collecting tests/test_default.py ____________________
    tests/test_default.py:6: in <module>
        os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
    ../../../../../.venvs/nebulas/lib/python2.7/site-packages/testinfra/utils/ansible_runner.py:150: in __init__
        self.variable_manager = ansible.vars.VariableManager()
    E   AttributeError: 'module' object has no attribute 'VariableManager'
    =============================== warnings summary ===============================
    None
      Module already imported so can not be re-written: testinfra

    -- Docs: http://doc.pytest.org/en/latest/warnings.html
    !!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
    ===================== 1 warnings, 1 error in 0.72 seconds ======================

Quick fix

To fix this issue in my environment I have to update testinfra to 1.7.1 or above. See https://testinfra.readthedocs.io/en/latest/changelog.html.

As I understand, this has been fixed already if we look at https://github.com/metacloud/molecule/blob/master/requirements.txt, but the current release at Pypi server does not correspond to this change. (fix release?)

Thanks.

retr0h commented 7 years ago

Thanks for the issue. This was addressed in #978. However, Molecule 2.2 has not been released yet.

tvieira commented 7 years ago

@retr0h understood. I would +1 a hotfix for this issue in specific and get it released in the Pypi server ASAP, otherwise anyone that runs a "pip install molecule" will have its tests failed.

retr0h commented 7 years ago

@tvieira Molecule does not currently support Ansible 2.4, hence it has not been released. If someone is using Ansible 2.4 with Molecule then they are running an unsupported version until I release it. I like to verify all is well with releases before I jsut shove them out the door, and unfortunately that takes time.

retr0h commented 7 years ago

Molecule 2.4 released to pypi which supports Ansible 2.4.