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:
|
||||
check:
|
||||
jobs:
|
||||
- openstack-tox-pep8
|
||||
- airship-promenade-lint-ws
|
||||
- airship-promenade-docker-build-gate
|
||||
- airship-promenade-doc-build
|
||||
- airship-promenade-lint-pep8
|
||||
- airship-promenade-lint-chart
|
||||
- airship-promenade-unit-py35
|
||||
- airship-promenade-security-bandit
|
||||
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-tox-pep8
|
||||
- airship-promenade-lint-ws
|
||||
- airship-promenade-docker-build-gate
|
||||
- airship-promenade-doc-build
|
||||
- airship-promenade-lint-pep8
|
||||
- airship-promenade-lint-chart
|
||||
- airship-promenade-unit-py35
|
||||
- airship-promenade-security-bandit
|
||||
|
||||
post:
|
||||
jobs:
|
||||
@ -49,16 +47,6 @@
|
||||
timeout: 300
|
||||
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:
|
||||
name: airship-promenade-lint-chart
|
||||
description: |
|
||||
@ -79,16 +67,6 @@
|
||||
files:
|
||||
- ^.*\.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:
|
||||
name: airship-promenade-doc-build
|
||||
description: |
|
||||
|
@ -19,7 +19,6 @@ extras==1.0.0
|
||||
falcon==1.2.0
|
||||
fasteners==0.14.1
|
||||
fixtures==3.0.0
|
||||
flake8==2.6.2
|
||||
futurist==1.7.0
|
||||
google-auth==1.5.0
|
||||
greenlet==0.4.13
|
||||
|
@ -1 +1,6 @@
|
||||
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}
|
||||
|
||||
[testenv:bandit]
|
||||
deps = bandit==1.4.0
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
bandit -r promenade
|
||||
|
||||
[testenv:docs]
|
||||
whitelist_externals = rm
|
||||
deps =
|
||||
sphinx>=1.6.2
|
||||
sphinx_rtd_theme==0.2.4
|
||||
-r{toxinidir}/requirements-frozen.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
rm -rf doc/build
|
||||
sphinx-build -b html doc/source doc/build
|
||||
|
||||
[testenv:fmt]
|
||||
deps = yapf==0.20.0
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
yapf -ir {toxinidir}/promenade {toxinidir}/tests {toxinidir}/tools/image_tags.py
|
||||
|
||||
@ -59,8 +58,7 @@ commands =
|
||||
|
||||
[testenv:pep8]
|
||||
deps =
|
||||
yapf==0.20.0
|
||||
flake8==3.5.0
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands =
|
||||
yapf -rd {toxinidir}/promenade {toxinidir}/tests {toxinidir}/tools/image_tags.py
|
||||
flake8 {toxinidir}/promenade
|
||||
bandit -r promenade
|
||||
|
Loading…
x
Reference in New Issue
Block a user