Skip to content

Commit

Permalink
More tox work
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Dec 31, 2024
1 parent f13b541 commit d442422
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/integration/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 23 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d442422

Please sign in to comment.