Optimize linters executions from tox and pre-commit
This patch merges all the tox linters testenv into one. It also installs the required Ansible collections with ansible-galaxy before executing ansible-lint. Morever, the 'end-of-file-fixer' pre-commit hook is working again and this patch is fixing all the related issues. Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com> Change-Id: Ib823c6c65b4853e951cb001a6eed354ba2127965
This commit is contained in:
parent
dae65ca8df
commit
abe513cc90
@ -10,4 +10,4 @@ omit = tripleo-validations/openstack/*
|
||||
ignore_errors = True
|
||||
omit =
|
||||
tripleo_validations/tests/*
|
||||
tests/*
|
||||
tests/*
|
||||
|
@ -52,4 +52,4 @@ releasenotes/build
|
||||
hosts
|
||||
*.retry
|
||||
#Vagrantfiles, since we are using docker
|
||||
Vagrantfile.*
|
||||
Vagrantfile.*
|
||||
|
@ -11,7 +11,6 @@ repos:
|
||||
- id: check-merge-conflict
|
||||
- id: check-symlinks
|
||||
- id: debug-statements
|
||||
- id: check-yaml
|
||||
files: .*\.(yaml|yml)$
|
||||
|
||||
- repo: https://gitlab.com/pycqa/flake8
|
||||
|
1
LICENSE
1
LICENSE
@ -173,4 +173,3 @@
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
|
@ -20,4 +20,3 @@ or by Ansible directly.
|
||||
* Release notes: https://docs.openstack.org/releasenotes/tripleo-validations/
|
||||
* Source: https://opendev.org/openstack/tripleo-validations
|
||||
* Bugs: https://storyboard.openstack.org/#!/project/openstack/tripleo-validations
|
||||
|
||||
|
@ -7,4 +7,3 @@ Contents:
|
||||
:glob:
|
||||
|
||||
modules/*
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/ceph_pools_pg_protection.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/check_cpus_aligned_with_dpdk_nics.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/check_flavors.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/check_ironic_boot_config.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/check_other_processes_pmd_usage.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/convert_range_to_numbers_list.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/get_dpdk_nics_numa_info.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/icmp_ping.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/ip_range.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/network_environment.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/node_disks.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/ovs_dpdk_pmd_cpus_check.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/pacemaker.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/pmd_threads_siblings_check.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/switch_vlans.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -12,4 +12,3 @@ This module provides for the following ansible plugin:
|
||||
:module: library/verify_profiles.py
|
||||
:documentation: true
|
||||
:examples: true
|
||||
|
||||
|
@ -7,4 +7,3 @@ Contents:
|
||||
:glob:
|
||||
|
||||
roles/*
|
||||
|
||||
|
@ -4,4 +4,3 @@ ceph
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/ceph
|
||||
|
||||
|
@ -4,4 +4,3 @@ check_network_gateway
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/check_network_gateway
|
||||
|
||||
|
@ -4,4 +4,3 @@ collect_flavors_and_verify_profiles
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/collect_flavors_and_verify_profiles
|
||||
|
||||
|
@ -71,4 +71,3 @@ Full Description
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/compute_tsx
|
||||
|
||||
|
@ -4,4 +4,3 @@ controller_token
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/controller_token
|
||||
|
||||
|
@ -4,4 +4,3 @@ controller_ulimits
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/controller_ulimits
|
||||
|
||||
|
@ -4,4 +4,3 @@ ctlplane_ip_range
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/ctlplane_ip_range
|
||||
|
||||
|
@ -4,4 +4,3 @@ default_node_count
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/default_node_count
|
||||
|
||||
|
@ -4,4 +4,3 @@ dhcp_validations
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/dhcp_validations
|
||||
|
||||
|
@ -4,4 +4,3 @@ frr_status
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/frr_status
|
||||
|
||||
|
@ -4,4 +4,3 @@ image_serve
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/image_serve
|
||||
|
||||
|
@ -4,4 +4,3 @@ ironic_boot_configuration
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/ironic_boot_configuration
|
||||
|
||||
|
@ -4,4 +4,3 @@ mysql_open_files_limit
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/mysql_open_files_limit
|
||||
|
||||
|
@ -4,4 +4,3 @@ network_environment
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/network_environment
|
||||
|
||||
|
@ -4,4 +4,3 @@ neutron_sanity_check
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/neutron_sanity_check
|
||||
|
||||
|
@ -4,4 +4,3 @@ node_disks
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/node_disks
|
||||
|
||||
|
@ -4,4 +4,3 @@ node_health
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/node_health
|
||||
|
||||
|
@ -46,4 +46,3 @@ Full Description
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/nova_event_callback
|
||||
|
||||
|
@ -4,4 +4,3 @@ nova_status
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/nova_status
|
||||
|
||||
|
@ -4,4 +4,3 @@ openshift_on_openstack
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/openshift_on_openstack
|
||||
|
||||
|
@ -4,4 +4,3 @@ openstack_endpoints
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/openstack_endpoints
|
||||
|
||||
|
@ -45,4 +45,3 @@ Full Description
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/overcloud_service_status
|
||||
|
||||
|
@ -4,4 +4,3 @@ ovs_dpdk_pmd
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/ovs_dpdk_pmd
|
||||
|
||||
|
@ -4,4 +4,3 @@ pacemaker_status
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/pacemaker_status
|
||||
|
||||
|
@ -4,4 +4,3 @@ rabbitmq_limits
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/rabbitmq_limits
|
||||
|
||||
|
@ -4,4 +4,3 @@ repos
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/repos
|
||||
|
||||
|
@ -4,4 +4,3 @@ stack_health
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/stack_health
|
||||
|
||||
|
@ -4,4 +4,3 @@ stonith_exists
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/stonith_exists
|
||||
|
||||
|
@ -4,4 +4,3 @@ switch_vlans
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/switch_vlans
|
||||
|
||||
|
@ -4,4 +4,3 @@ tls_everywhere
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/tls_everywhere
|
||||
|
||||
|
@ -4,4 +4,3 @@ undercloud_debug
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/undercloud_debug
|
||||
|
||||
|
@ -4,4 +4,3 @@ undercloud_disk_space
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/undercloud_disk_space
|
||||
|
||||
|
@ -4,4 +4,3 @@ undercloud_heat_purge_deleted
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/undercloud_heat_purge_deleted
|
||||
|
||||
|
@ -4,4 +4,3 @@ undercloud_process_count
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/undercloud_process_count
|
||||
|
||||
|
@ -4,4 +4,3 @@ undercloud_service_status
|
||||
|
||||
.. ansibleautoplugin::
|
||||
:role: roles/undercloud_service_status
|
||||
|
||||
|
@ -2,4 +2,4 @@
|
||||
features:
|
||||
- |
|
||||
Adds a ceph-health check which prints a warning message if Ceph cluster
|
||||
is in HEALTH_WARN state at the end of the Overcloud deployment
|
||||
is in HEALTH_WARN state at the end of the Overcloud deployment
|
||||
|
@ -2,7 +2,7 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
ansible>=2.8,!=2.8.9,!=2.9.12,<2.10.0 # GPLv3+
|
||||
ansible-core<2.12.0 # GPLv3+
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
python-subunit>=1.0.0 # Apache-2.0/BSD
|
||||
sphinx>=2.0.0,!=2.1.0 # BSD
|
||||
|
@ -1 +1 @@
|
||||
test ansible_connection=local ansible_host=localhost
|
||||
test ansible_connection=local ansible_host=localhost
|
||||
|
50
tox.ini
50
tox.ini
@ -35,7 +35,9 @@ deps =
|
||||
-c {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||
-r {toxinidir}/requirements.txt
|
||||
-r {toxinidir}/test-requirements.txt
|
||||
whitelist_externals = bash
|
||||
whitelist_externals =
|
||||
bash
|
||||
ansible-galaxy
|
||||
|
||||
[testenv:bindep]
|
||||
# Do not install any requirements. We want this to be fast and work even if
|
||||
@ -48,57 +50,15 @@ commands = bindep test
|
||||
[testenv:debug]
|
||||
commands = oslo_debug_helper {posargs}
|
||||
|
||||
[testenv:pep8]
|
||||
envdir = {toxworkdir}/linters
|
||||
commands =
|
||||
python -m pre_commit run flake8 -a
|
||||
|
||||
[testenv:ansible-lint]
|
||||
envdir = {toxworkdir}/linters
|
||||
deps =
|
||||
{[testenv:linters]deps}
|
||||
commands =
|
||||
bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/roles'"
|
||||
bash -c "ANSIBLE_LIBRARY='{toxinidir}/library'"
|
||||
python -m pre_commit run ansible-lint -a
|
||||
|
||||
[testenv:yamllint]
|
||||
envdir = {toxworkdir}/linters
|
||||
deps = {[testenv:linters]deps}
|
||||
commands =
|
||||
python -m pre_commit run yamllint -a
|
||||
|
||||
[testenv:bashate]
|
||||
envdir = {toxworkdir}/linters
|
||||
deps = {[testenv:linters]deps}
|
||||
commands =
|
||||
python -m pre_commit run bashate -a
|
||||
|
||||
[testenv:whitespace]
|
||||
envdir = {toxworkdir}/linters
|
||||
deps = {[testenv:linters]deps}
|
||||
commands =
|
||||
python -m pre_commit run trailing-whitespace -a
|
||||
|
||||
[testenv:shebangs]
|
||||
envdir = {toxworkdir}/linters
|
||||
deps = {[testenv:linters]deps}
|
||||
commands =
|
||||
python -m pre_commit run check-executables-have-shebangs -a
|
||||
|
||||
[testenv:linters]
|
||||
deps =
|
||||
-r {toxinidir}/requirements.txt
|
||||
-r {toxinidir}/test-requirements.txt
|
||||
-r {toxinidir}/molecule-requirements.txt
|
||||
commands =
|
||||
ansible-galaxy install -fr {toxinidir}/ansible-collections-requirements.yml
|
||||
python '{toxinidir}/tools/validate-files.py' .
|
||||
{[testenv:pep8]commands}
|
||||
{[testenv:ansible-lint]commands}
|
||||
{[testenv:yamllint]commands}
|
||||
{[testenv:bashate]commands}
|
||||
{[testenv:whitespace]commands}
|
||||
{[testenv:shebangs]commands}
|
||||
python -m pre_commit run -a
|
||||
|
||||
[testenv:releasenotes]
|
||||
deps = -r{toxinidir}/doc/requirements.txt
|
||||
|
Loading…
Reference in New Issue
Block a user