diff --git a/tox-ansible.ini b/tox-ansible.ini index 741af07e..10a98200 100644 --- a/tox-ansible.ini +++ b/tox-ansible.ini @@ -1,30 +1,26 @@ [tox] skipsdist = true [testenv] -# install core dependencies deps = ansible-core ansible-dev-environment pytest pytest-ansible -# allow mkdir and ln in commands_pre allowlist_externals = mkdir ln - cd -# Prepare temp ansible_collections path (some ansible-test checks may expect it) +# Prepare temp ansible_collections path commands_pre = mkdir -p {envtmpdir}/ansible_collections/vyos ln -s {toxinidir} {envtmpdir}/ansible_collections/vyos/vyos -# Run tests from your actual repo +# Run tests from your repo commands = # run ansible-test sanity from repo root (avoids ADE) - cd {toxinidir} - ansible-test sanity || echo "Sanity skipped or empty" + bash -c "cd {toxinidir} && ansible-test sanity || echo 'Sanity skipped or empty'" # run unit tests with pytest - python -m pytest --ansible-unit-inject-only {toxinidir}/tests/unit + bash -c "cd {toxinidir} && python -m pytest --ansible-unit-inject-only tests/unit"