From e691cb30b019884a7e1cf27bf8c8954b9e63f8cf Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Thu, 19 Apr 2018 14:34:55 -0500 Subject: [PATCH] Add bandit functional testing to tox and zuul This change adds a testenv for running bandit's functional tests via tox as well as running a check/gate job through zuul. Change-Id: I1d3ec2dbf3a04c72dac49325afed9f855d5bb17a Closes-Bug: #1765441 --- .zuul.yaml | 14 ++++++++++++++ playbooks/bandit-functional/run.yaml | 8 ++++++++ tox.ini | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100644 playbooks/bandit-functional/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index be7e0b6b..04700334 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,3 +1,15 @@ +- job: + name: bandit-functional + run: playbooks/bandit-functional/run.yaml + timeout: 600 + # TODO(gagehugo): Make voting once tests pass + voting: false + irrelevant-files: + - ^.*\.rst$ + - ^doc/.*$ + - ^tests/unit/.*$ + - ^releasenotes/.*$ + - job: name: bandit-integration-barbican parent: legacy-base @@ -146,6 +158,7 @@ - project: check: jobs: + - bandit-functional - bandit-integration-barbican - bandit-integration-glance - bandit-integration-keystone @@ -163,6 +176,7 @@ - openstack-tox-lower-constraints gate: jobs: + - bandit-functional - bandit-integration-barbican - bandit-integration-glance - bandit-integration-keystone diff --git a/playbooks/bandit-functional/run.yaml b/playbooks/bandit-functional/run.yaml new file mode 100644 index 00000000..12989a46 --- /dev/null +++ b/playbooks/bandit-functional/run.yaml @@ -0,0 +1,8 @@ +- hosts: all + tasks: + - name: Run bandit functional tests + shell: | + set -xe; + tox -e functional + args: + chdir: "{{ zuul.project.src_dir }}" diff --git a/tox.ini b/tox.ini index 4b15f2c2..7f6b67a2 100644 --- a/tox.ini +++ b/tox.ini @@ -73,6 +73,13 @@ deps = -r{toxinidir}/doc/requirements.txt commands= python setup.py build_sphinx +[testenv:functional] +deps = -r{toxinidir}/test-requirements.txt +setenv = OS_TEST_PATH=./tests/functional +commands = + find bandit -type f -name "*.pyc" -delete + stestr run '{posargs}' + [flake8] # [H106] Don't put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None.