Consolidate pep8/bandit zuul gating
This change adds the global zuul pep8 tox job, which runs both bandit and pep8 using tox. This also removes the two other airship specific lint-pep8 and bandit zuul jobs since they are both covered by the default openstack global one. Also cleaned up the tox.ini by moving the requirements into the test-requirements.txt file. Change-Id: Iccf6228ab9e6d621d3047994b3adc192d67273c9
This commit is contained in:
parent
42c947fae6
commit
f60f6d7a85
26
.zuul.yaml
26
.zuul.yaml
|
@ -13,23 +13,21 @@
|
||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
|
- openstack-tox-pep8
|
||||||
- airship-promenade-lint-ws
|
- airship-promenade-lint-ws
|
||||||
- airship-promenade-docker-build-gate
|
- airship-promenade-docker-build-gate
|
||||||
- airship-promenade-doc-build
|
- airship-promenade-doc-build
|
||||||
- airship-promenade-lint-pep8
|
|
||||||
- airship-promenade-lint-chart
|
- airship-promenade-lint-chart
|
||||||
- airship-promenade-unit-py35
|
- airship-promenade-unit-py35
|
||||||
- airship-promenade-security-bandit
|
|
||||||
|
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
|
- openstack-tox-pep8
|
||||||
- airship-promenade-lint-ws
|
- airship-promenade-lint-ws
|
||||||
- airship-promenade-docker-build-gate
|
- airship-promenade-docker-build-gate
|
||||||
- airship-promenade-doc-build
|
- airship-promenade-doc-build
|
||||||
- airship-promenade-lint-pep8
|
|
||||||
- airship-promenade-lint-chart
|
- airship-promenade-lint-chart
|
||||||
- airship-promenade-unit-py35
|
- airship-promenade-unit-py35
|
||||||
- airship-promenade-security-bandit
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -49,16 +47,6 @@
|
||||||
timeout: 300
|
timeout: 300
|
||||||
nodeset: airship-promenade-single-node
|
nodeset: airship-promenade-single-node
|
||||||
|
|
||||||
- job:
|
|
||||||
name: airship-promenade-lint-pep8
|
|
||||||
description: |
|
|
||||||
Lints Python files against the PEP8 standard
|
|
||||||
run: tools/zuul/playbooks/pep8-linter.yaml
|
|
||||||
timeout: 300
|
|
||||||
nodeset: airship-promenade-single-node
|
|
||||||
files:
|
|
||||||
- ^.*\.py$
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: airship-promenade-lint-chart
|
name: airship-promenade-lint-chart
|
||||||
description: |
|
description: |
|
||||||
|
@ -79,16 +67,6 @@
|
||||||
files:
|
files:
|
||||||
- ^.*\.py$
|
- ^.*\.py$
|
||||||
|
|
||||||
- job:
|
|
||||||
name: airship-promenade-security-bandit
|
|
||||||
description: |
|
|
||||||
Executes the Bandit security scanner against Python files
|
|
||||||
run: tools/zuul/playbooks/security-bandit.yaml
|
|
||||||
timeout: 300
|
|
||||||
nodeset: airship-promenade-single-node
|
|
||||||
files:
|
|
||||||
- ^.*\.py$
|
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: airship-promenade-doc-build
|
name: airship-promenade-doc-build
|
||||||
description: |
|
description: |
|
||||||
|
|
|
@ -19,7 +19,6 @@ extras==1.0.0
|
||||||
falcon==1.2.0
|
falcon==1.2.0
|
||||||
fasteners==0.14.1
|
fasteners==0.14.1
|
||||||
fixtures==3.0.0
|
fixtures==3.0.0
|
||||||
flake8==2.6.2
|
|
||||||
futurist==1.7.0
|
futurist==1.7.0
|
||||||
google-auth==1.5.0
|
google-auth==1.5.0
|
||||||
greenlet==0.4.13
|
greenlet==0.4.13
|
||||||
|
|
|
@ -1 +1,6 @@
|
||||||
pytest
|
pytest
|
||||||
|
flake8>=3.3.0
|
||||||
|
bandit>=1.5
|
||||||
|
yapf
|
||||||
|
sphinx>=1.6.2
|
||||||
|
sphinx_rtd_theme==0.2.4
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- hosts: primary
|
|
||||||
tasks:
|
|
||||||
- name: Execute the make target for PEP8 linting
|
|
||||||
make:
|
|
||||||
chdir: "{{ zuul.project.src_dir }}"
|
|
||||||
target: tests-pep8
|
|
||||||
register: result
|
|
||||||
failed_when: result.failed
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- hosts: primary
|
|
||||||
tasks:
|
|
||||||
- name: Execute the make target for security scanning
|
|
||||||
make:
|
|
||||||
chdir: "{{ zuul.project.src_dir }}"
|
|
||||||
target: tests-security
|
|
||||||
register: result
|
|
||||||
failed_when: result.failed
|
|
14
tox.ini
14
tox.ini
|
@ -22,23 +22,22 @@ commands =
|
||||||
pytest {posargs}
|
pytest {posargs}
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
deps = bandit==1.4.0
|
deps =
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
bandit -r promenade
|
bandit -r promenade
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
whitelist_externals = rm
|
whitelist_externals = rm
|
||||||
deps =
|
deps =
|
||||||
sphinx>=1.6.2
|
|
||||||
sphinx_rtd_theme==0.2.4
|
|
||||||
-r{toxinidir}/requirements-frozen.txt
|
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
rm -rf doc/build
|
rm -rf doc/build
|
||||||
sphinx-build -b html doc/source doc/build
|
sphinx-build -b html doc/source doc/build
|
||||||
|
|
||||||
[testenv:fmt]
|
[testenv:fmt]
|
||||||
deps = yapf==0.20.0
|
deps =
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
yapf -ir {toxinidir}/promenade {toxinidir}/tests {toxinidir}/tools/image_tags.py
|
yapf -ir {toxinidir}/promenade {toxinidir}/tests {toxinidir}/tools/image_tags.py
|
||||||
|
|
||||||
|
@ -59,8 +58,7 @@ commands =
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps =
|
deps =
|
||||||
yapf==0.20.0
|
-r{toxinidir}/test-requirements.txt
|
||||||
flake8==3.5.0
|
|
||||||
commands =
|
commands =
|
||||||
yapf -rd {toxinidir}/promenade {toxinidir}/tests {toxinidir}/tools/image_tags.py
|
|
||||||
flake8 {toxinidir}/promenade
|
flake8 {toxinidir}/promenade
|
||||||
|
bandit -r promenade
|
||||||
|
|
Loading…
Reference in New Issue