testing: default to hg42 for tests run under the hgdev environment (
bug 1454296) r?gps
Put in place infrastructure to set the default hg version for hooks to match
that which is running on production. This allows the default version of
mercurial in the dev environment to be increased without impacting testing
outcomes.
MozReview-Commit-ID: JYXfwP1fE3L
--- a/hghooks/tests/test-prevent-wptsync-changes.t
+++ b/hghooks/tests/test-prevent-wptsync-changes.t
@@ -121,17 +121,16 @@ wptsync user can push changes to testing
added 1 changesets with 2 changes to 2 files
Test pushes to try
$ cd ..
$ rm -rf client
$ hg init try
$ configurehooks try
- $ touch try/.hg/IS_FIREFOX_REPO
$ hg -q clone try client
$ cd client
$ mkdir -p testing/web-platform/tests
$ mkdir testing/web-platform/meta
$ mkdir -p taskcluster/ci
$ mkdir other
--- a/run-tests
+++ b/run-tests
@@ -15,16 +15,19 @@ import os
import subprocess
import sys
# Mercurial's run-tests.py isn't meant to be loaded as a module. We do it
# anyway.
HERE = os.path.dirname(os.path.abspath(__file__))
RUNTESTS = os.path.join(HERE, 'pylib', 'mercurial-support', 'run-tests.py')
+# By default the hgdev environment should use the same version of Mercurial
+# installed on the hg.mozilla.org servers.
+HGDEV_HG_VERSION = '4.2.3'
if __name__ == '__main__':
if 'VIRTUAL_ENV' not in os.environ:
activate = os.path.join(HERE, 'venv', 'bin', 'activate_this.py')
execfile(activate, dict(__file__=activate))
sys.executable = os.path.join(HERE, 'venv', 'bin', 'python')
os.environ['VIRTUAL_ENV'] = os.path.join(HERE, 'venv')
@@ -125,17 +128,22 @@ if __name__ == '__main__':
os.environ['BUGZILLA_USERNAME'] = 'admin@example.com'
os.environ['BUGZILLA_PASSWORD'] = 'password'
orig_args = list(hg_harness_args)
# Explicitly use our own HG from the virtualenv so other installs
# on the system don't interfere.
if not options.with_hg:
- hg = os.path.join(os.path.dirname(sys.executable), 'hg')
+ # The hgdev env should use the same version on hg.m.o
+ if venv_name == 'hgdev':
+ hg = os.path.join(os.environ['VIRTUAL_ENV'], 'mercurials',
+ HGDEV_HG_VERSION, 'bin', 'hg')
+ else:
+ hg = os.path.join(os.path.dirname(sys.executable), 'hg')
hg_harness_args.extend(['--with-hg', hg])
# Always produce an XUnit result file.
hg_harness_args.extend(['--xunit',
os.path.join(HERE, 'coverage', 'results.xml')])
extensions = get_extensions()
test_files = get_test_files(extensions, venv_name)