Browse Source
This patch is mainly porting from nova repository: Adds: 1.tools/flake8wrap.sh Will let developer use 'tox -epep8 -- -HEAD' to testing changes files 2.tools/pretty_tox.sh Give pretty test trace when doing unit/functional testing. Change-Id: Icedb4ed8b50532531e18784a1584fe63c5a9e017changes/47/241147/1
4 changed files with 45 additions and 4 deletions
@ -0,0 +1,20 @@
|
||||
#!/bin/sh |
||||
# |
||||
# A simple wrapper around flake8 which makes it possible |
||||
# to ask it to only verify files changed in the current |
||||
# git HEAD patch. |
||||
# |
||||
# Intended to be invoked via tox: |
||||
# |
||||
# tox -epep8 -- -HEAD |
||||
# |
||||
|
||||
if test "x$1" = "x-HEAD" ; then |
||||
shift |
||||
files=$(git diff --name-only HEAD~1 | tr '\n' ' ') |
||||
echo "Running flake8 on ${files}" |
||||
diff -u --from-file /dev/null ${files} | flake8 --max-complexity 10 --diff "$@" |
||||
else |
||||
echo "Running flake8 on all files" |
||||
exec flake8 --max-complexity 10 "$@" |
||||
fi |
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
set -o pipefail |
||||
|
||||
TESTRARGS=$1 |
||||
|
||||
# --until-failure is not compatible with --subunit see: |
||||
# |
||||
# https://bugs.launchpad.net/testrepository/+bug/1411804 |
||||
# |
||||
# this work around exists until that is addressed |
||||
if [[ "$TESTARGS" =~ "until-failure" ]]; then |
||||
python setup.py testr --slowest --testr-args="$TESTRARGS" |
||||
else |
||||
python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f |
||||
fi |
Loading…
Reference in new issue