diff --git a/cms/envs/test.py b/cms/envs/test.py index 89c93460f7..bc43fb0510 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -308,3 +308,5 @@ derive_settings(__name__) SYSTEM_WIDE_ROLE_CLASSES = os.environ.get("SYSTEM_WIDE_ROLE_CLASSES", []) DEFAULT_MOBILE_AVAILABLE = True + +PROCTORING_SETTINGS = {} diff --git a/lms/envs/test.py b/lms/envs/test.py index 8e14cf87e5..2557ebeb10 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -594,3 +594,5 @@ ACCOUNT_MICROFRONTEND_URL = "http://account-mfe/" ########################## limiting dashboard courses ###################### DASHBOARD_COURSE_LIMIT = 250 + +PROCTORING_SETTINGS = {} diff --git a/openedx/tests/settings.py b/openedx/tests/settings.py index 97eb1ec558..434ee0da83 100644 --- a/openedx/tests/settings.py +++ b/openedx/tests/settings.py @@ -115,3 +115,5 @@ USE_TZ = True RETIREMENT_SERVICE_WORKER_USERNAME = 'RETIREMENT_SERVICE_USER' RETIRED_USERNAME_PREFIX = 'retired__user_' + +PROCTORING_SETTINGS = {} diff --git a/pavelib/paver_tests/test_paver_pytest_cmds.py b/pavelib/paver_tests/test_paver_pytest_cmds.py deleted file mode 100644 index d07ca32164..0000000000 --- a/pavelib/paver_tests/test_paver_pytest_cmds.py +++ /dev/null @@ -1,163 +0,0 @@ -# pylint: disable=unicode-format-string -""" -Tests for the pytest paver commands themselves. -Run just this test with: paver test_lib -t pavelib/paver_tests/test_paver_pytest_cmds.py -""" -from __future__ import absolute_import - -import os -import unittest - -import ddt - -from pavelib.utils.envs import Env -from pavelib.utils.test.suites import LibTestSuite, SystemTestSuite - -XDIST_TESTING_IP_ADDRESS_LIST = '0.0.0.1,0.0.0.2,0.0.0.3' - - -@ddt.ddt -class TestPaverPytestCmd(unittest.TestCase): - """ - Test Paver pytest commands - """ - - def _expected_command(self, root, test_id, pytestSubclass, run_under_coverage=True, - processes=0, xdist_ip_addresses=None): - """ - Returns the command that is expected to be run for the given test spec - and store. - """ - report_dir = Env.REPORT_DIR / root - shard = os.environ.get('SHARD') - if shard: - report_dir = report_dir / 'shard_' + shard - - expected_statement = [ - "python", - "-Wd", - "-m", - "pytest" - ] - if pytestSubclass == "SystemTestSuite": - expected_statement.append("--ds={}".format('{}.envs.{}'.format(root, Env.TEST_SETTINGS))) - expected_statement.append("--junitxml={}".format(report_dir / "nosetests.xml")) - - if xdist_ip_addresses: - expected_statement.append('--dist=loadscope') - for ip in xdist_ip_addresses.split(','): - if processes <= 0: - processes = 1 - - if pytestSubclass == "SystemTestSuite": - django_env_var_cmd = u"export DJANGO_SETTINGS_MODULE={}.envs.test".format(root) - elif pytestSubclass == "LibTestSuite": - if 'pavelib/paver_tests' in test_id: - django_env_var_cmd = u"export DJANGO_SETTINGS_MODULE={}.envs.test".format(root) - else: - django_env_var_cmd = "export DJANGO_SETTINGS_MODULE='openedx.tests.settings'" - - env_var_cmd = "{} DISABLE_COURSEENROLLMENT_HISTORY=1".format(django_env_var_cmd) - - xdist_string = u'--tx {}*ssh="jenkins@{} -o StrictHostKeyChecking=no"' \ - '//python="source edx-venv/bin/activate; {}; python"' \ - '//chdir="edx-platform"' \ - .format(processes, ip, env_var_cmd) - expected_statement.append(xdist_string) - for rsync_dir in Env.rsync_dirs(): - expected_statement.append(u'--rsyncdir {}'.format(rsync_dir)) - else: - if processes == -1: - expected_statement.append('-n auto') - expected_statement.append('--dist=loadscope') - elif processes != 0: - expected_statement.append(u'-n {}'.format(processes)) - expected_statement.append('--dist=loadscope') - - expected_statement.extend([ - "-p no:randomly", - test_id - ]) - - if run_under_coverage: - expected_statement.append('--cov') - expected_statement.append('--cov-report=') - return expected_statement - - @ddt.data('lms', 'cms') - def test_SystemTestSuite_suites(self, system): - test_id = 'tests' - suite = SystemTestSuite(system, test_id=test_id) - assert suite.cmd == self._expected_command(system, test_id, "SystemTestSuite") - - @ddt.data('lms', 'cms') - def test_SystemTestSuite_auto_processes(self, system): - test_id = 'tests' - suite = SystemTestSuite(system, test_id=test_id, processes=-1) - assert suite.cmd == self._expected_command(system, test_id, "SystemTestSuite", processes=-1) - - @ddt.data('lms', 'cms') - def test_SystemTestSuite_multi_processes(self, system): - test_id = 'tests' - suite = SystemTestSuite(system, test_id=test_id, processes=3) - assert suite.cmd == self._expected_command(system, test_id, "SystemTestSuite", processes=3) - - @ddt.data('lms', 'cms') - def test_SystemTestSuite_with_xdist(self, system): - test_id = 'tests' - suite = SystemTestSuite(system, test_id=test_id, xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - assert suite.cmd == self._expected_command(system, test_id, "SystemTestSuite", - xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - - @ddt.data('lms', 'cms') - def test_SystemTestSuite_with_xdist_multi_processes(self, system): - test_id = 'tests' - suite = SystemTestSuite(system, test_id=test_id, processes=2, xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - assert suite.cmd == self._expected_command(system, test_id, "SystemTestSuite", processes=2, - xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - - @ddt.data('lms', 'cms') - def test_SystemTestSuite_with_xdist_negative_processes(self, system): - test_id = 'tests' - suite = SystemTestSuite(system, test_id=test_id, processes=-1, xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - assert suite.cmd == self._expected_command(system, test_id, "SystemTestSuite", processes=-1, - xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - - @ddt.data('common/lib/xmodule', 'pavelib/paver_tests') - def test_LibTestSuite_suites(self, system): - test_id = 'tests' - suite = LibTestSuite(system, test_id=test_id) - assert suite.cmd == self._expected_command(system, test_id, "LibTestSuite") - - @ddt.data('common/lib/xmodule', 'pavelib/paver_tests') - def test_LibTestSuite_auto_processes(self, system): - test_id = 'tests' - suite = LibTestSuite(system, test_id=test_id, processes=-1) - assert suite.cmd == self._expected_command(system, test_id, "LibTestSuite", processes=-1) - - @ddt.data('common/lib/xmodule', 'pavelib/paver_tests') - def test_LibTestSuite_multi_processes(self, system): - test_id = 'tests' - suite = LibTestSuite(system, test_id=test_id, processes=3) - assert suite.cmd == self._expected_command(system, test_id, "LibTestSuite", processes=3) - - @ddt.data('common/lib/xmodule', 'pavelib/paver_tests') - def test_LibTestSuite_with_xdist(self, system): - test_id = 'tests' - suite = LibTestSuite(system, test_id=test_id, xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - assert suite.cmd == self._expected_command(system, test_id, "LibTestSuite", - xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - - @ddt.data('common/lib/xmodule', 'pavelib/paver_tests') - def test_LibTestSuite_with_xdist_multi_processes(self, system): - test_id = 'tests' - suite = LibTestSuite(system, test_id=test_id, processes=2, xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - assert suite.cmd == self._expected_command(system, test_id, "LibTestSuite", processes=2, - xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - - @ddt.data('common/lib/xmodule', 'pavelib/paver_tests') - def test_LibTestSuite_with_xdist_negative_processes(self, system): - test_id = 'tests' - suite = LibTestSuite(system, test_id=test_id, processes=-1, xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) - assert suite.cmd == self._expected_command(system, test_id, "LibTestSuite", processes=-1, - xdist_ip_addresses=XDIST_TESTING_IP_ADDRESS_LIST) diff --git a/pavelib/utils/test/suites/pytest_suite.py b/pavelib/utils/test/suites/pytest_suite.py index 66c1f4b841..02f5fd2882 100644 --- a/pavelib/utils/test/suites/pytest_suite.py +++ b/pavelib/utils/test/suites/pytest_suite.py @@ -180,7 +180,7 @@ class SystemTestSuite(PytestSuite): xdist_remote_processes = self.processes for ip in self.xdist_ip_addresses.split(','): # Propogate necessary env vars to xdist containers - env_var_cmd = u'export DJANGO_SETTINGS_MODULE={} DISABLE_COURSEENROLLMENT_HISTORY={}'\ + env_var_cmd = u'export DJANGO_SETTINGS_MODULE={} DISABLE_COURSEENROLLMENT_HISTORY={} PYTHONHASHSEED=0'\ .format('{}.envs.{}'.format(self.root, self.settings), self.disable_courseenrollment_history) xdist_string = u'--tx {}*ssh="jenkins@{} -o StrictHostKeyChecking=no"' \