mozreviewbots: add an eslint requirement for test-eslintbot (Bug 1266244). r?gps draft
authorSteven MacLeod <smacleod@mozilla.com>
Wed, 20 Apr 2016 19:39:49 -0400
changeset 7823 7a6d49497723ae9c82f6d69bfb9b966cd83870f0
parent 7815 a0c9d911f535e4dc98ff4913bafc11f77916f03d
child 7824 87c6b9ec48c541401dcafdae50af2b57ff9cc143
push id760
push usersmacleod@mozilla.com
push dateWed, 20 Apr 2016 23:43:25 +0000
reviewersgps
bugs1266244
mozreviewbots: add an eslint requirement for test-eslintbot (Bug 1266244). r?gps The test-eslintbot.t test is now skipped if the eslint executable is not on the PATH. We do not attempt to install eslint as part of creating the test environment, I'm considering that out of scope for this change. MozReview-Commit-ID: 6VmKX3xrE4I
pylib/mozreviewbots/tests/test-eslintbot.t
testing/hghave.py
--- a/pylib/mozreviewbots/tests/test-eslintbot.t
+++ b/pylib/mozreviewbots/tests/test-eslintbot.t
@@ -1,9 +1,9 @@
-#require mozreviewdocker
+#require mozreviewdocker eslint
   $ . $TESTDIR/hgext/reviewboard/tests/helpers.sh
   $ . $TESTDIR/pylib/mozreviewbots/tests/helpers.sh
   $ commonenv rb-test-eslintbot
 
 Running setup
   $ eslintsetup
 
   $ cd client
--- a/testing/hghave.py
+++ b/testing/hghave.py
@@ -48,16 +48,21 @@ def has_docker():
 @check('hgmodocker', 'Require hgmo Docker pieces')
 def has_hgmodocker():
     return has_docker()
 
 @check('mozreviewdocker', 'Require mozreview Docker pieces')
 def has_mozreviewdocker():
     return has_docker()
 
+@check('eslint', 'Require eslint')
+def has_eslint():
+    from distutils.spawn import find_executable
+    return find_executable('eslint') is not None
+
 @check('bmodocker', 'Require BMO Docker pieces')
 def has_bmodocker():
     return has_docker()
 
 def hgversion():
     v = os.environ['HGVERSION']
     v = v.split('+')[0]
     v = v.split('-')[0]