There are a number of Django Signals that are on the modulestore's
SignalHandler class, such as SignalHandler.course_published. These
signals can trigger very expensive processes to occur, such as course
overview or block structures generation. Most of the time, the test
author doesn't care about these side-effects.
This commit does a few things:
* Converts the signals on SignalHandler to be instances of a new
SwitchedSignal class, that allows signal sending to be disabled.
* Creates a SignalIsolationMixin helper similar in spirit to the
CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
(and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).
* Converts our various tests to use this new mechanism. In some cases,
this means adjusting query counts downwards because they no longer
have to account for publishing listener actions.
Modulestore generated signals are now muted by default during test runs.
Calls to send() them will result in no-ops. You can choose to enable
specific signals for a given subclass of ModuleStoreTestCase or
SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
attribute, like the following example:
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
class MyPublishTestCase(ModuleStoreTestCase):
ENABLED_SIGNALS = ['course_published', 'pre_publish']
You should take great care when disabling signals outside of a
ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
out into other tests. Be sure to always clean up, and never disable
signals outside of testing. Because signals are essentially process
globals, it can have a lot of unpleasant side-effects if we start
mucking around with them during live requests.
Overall, this change has cut the total test execution time for
edx-platform by a bit over a third, though we still spend a lot in
pre-test setup during our test builds.
[PERF-413]
We moved from configuring installed components in settings.py files to using just Python entry points.
This used to be a setting which enabled all XBlocks with appropriate entry points.
It was removed from the rest of the codebase in a previous PR, and this usage was
inadvertently left behind.
add flag DISABLE_LIBRARY_CREATION
add comma
use CourseCreatorRole to determine if user can create a library
add disable library creation feature flag
Conflicts:
cms/djangoapps/contentstore/views/course.py
ENABLE_CONTENT_LIBRARIES flag
check for course creator role for library creation
Conflicts:
cms/djangoapps/contentstore/views/course.py
add unit tests
make check of creation of library a true/false for forntend, add security in api call, clean tests
update tests
fix docstring of tests
fixed quality violation
fixed broken unit test and quality violations
Feedback changes and unit test to assert libraries are visible to non staff users too
fixed quality violation and feedback changes
All programs are now managed using the Django admin on the catalog service. This is the first in a series of commits removing use of the old programs service from edx-platform.
ECOM-4422
ECOM-6898
Disable (make read-only) the field for course code in the re-run form. This will prevent creation of course runs with a different course code in the course key that are intended to stand for the same course in a program, which presents problems for the course catalog mapping process.
Waffle serves as a complement to config models. It's useful in feature rollout situations where you may not want to incur the overhead of creating and committing a migration (required for adding a field to a config model), and also handles gradual, percentage-based rollouts.
ECOM-4422