diff --git a/tools/smoke.sh b/tools/smoke.sh new file mode 100755 index 00000000..0785cb73 --- /dev/null +++ b/tools/smoke.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -eu +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +for PROJECT in ansible-lint molecule; do + echo "Running tests for $PROJECT" + if [[ -d "${TOX_ENV_DIR}/${PROJECT}/.git" ]]; then + git -C "${TOX_ENV_DIR}/${PROJECT}" pull + else + mkdir -p "${TOX_ENV_DIR}/${PROJECT}" + git clone --recursive https://github.com/ansible/${PROJECT} "${TOX_ENV_DIR}/${PROJECT}" + fi + pushd "${TOX_ENV_DIR}/${PROJECT}" > /dev/null + tox devenv + source venv/bin/activate + uv pip install -e "$SCRIPT_DIR/.." + uv pip freeze | grep "file:" + pytest + popd +done diff --git a/tox.ini b/tox.ini index 34003c92..1805cb78 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ deps = ansible217: ansible-core>=2.17,<2.18 ansible218: ansible-core>=2.18,<2.19 - devel: ansible-core @ git+https://github.com/ansible/ansible.git@c5d18c39d81e2b3b10856b2fb76747230e4fac4a # GPLv3+ + devel: ansible-core @ git+https://github.com/ansible/ansible.git@devel # GPLv3+ # avoid installing ansible-core on -devel envs: !devel: ansible-core extras = @@ -171,20 +171,23 @@ extras = docs passenv = * [testenv:smoke] -description = Run ansible-lint own testing with current code from compat library -commands_pre = - ansible localhost -m ansible.builtin.git -a 'repo=https://github.com/ansible/ansible-lint dest={envdir}/tmp/ansible-lint' - pip install -e "{envdir}/tmp/ansible-lint[test]" +description = Run ansible-lint and molecule own testing with current code from compat library +; commands_pre = +; ansible localhost -m ansible.builtin.git -a 'repo=https://github.com/ansible/ansible-lint dest={envdir}/tmp/ansible-lint' +; pip install -e "{envdir}/tmp/ansible-lint[test]" commands = - bash -c "pip freeze|grep ansible" - pytest -k role -deps = - ansible-core + bash tools/smoke.sh + ; bash -c "pip freeze|grep ansible" + ; pytest -k role +; deps = +; ansible-core setenv = {[testenv]setenv} PIP_CONSTRAINT = /dev/null PYTEST_REQPASS = 0 -changedir = {envdir}/tmp/ansible-lint +; changedir = {envdir}/tmp/ansible-lint allowlist_externals = pwd bash + sh +skip_install = true