From d44242277bdbd581b0121c824ed529dfe2111adf Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 31 Dec 2024 13:32:27 +0100 Subject: [PATCH] More tox work --- tests/integration/requirements.yml | 1 + tox.ini | 28 +++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/tests/integration/requirements.yml b/tests/integration/requirements.yml index c94dd39a7a8..c536f9f99a7 100644 --- a/tests/integration/requirements.yml +++ b/tests/integration/requirements.yml @@ -3,3 +3,4 @@ collections: - ansible.windows - ansible.utils # ipv6 filter - amazon.cloud # used by integration tests - rds_cluster_modify + - community.crypto # SSL certificate generation diff --git a/tox.ini b/tox.ini index 51f028a6756..42f0c0a5625 100644 --- a/tox.ini +++ b/tox.ini @@ -19,16 +19,17 @@ ansible_desc = ansible2.18: Ansible-core 2.18 const_desc = with_constraints: (With boto3/botocore constraints) -collection_path = ansible_collections/amazon/aws +collection_path = collections/ansible_collections/amazon/aws collection_name = amazon.aws [mypy] mypy_path = {envtmpdir}/mypy full_tmp_path = {[mypy]mypy_path}/{[common]collection_path} - [ansible-sanity] sanity_tmp_path = {envtmpdir}/ansible-sanity full_tmp_path = {[ansible-sanity]sanity_tmp_path}/{[common]collection_path} - +[future-lint] +lint_tmp_path = {envtmpdir}/ansible-lint +full_tmp_path = {[future-lint]lint_tmp_path}/{[common]collection_path} [testenv] description = Run the unit tests {[common]ansible_desc}/{base_python} {[common]const_desc} @@ -158,11 +159,28 @@ commands = {posargs:{[common]lint_dirs}} [testenv:ansible-lint-future] +allowlist_externals = echo,cd,rm,mkdir,ln,ls labels = future-lint description = Run ansible-lint -deps = ansible-lint +# ansible-lint expects us to be installed into ansible_collections/amazon/aws +# by default we're checked out into amazon.aws +set_env = + ANSIBLE_HOME={[future-lint]lint_tmp_path} +commands_pre = + rm -rf {[future-lint]lint_tmp_path} + mkdir -p {[future-lint]full_tmp_path} + rm -d {[future-lint]full_tmp_path} + ln -s {toxinidir} {[future-lint]full_tmp_path} + ansible-galaxy collection install git+https://github.com/ansible-collections/community.aws.git + ansible-galaxy collection install -r tests/integration/requirements.yml +deps = + ansible-lint + jmespath + git+https://github.com/ansible/ansible.git@devel + shellcheck-py commands = - ansible-lint {posargs:tests/integration/targets} + cd {[future-lint]full_tmp_path} + ansible-lint --skip-list=name[missing],args[module],ignore-errors,yaml[line-length] {posargs:tests/integration/targets} [testenv:ansible-sanity] allowlist_externals = echo,cd,rm,mkdir,ln,ls