Esempio n. 1
0
    def test_import_performance_mongo(self):
        store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)

        # we try to refresh the inheritance tree for each update_item in the import
        with check_exact_number_of_calls(store, 'refresh_cached_metadata_inheritance_tree', 28):

            # _get_cached_metadata_inheritance_tree should be called only once
            with check_exact_number_of_calls(store, '_get_cached_metadata_inheritance_tree', 1):

                # with bulk-edit in progress, the inheritance tree should be recomputed only at the end of the import
                # NOTE: On Jenkins, with memcache enabled, the number of calls here is only 1.
                #       Locally, without memcache, the number of calls is actually 2 (once more during the publish step)
                with check_number_of_calls(store, '_compute_metadata_inheritance_tree', 2):
                    self.load_test_import_course(create_if_not_present=False, module_store=store)
Esempio n. 2
0
    def test_import_performance_mongo(self):
        store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)

        # we try to refresh the inheritance tree for each update_item in the import
        with check_exact_number_of_calls(store, 'refresh_cached_metadata_inheritance_tree', 28):

            # _get_cached_metadata_inheritance_tree should be called only once
            with check_exact_number_of_calls(store, '_get_cached_metadata_inheritance_tree', 1):

                # with bulk-edit in progress, the inheritance tree should be recomputed only at the end of the import
                # NOTE: On Jenkins, with memcache enabled, the number of calls here is only 1.
                #       Locally, without memcache, the number of calls is actually 2 (once more during the publish step)
                with check_number_of_calls(store, '_compute_metadata_inheritance_tree', 2):
                    self.load_test_import_course(create_if_not_present=False, module_store=store)
Esempio n. 3
0
    def test_import_performance_mongo(self):
        store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)

        # we try to refresh the inheritance tree for each update_item in the import
        with check_exact_number_of_calls(store, store.refresh_cached_metadata_inheritance_tree, 46):

            # the post-publish step loads each item in the subtree, which calls _get_cached_metadata_inheritance_tree
            with check_exact_number_of_calls(store, store._get_cached_metadata_inheritance_tree, 22):

                # with bulk-edit in progress, the inheritance tree should be recomputed only at the end of the import
                # NOTE: On Jenkins, with memcache enabled, the number of calls here is only 1.
                #       Locally, without memcache, the number of calls is actually 2 (once more during the publish step)
                with check_number_of_calls(store, store._compute_metadata_inheritance_tree, 2):
                    self.load_test_import_course()
Esempio n. 4
0
    def test_import_performance_mongo(self):
        store = modulestore()._get_modulestore_by_type(
            ModuleStoreEnum.Type.mongo)

        # we try to refresh the inheritance tree for each update_item in the import
        with check_exact_number_of_calls(
                store, store.refresh_cached_metadata_inheritance_tree, 46):

            # the post-publish step loads each item in the subtree, which calls _get_cached_metadata_inheritance_tree
            with check_exact_number_of_calls(
                    store, store._get_cached_metadata_inheritance_tree, 22):

                # with bulk-edit in progress, the inheritance tree should be recomputed only at the end of the import
                # NOTE: On Jenkins, with memcache enabled, the number of calls here is only 1.
                #       Locally, without memcache, the number of calls is actually 2 (once more during the publish step)
                with check_number_of_calls(
                        store, store._compute_metadata_inheritance_tree, 2):
                    self.load_test_import_course()