Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-28 21:43:46 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-28 21:43:46 (GMT)
commitc3a37eaf4f75e9f6e072121cc237a57d8605a6e3 (patch)
tree8bdc267e512cfc002263c14fee7bd0a463c83e25 /commands
parent308658452faf52fa7d95e69a26200765daa22bc5 (diff)
Handle devbot checks errors
Diffstat (limited to 'commands')
-rwxr-xr-xcommands/check23
1 files changed, 19 insertions, 4 deletions
diff --git a/commands/check b/commands/check
index ff08e80..66e1ed5 100755
--- a/commands/check
+++ b/commands/check
@@ -11,6 +11,7 @@ from devbot import run
from devbot import check
from devbot import command
from devbot import system
+from devbot import build
def _get_profile():
profile_path = os.path.expanduser("~/.sugar/uitests")
@@ -38,9 +39,7 @@ def _get_python_scripts():
return scripts
-def _check_devbot():
- print "* Checking devbot"
-
+def _run_pep8():
args = ["pep8"]
for dir_name in ["devbot", "tests"]:
@@ -50,12 +49,16 @@ def _check_devbot():
command.run(args)
+
+def _run_pylint():
args = ["pylint", "--reports=n", "--disable=C,W,R,E,F", "--enable=W0611"]
args.append(os.path.join(common.base_dir, "devbot"))
args.extend(_get_python_scripts())
command.run(args)
+
+def _run_unittests():
tests_tmp = os.path.join(common.base_dir, "tests", "tmp")
try:
os.mkdir(tests_tmp)
@@ -71,6 +74,17 @@ def _check_devbot():
shutil.rmtree(tests_tmp, ignore_errors=True)
+def _check_devbot():
+ print "* Checking devbot"
+
+ try:
+ _run_pep8()
+ _run_pylint()
+ _run_unittests()
+ except subprocess.CalledProcessError:
+ return False
+
+
def _check_ui():
print "* Checking UI"
@@ -108,7 +122,8 @@ else:
if not build.build():
sys.exit(1)
- _check_devbot()
+ if not _check_devbot():
+ sys.exit(1)
if not _check_modules():
sys.exit(1)