Commit Graph

76 Commits

Author SHA1 Message Date
Nimisha Asthagiri
00d466224e Consolidate Block Structure folders
TNL-6518
2017-03-01 21:19:28 -05:00
Nimisha Asthagiri
02c24cb259 Block Structure query count and API changes 2017-02-28 23:54:57 -05:00
David Ormsbee
2051c90924 Test Speedup: Isolate Modulestore Signals
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]
2017-02-23 10:31:16 -05:00
Christopher Lee
ac2387376d Merge pull request #14233 from edx/clee/block_id
Added block_id to course blocks API response.
2017-01-03 12:53:00 -05:00
christopher lee
abe396164c Added block_id to course blocks API response. 2017-01-03 10:40:16 -05:00
Nimisha Asthagiri
99e6d53939 Preload definitions when collecting block structures 2016-12-29 08:51:26 -05:00
Sanford Student
fc943ff539 moving milestones check to access.py and upgrading milestones version 2016-08-04 14:47:15 -04:00
Nimisha Asthagiri
a1a5a0fcb9 Enable Milestones in LMS Tests 2016-07-27 14:56:24 -04:00
wajeeha-khalid
98ba4b779c MA-2076: add due date to course block API 2016-07-25 11:06:47 +05:00
Nimisha Asthagiri
1fbb4b8b25 Update BlockStructure API 2016-06-23 20:22:31 -04:00
Nimisha Asthagiri
f016647fef Enable Block Transformer Registry in tests 2016-06-23 20:22:31 -04:00
Eric Fischer
fdc6d91588 update_in_cache on lms worker (#12689)
This commit "undoes"a previous hotfix, and allows a cms course_publish
signal to trigger a block_structure update_course_in_cache task, which
is run on an lms worker queue.

Changes:
    -exposes ALTERNATE_QUEUE_ENVS
    -adds routing layer in celery.py
    -moves prior dev_with_worker settings file to devstack_with_worker
    -moves course_block api functionality into openedx/core/djangoapps/content/block_structure
2016-06-16 18:01:06 -04:00
wajeeha-khalid
05b2e65e0f MA-2247 return student view data for discussion module 2016-05-09 17:37:31 +05:00
George Schneeloch
6b8f372178 Added visible_to_staff_only field to course blocks API 2016-03-15 16:06:30 -04:00
lenacom
7e4f3fd00c fixed comment 2016-03-10 16:47:35 +03:00
lenacom
2f2c6fc5da fixed comments 2016-03-10 11:21:06 +03:00
lenacom
3aafbe591a fixed test changed by mistake 2016-03-09 16:57:45 +03:00
lenacom
f07bc1ce28 fixed comments 2016-03-09 16:52:02 +03:00
lenacom
236cf4e30d removed check for 'root' 2016-02-29 19:12:44 +03:00
lenacom
ae439310e1 New optional parameters for course blocks API: lti_url, block_types 2016-02-29 15:58:05 +03:00
Nimisha Asthagiri
d969f48646 Course Blocks API: Support accessing a substructure MA-1604 2016-02-18 10:03:58 -05:00
Nimisha Asthagiri
05767b433d Collect Course Blocks on Course Publish and Management Command
MA-1368
2016-02-03 16:56:22 -05:00
Nimisha Asthagiri
66397c35b9 Refactor Block Cache to separate Collect and Transform phases 2016-02-03 16:54:29 -05:00
Nimisha Asthagiri
3a6fbae60c Reorder transformers to fix MA-1981. 2016-01-26 15:46:15 -05:00
Nimisha Asthagiri
59605159b4 Course Blocks API: support for all blocks when no username 2016-01-05 15:06:55 -05:00
Nimisha Asthagiri
00e9237153 Course Blocks API 2015-11-05 22:30:44 +00:00