Merge "Introduce bashate"
This commit is contained in:
commit
236a14bf3c
@ -773,6 +773,7 @@
|
|||||||
- tempest-full-test-account-no-admin-py3:
|
- tempest-full-test-account-no-admin-py3:
|
||||||
voting: false
|
voting: false
|
||||||
irrelevant-files: *tempest-irrelevant-files
|
irrelevant-files: *tempest-irrelevant-files
|
||||||
|
- openstack-tox-bashate
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- tempest-slow-py3:
|
- tempest-slow-py3:
|
||||||
|
@ -15,7 +15,8 @@ fi
|
|||||||
|
|
||||||
# isort is not compatible with the default flake8 (H306), maybe flake8-isort
|
# isort is not compatible with the default flake8 (H306), maybe flake8-isort
|
||||||
# isort -rc -sl -fss ../tempest ../setup.py
|
# isort -rc -sl -fss ../tempest ../setup.py
|
||||||
$AUTOPEP8 --exit-code --max-line-length=79 --experimental --in-place -r ../tempest ../setup.py
|
$AUTOPEP8 --exit-code --max-line-length=79 --experimental --in-place \
|
||||||
|
-r ../tempest ../setup.py
|
||||||
ERROR=$?
|
ERROR=$?
|
||||||
|
|
||||||
if [[ $ERROR -eq 0 ]]; then
|
if [[ $ERROR -eq 0 ]]; then
|
||||||
|
@ -61,7 +61,7 @@ function title_underline {
|
|||||||
printf " ===\n"
|
printf " ===\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
function print_plugin_table() {
|
function print_plugin_table {
|
||||||
title_underline ${name_col_len}
|
title_underline ${name_col_len}
|
||||||
printf "%-3s %-${name_col_len}s %s\n" "SR" "Plugin Name" "URL"
|
printf "%-3s %-${name_col_len}s %s\n" "SR" "Plugin Name" "URL"
|
||||||
title_underline ${name_col_len}
|
title_underline ${name_col_len}
|
||||||
|
@ -47,7 +47,7 @@ PROJECT_LIST="$(python tools/generate-tempest-plugins-list.py)"
|
|||||||
BLACKLIST="$(python tools/generate-tempest-plugins-list.py blacklist)"
|
BLACKLIST="$(python tools/generate-tempest-plugins-list.py blacklist)"
|
||||||
|
|
||||||
# Function to clone project using zuul-cloner or from git
|
# Function to clone project using zuul-cloner or from git
|
||||||
function clone_project() {
|
function clone_project {
|
||||||
if [ -e /usr/zuul-env/bin/zuul-cloner ]; then
|
if [ -e /usr/zuul-env/bin/zuul-cloner ]; then
|
||||||
/usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
|
/usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git \
|
||||||
https://opendev.org \
|
https://opendev.org \
|
||||||
@ -61,7 +61,7 @@ function clone_project() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# function to create virtualenv to perform sanity operation
|
# function to create virtualenv to perform sanity operation
|
||||||
function prepare_workspace() {
|
function prepare_workspace {
|
||||||
SANITY_DIR=$(pwd)
|
SANITY_DIR=$(pwd)
|
||||||
virtualenv -p python3 --clear "$SANITY_DIR"/.venv
|
virtualenv -p python3 --clear "$SANITY_DIR"/.venv
|
||||||
export TVENV="$SANITY_DIR/tools/with_venv.sh"
|
export TVENV="$SANITY_DIR/tools/with_venv.sh"
|
||||||
@ -72,7 +72,7 @@ function prepare_workspace() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Function to install project
|
# Function to install project
|
||||||
function install_project() {
|
function install_project {
|
||||||
"$TVENV" pip install "$SANITY_DIR"/"$1"
|
"$TVENV" pip install "$SANITY_DIR"/"$1"
|
||||||
# Check for test-requirements.txt file in a project then install it.
|
# Check for test-requirements.txt file in a project then install it.
|
||||||
if [ -e "$SANITY_DIR"/"$1"/test-requirements.txt ]; then
|
if [ -e "$SANITY_DIR"/"$1"/test-requirements.txt ]; then
|
||||||
@ -81,7 +81,7 @@ function install_project() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Function to perform sanity checking on Tempest plugin
|
# Function to perform sanity checking on Tempest plugin
|
||||||
function tempest_sanity() {
|
function tempest_sanity {
|
||||||
"$TVENV" tempest init "$SANITY_DIR"/tempest_sanity && \
|
"$TVENV" tempest init "$SANITY_DIR"/tempest_sanity && \
|
||||||
cd "$SANITY_DIR"/tempest_sanity && \
|
cd "$SANITY_DIR"/tempest_sanity && \
|
||||||
"$TVENV" tempest list-plugins && \
|
"$TVENV" tempest list-plugins && \
|
||||||
@ -100,7 +100,7 @@ function tempest_sanity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Function to run sanity check on each project
|
# Function to run sanity check on each project
|
||||||
function plugin_sanity_check() {
|
function plugin_sanity_check {
|
||||||
prepare_workspace && \
|
prepare_workspace && \
|
||||||
clone_project "$1" && \
|
clone_project "$1" && \
|
||||||
install_project "$1" && \
|
install_project "$1" && \
|
||||||
|
16
tox.ini
16
tox.ini
@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = pep8,py36,py37,py27,pip-check-reqs
|
envlist = pep8,py36,py37,py27,bashate,pip-check-reqs
|
||||||
minversion = 2.3.1
|
minversion = 2.3.1
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
@ -315,6 +315,20 @@ commands =
|
|||||||
-b html releasenotes/source releasenotes/build/html
|
-b html releasenotes/source releasenotes/build/html
|
||||||
whitelist_externals = rm
|
whitelist_externals = rm
|
||||||
|
|
||||||
|
[testenv:bashate]
|
||||||
|
basepython = python3
|
||||||
|
# if you want to test out some changes you have made to bashate
|
||||||
|
# against tempest, just set BASHATE_INSTALL_PATH=/path/... to your
|
||||||
|
# modified bashate tree
|
||||||
|
deps =
|
||||||
|
{env:BASHATE_INSTALL_PATH:bashate}
|
||||||
|
whitelist_externals = bash
|
||||||
|
commands = bash -c "find {toxinidir}/tools \
|
||||||
|
-not \( -type d -name .?\* -prune \) \
|
||||||
|
-type f \
|
||||||
|
-name \*.sh \
|
||||||
|
-print0 | xargs -0 bashate -v"
|
||||||
|
|
||||||
[testenv:pip-check-reqs]
|
[testenv:pip-check-reqs]
|
||||||
# Do not install test-requirements as that will pollute the virtualenv for
|
# Do not install test-requirements as that will pollute the virtualenv for
|
||||||
# determining missing packages.
|
# determining missing packages.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user