Commit 447eb4c2 by Renzo Lucioni

Speed up course listing tests

This test was creating 500 courses in about 2.5 minutes. Creating 10 courses instead allows the test to execute in 7 seconds.
parent bd4cc57b
...@@ -29,8 +29,9 @@ from opaque_keys.edx.locations import CourseLocator ...@@ -29,8 +29,9 @@ from opaque_keys.edx.locations import CourseLocator
from xmodule.error_module import ErrorDescriptor from xmodule.error_module import ErrorDescriptor
from course_action_state.models import CourseRerunState from course_action_state.models import CourseRerunState
TOTAL_COURSES_COUNT = 500
USER_COURSES_COUNT = 50 TOTAL_COURSES_COUNT = 10
USER_COURSES_COUNT = 1
@ddt.ddt @ddt.ddt
...@@ -157,8 +158,8 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin): ...@@ -157,8 +158,8 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin):
self.assertEqual(courses_list_by_groups, []) self.assertEqual(courses_list_by_groups, [])
@ddt.data( @ddt.data(
(ModuleStoreEnum.Type.split, 5), (ModuleStoreEnum.Type.split, 3),
(ModuleStoreEnum.Type.mongo, 3) (ModuleStoreEnum.Type.mongo, 2)
) )
@ddt.unpack @ddt.unpack
def test_staff_course_listing(self, default_store, mongo_calls): def test_staff_course_listing(self, default_store, mongo_calls):
...@@ -265,8 +266,8 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin): ...@@ -265,8 +266,8 @@ class TestCourseListing(ModuleStoreTestCase, XssTestMixin):
) )
@ddt.data( @ddt.data(
(ModuleStoreEnum.Type.split, 150, 505), (ModuleStoreEnum.Type.split, 3, 13),
(ModuleStoreEnum.Type.mongo, USER_COURSES_COUNT, 3) (ModuleStoreEnum.Type.mongo, USER_COURSES_COUNT, 2)
) )
@ddt.unpack @ddt.unpack
def test_course_listing_performance(self, store, courses_list_from_group_calls, courses_list_calls): def test_course_listing_performance(self, store, courses_list_from_group_calls, courses_list_calls):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment