diff --git a/pavelib/bok_choy.py b/pavelib/bok_choy.py index 3666864858..5ea785290d 100644 --- a/pavelib/bok_choy.py +++ b/pavelib/bok_choy.py @@ -5,6 +5,7 @@ http://bok-choy.readthedocs.org/en/latest/ from paver.easy import task, needs, cmdopts, sh from pavelib.utils.test.suites.bokchoy_suite import BokChoyTestSuite from pavelib.utils.envs import Env +from pavelib.utils.test.utils import check_firefox_version from optparse import make_option try: @@ -24,6 +25,7 @@ __test__ = False # do not collect make_option("--verbose", action="store_const", const=2, dest="verbosity"), make_option("-q", "--quiet", action="store_const", const=0, dest="verbosity"), make_option("-v", "--verbosity", action="count", dest="verbosity"), + make_option("--skip_firefox_version_validation", action='store_false', dest="validate_firefox_version") ]) def test_bokchoy(options): """ @@ -37,6 +39,9 @@ def test_bokchoy(options): - path/to/test.py:TestFoo.test_bar It can also be left blank to run all tests in the suite. """ + if getattr(options, 'validate_firefox_version', True): + check_firefox_version() + opts = { 'test_spec': getattr(options, 'test_spec', None), 'fasttest': getattr(options, 'fasttest', False), diff --git a/pavelib/utils/test/utils.py b/pavelib/utils/test/utils.py index d42488557b..4520afacfb 100644 --- a/pavelib/utils/test/utils.py +++ b/pavelib/utils/test/utils.py @@ -4,11 +4,11 @@ Helper functions for test tasks from paver.easy import sh, task from pavelib.utils.envs import Env import os +import subprocess MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017')) MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', 'localhost') - __test__ = False # do not collect @@ -53,3 +53,23 @@ def clean_mongo(): port=MONGO_PORT_NUM, repo_root=Env.REPO_ROOT, )) + +def check_firefox_version(): + """ + Check that firefox is the correct version. + """ + expected_firefox_ver = "Mozilla Firefox 28.0" + firefox_ver = subprocess.check_output("firefox --version", shell=True).strip() + + if firefox_ver != expected_firefox_ver: + raise Exception( + 'Required firefox version not found.\n\n' + 'To install the required version:\n' + 'As the root user in devstack, run the following:\n\n' + '\t$ sudo wget -O /tmp/firefox_28.deb https://s3.amazonaws.com/vagrant.testeng.edx.org/firefox_28.0%2Bbuild2-0ubuntu0.12.04.1_amd64.deb\n' + '\t$ sudo gdebi -nq /tmp/firefox_28.deb\n\n' + 'Confirm the new version:\n' + '\t$ firefox --version\n' + '\t{version}'.format(version=expected_firefox_ver) + ) + diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index a8eacf20d1..3b9ac7491d 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -124,7 +124,7 @@ pep8==1.4.5 pylint==0.28 python-subunit==0.0.16 rednose==0.3 -selenium==2.39.0 +selenium==2.42.1 splinter==0.5.4 testtools==0.9.34 diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 948ea45186..7d0417b436 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -25,7 +25,7 @@ -e git+https://github.com/edx/django-waffle.git@823a102e48#egg=django-waffle -e git+https://github.com/edx/event-tracking.git@0.1.0#egg=event-tracking -e git+https://github.com/edx/edx-analytics-data-api-client.git@0.1.0#egg=edx-analytics-data-api-client --e git+https://github.com/edx/bok-choy.git@15756f029016e033c658380f77218fe8467948b5#egg=bok_choy +-e git+https://github.com/edx/bok-choy.git@2e6eab960a97fe41778292fe8e1b2f0b69a1be2d#egg=bok_choy -e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash -e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock -e git+https://github.com/edx/edx-ora2.git@release-2014-08-08T13.47#egg=edx-ora2