Skip to content

Bug: Molecule and Molecule Plugins packages missing from Tox Integration Environment install_deps #549

@dbrennand

Description

@dbrennand

Summary

When using tox-ansible version 26.3.0 for integration tests on a collection which follows the User Guide - Testing Molecule Scenarios method.

In the tox-ansible integration-* environments install_deps phase the molecule and molecule-plugins packages are not installed causing pytest-ansible to fail:

uv run tox --ansible --conf tox-ansible.ini -e integration-py3.14-2.20
integration-py3.14-2.20: install_deps> .venv/bin/uv pip install 'ansible-compat>=25.11.0' 'ansible-dev-environment>=26.2.0' 'pytest-ansible>=v4.1.1' 'pytest-xdist>=3.4.0' 'pytest>=7.4.3'
integration-py3.14-2.20: commands[0]> python3 -m pytest --ansible-unit-inject-only ./tests/integration
=================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.14.3, pytest-9.0.3, pluggy-1.6.0
cachedir: .tox/integration-py3.14-2.20/.pytest_cache
ansible: 2.20.4
configfile: pyproject.toml
plugins: ansible-26.4.0, xdist-3.8.0, anyio-4.13.0
collected 0 items / 1 error                                                                                                                                                                                                                                                               

========================================================================================================================================= ERRORS ==========================================================================================================================================
_________________________________________________________________________________________________________________ ERROR collecting tests/integration/test_integration.py __________________________________________________________________________________________________________________
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/_pytest/python.py:249: in pytest_pycollect_makeitem
    return list(collector._genfunctions(name, obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/_pytest/python.py:475: in _genfunctions
    self.ihook.pytest_generate_tests.call_extra(methods, dict(metafunc=metafunc))
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/pluggy/_hooks.py:573: in call_extra
    return self._hookexec(self.name, hookimpls, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.tox/integration-py3.14-2.20/lib64/python3.14/site-packages/pytest_ansible/plugin.py:407: in pytest_generate_tests
    pytest.exit("molecule not installed or found.")
E   _pytest.outcomes.Exit: molecule not installed or found.
================================================================================================================================= short test summary info =================================================================================================================================
ERROR tests/integration/test_integration.py - _pytest.outcomes.Exit: molecule not installed or found.

Current workaround:

[testenv]
commands_pre =
    integration: uv pip install 'molecule' 'molecule-plugins[docker]'

molecule-plugins being installed I guess is up for discussion, but IMHO at a minimum if we want to pattern to work we need molecule installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions