def test_system(options): """ Run tests on our djangoapps for lms and cms """ system = getattr(options, 'system', None) test_id = getattr(options, 'test_id', None) opts = { 'failed_only': getattr(options, 'failed', None), 'fail_fast': getattr(options, 'fail_fast', None), 'fasttest': getattr(options, 'fasttest', None), 'verbosity': getattr(options, 'verbosity', 1), } if test_id: if not system: system = test_id.split('/')[0] if system == 'common': system = 'lms' opts['test_id'] = test_id if test_id or system: system_tests = [suites.SystemTestSuite(system, **opts)] else: system_tests = [] for syst in ('cms', 'lms'): system_tests.append(suites.SystemTestSuite(syst, **opts)) test_suite = suites.PythonTestSuite('python tests', subsuites=system_tests, **opts) test_suite.run()
def test_system(options, passthrough_options): """ Run tests on our djangoapps for lms and cms """ system = getattr(options, 'system', None) test_id = getattr(options, 'test_id', None) if test_id: if not system: system = test_id.split('/')[0] if system in ['common', 'openedx']: system = 'lms' options.test_system['test_id'] = test_id if test_id or system: system_tests = [ suites.SystemTestSuite(system, passthrough_options=passthrough_options, **options.test_system) ] else: system_tests = [] for syst in ('cms', 'lms'): system_tests.append( suites.SystemTestSuite(syst, passthrough_options=passthrough_options, **options.test_system)) test_suite = suites.PythonTestSuite( 'python tests', subsuites=system_tests, passthrough_options=passthrough_options, **options.test_system) test_suite.run()
def test_system(options, passthrough_options): """ Run tests on our djangoapps for lms and cms """ system = getattr(options, 'system', None) test_id = getattr(options, 'test_id', None) django_version = getattr(options, 'django_version', None) assert system in (None, 'lms', 'cms') assert django_version in (None, '1.8', '1.9', '1.10', '1.11') if hasattr(options.test_system, 'with_wtw'): call_task('fetch_coverage_test_selection_data', options={ 'compare_branch': options.test_system.with_wtw }) if test_id: # Testing a single test ID. # Ensure the proper system for the test id. if not system: system = test_id.split('/')[0] if system in ['common', 'openedx']: system = 'lms' system_tests = [suites.SystemTestSuite( system, passthrough_options=passthrough_options, **options.test_system )] else: # Testing a single system -or- both systems. if system: systems = [system] else: # No specified system or test_id, so run all tests of both systems. systems = ['cms', 'lms'] system_tests = [] for syst in systems: system_tests.append(suites.SystemTestSuite( syst, passthrough_options=passthrough_options, **options.test_system )) test_suite = suites.PythonTestSuite( 'python tests', subsuites=system_tests, passthrough_options=passthrough_options, **options.test_system ) test_suite.run()
def test_system(options): """ Run tests on our djangoapps for lms and cms """ system = getattr(options, 'system', None) test_id = getattr(options, 'test_id', None) opts = { 'failed_only': getattr(options, 'failed', None), 'fail_fast': getattr(options, 'fail_fast', None), 'fasttest': getattr(options, 'fasttest', None), 'verbosity': getattr(options, 'verbosity', 1), 'extra_args': getattr(options, 'extra_args', ''), 'cov_args': getattr(options, 'cov_args', ''), 'skip_clean': getattr(options, 'skip_clean', False), 'pdb': getattr(options, 'pdb', False), 'disable_migrations': getattr(options, 'disable_migrations', False), 'processes': getattr(options, 'processes', None), 'randomize': getattr(options, 'randomize', None), } if test_id: if not system: system = test_id.split('/')[0] if system in ['common', 'openedx']: system = 'lms' opts['test_id'] = test_id if test_id or system: system_tests = [suites.SystemTestSuite(system, **opts)] else: system_tests = [] for syst in ('cms', 'lms'): system_tests.append(suites.SystemTestSuite(syst, **opts)) test_suite = suites.PythonTestSuite('python tests', subsuites=system_tests, **opts) test_suite.run()