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
--- 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]