diff --git a/cms/envs/jasmine.py b/cms/envs/jasmine.py new file mode 100644 index 0000000000..f85edc59a0 --- /dev/null +++ b/cms/envs/jasmine.py @@ -0,0 +1,31 @@ +""" +This configuration is used for running jasmine tests +""" + +from .test import * +from logsettings import get_logger_config + +ENABLE_JASMINE = True +DEBUG = True + +LOGGING = get_logger_config(ENV_ROOT / "log", + logging_env="dev", + tracking_filename="tracking.log", + dev_env=True, + debug=True) + +PIPELINE_JS['js-test-source'] = { + 'source_filenames': sum([ + pipeline_group['source_filenames'] + for pipeline_group + in PIPELINE_JS.values() + ], []), + 'output_filename': 'js/cms-test-source.js' +} + +PIPELINE_JS['spec'] = { + 'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.coffee')), + 'output_filename': 'js/cms-spec.js' +} + +STATICFILES_DIRS.append(COMMON_ROOT / 'test' / 'phantom-jasmine' / 'lib') diff --git a/cms/urls.py b/cms/urls.py index 7b3dd90a0b..8ff4e67a46 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -68,7 +68,7 @@ urlpatterns += ( ) -if settings.DEBUG: +if settings.ENABLE_JASMINE: ## Jasmine urlpatterns = urlpatterns + (url(r'^_jasmine/', include('django_jasmine.urls')),) diff --git a/lms/envs/common.py b/lms/envs/common.py index 62d0db9577..6889181713 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -446,16 +446,13 @@ PIPELINE_JS = { 'source_filenames': module_js, 'output_filename': 'js/lms-modules.js', }, - 'spec': { - 'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.coffee')), - 'output_filename': 'js/lms-spec.js' - }, 'discussion': { 'source_filenames': discussion_js, 'output_filename': 'js/discussion.js' - } + }, } + PIPELINE_DISABLE_WRAPPER = True # Compile all coffee files in course data directories if they are out of date. diff --git a/lms/envs/jasmine.py b/lms/envs/jasmine.py new file mode 100644 index 0000000000..e90fd2e101 --- /dev/null +++ b/lms/envs/jasmine.py @@ -0,0 +1,31 @@ +""" +This configuration is used for running jasmine tests +""" + +from .test import * +from logsettings import get_logger_config + +ENABLE_JASMINE = True +DEBUG = True + +LOGGING = get_logger_config(ENV_ROOT / "log", + logging_env="dev", + tracking_filename="tracking.log", + dev_env=True, + debug=True) + +PIPELINE_JS['js-test-source'] = { + 'source_filenames': sum([ + pipeline_group['source_filenames'] + for pipeline_group + in PIPELINE_JS.values() + ], []), + 'output_filename': 'js/lms-test-source.js' +} + +PIPELINE_JS['spec'] = { + 'source_filenames': sorted(rooted_glob(PROJECT_ROOT / 'static/', 'coffee/spec/**/*.coffee')), + 'output_filename': 'js/lms-spec.js' +} + +STATICFILES_DIRS.append(COMMON_ROOT / 'test' / 'phantom-jasmine' / 'lib') diff --git a/lms/urls.py b/lms/urls.py index 8cc81a438b..d8a80a370f 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -242,7 +242,7 @@ if settings.QUICKEDIT: urlpatterns += (url(r'^dogfood/(?P[^/]*)$', 'dogfood.views.df_capa_problem'),) -if settings.DEBUG: +if settings.ENABLE_JASMINE: ## Jasmine and admin urlpatterns=urlpatterns + (url(r'^_jasmine/', include('django_jasmine.urls')), url(r'^admin/', include(admin.site.urls)), diff --git a/rakefile b/rakefile index ad02355f74..e0972df12a 100644 --- a/rakefile +++ b/rakefile @@ -43,7 +43,7 @@ end def django_for_jasmine(system) django_pid = fork do - exec(*django_admin(system, 'dev', 'runserver', '12345').split(' ')) + exec(*django_admin(system, 'jasmine', 'runserver', '12345').split(' ')) end puts django_pid jasmine_url = 'http://localhost:12345/_jasmine/'