]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add "fast8" tox env
authorEric Harney <eharney@redhat.com>
Tue, 22 Sep 2015 19:43:51 +0000 (15:43 -0400)
committerEric Harney <eharney@redhat.com>
Tue, 22 Sep 2015 19:43:51 +0000 (15:43 -0400)
This replicates the run_tests.sh -8 behavior, running
flake8 only on changes made in the last commit and
working tree.

Change-Id: Iebd5746c78e840225f0860843c77f4c638877c26

tools/fast8.sh [new file with mode: 0755]
tox.ini

diff --git a/tools/fast8.sh b/tools/fast8.sh
new file mode 100755 (executable)
index 0000000..489fc6b
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+cd $(dirname "$0")/..
+CHANGED=$(git diff --name-only HEAD~2 | tr '\n' ' ')
+diff -u --from-file /dev/null $CHANGED | flake8 --diff
diff --git a/tox.ini b/tox.ini
index 9343669b4634d47a1a39d0664194d9ccb92c0a43..c48372a954ec9af989cf3c2a400ebd4992c639d5 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -114,6 +114,10 @@ commands =
   {toxinidir}/tools/config/check_uptodate.sh
   {toxinidir}/tools/check_exec.py {toxinidir}/cinder
 
+[testenv:fast8]
+commands =
+  {toxinidir}/tools/fast8.sh
+
 [testenv:pylint]
 deps = -r{toxinidir}/requirements.txt
        pylint==0.26.0