From 78fbd28f419e044d73c6a8611ea12bfdd80e2426 Mon Sep 17 00:00:00 2001 From: Dillon Dumesnil Date: Wed, 20 Oct 2021 13:41:56 -0400 Subject: [PATCH] chore: AA-1058: Update edx-when version Updates query counts for the additional query to look up the Schedule in edx-when --- .../tests/test_field_override_performance.py | 4 ++-- .../course_api/blocks/tests/test_api.py | 6 +++--- lms/djangoapps/courseware/tests/test_views.py | 8 ++++---- .../grades/tests/test_course_grade_factory.py | 18 ++++++++--------- lms/djangoapps/grades/tests/test_tasks.py | 20 +++++++++---------- .../schedules/tests/test_resolvers.py | 2 +- .../tests/views/test_course_home.py | 2 +- .../tests/views/test_course_updates.py | 2 +- requirements/edx/base.txt | 2 +- requirements/edx/development.txt | 2 +- requirements/edx/testing.txt | 2 +- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py index 8cfca804d33a..7bebde171781 100644 --- a/lms/djangoapps/ccx/tests/test_field_override_performance.py +++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py @@ -242,7 +242,7 @@ class TestFieldOverrideMongoPerformance(FieldOverridePerformanceTestCase): __test__ = True # TODO: decrease query count as part of REVO-28 - QUERY_COUNT = 33 + QUERY_COUNT = 34 TEST_DATA = { # (providers, course_width, enable_ccx, view_as_ccx): ( # # of sql queries to default, @@ -271,7 +271,7 @@ class TestFieldOverrideSplitPerformance(FieldOverridePerformanceTestCase): __test__ = True # TODO: decrease query count as part of REVO-28 - QUERY_COUNT = 33 + QUERY_COUNT = 34 TEST_DATA = { ('no_overrides', 1, True, False): (QUERY_COUNT, 3), diff --git a/lms/djangoapps/course_api/blocks/tests/test_api.py b/lms/djangoapps/course_api/blocks/tests/test_api.py index e7b3fbdd9a98..980b1f5a5bc2 100644 --- a/lms/djangoapps/course_api/blocks/tests/test_api.py +++ b/lms/djangoapps/course_api/blocks/tests/test_api.py @@ -220,7 +220,7 @@ def test_query_counts_cached(self, store_type, with_storage_backing): self._get_blocks( course, expected_mongo_queries=0, - expected_sql_queries=13 if with_storage_backing else 12, + expected_sql_queries=14 if with_storage_backing else 13, ) @ddt.data( @@ -237,9 +237,9 @@ def test_query_counts_uncached(self, store_type_tuple, with_storage_backing): clear_course_from_cache(course.id) if with_storage_backing: - num_sql_queries = 23 + num_sql_queries = 24 else: - num_sql_queries = 13 + num_sql_queries = 14 self._get_blocks( course, diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index 5f93037ada57..42810f26cc77 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -388,8 +388,8 @@ class IndexQueryTestCase(ModuleStoreTestCase): NUM_PROBLEMS = 20 @ddt.data( - (ModuleStoreEnum.Type.mongo, 10, 164), - (ModuleStoreEnum.Type.split, 4, 160), + (ModuleStoreEnum.Type.mongo, 10, 227), + (ModuleStoreEnum.Type.split, 4, 210), ) @ddt.unpack def test_index_query_counts(self, store_type, expected_mongo_query_count, expected_mysql_query_count): @@ -1597,8 +1597,8 @@ def test_progress_queries_paced_courses(self, self_paced, query_count): @patch.dict(settings.FEATURES, {'ASSUME_ZERO_GRADE_IF_ABSENT_FOR_ALL_TESTS': False}) @ddt.data( - (False, 63, 44), - (True, 55, 38) + (False, 63, 45), + (True, 55, 39) ) @ddt.unpack def test_progress_queries(self, enable_waffle, initial, subsequent): diff --git a/lms/djangoapps/grades/tests/test_course_grade_factory.py b/lms/djangoapps/grades/tests/test_course_grade_factory.py index 6bf4ac738056..99f851c32808 100644 --- a/lms/djangoapps/grades/tests/test_course_grade_factory.py +++ b/lms/djangoapps/grades/tests/test_course_grade_factory.py @@ -95,35 +95,35 @@ def _assert_section_order(course_grade): self.sequence2.display_name ] - with self.assertNumQueries(3), mock_get_score(1, 2): + with self.assertNumQueries(5), mock_get_score(1, 2): _assert_read(expected_pass=False, expected_percent=0) # start off with grade of 0 - num_queries = 42 + num_queries = 43 with self.assertNumQueries(num_queries), mock_get_score(1, 2): grade_factory.update(self.request.user, self.course, force_update_subsections=True) - with self.assertNumQueries(3): + with self.assertNumQueries(4): _assert_read(expected_pass=True, expected_percent=0.5) # updated to grade of .5 - num_queries = 6 + num_queries = 7 with self.assertNumQueries(num_queries), mock_get_score(1, 4): grade_factory.update(self.request.user, self.course, force_update_subsections=False) - with self.assertNumQueries(3): + with self.assertNumQueries(4): _assert_read(expected_pass=True, expected_percent=0.5) # NOT updated to grade of .25 - num_queries = 23 + num_queries = 24 with self.assertNumQueries(num_queries), mock_get_score(2, 2): grade_factory.update(self.request.user, self.course, force_update_subsections=True) - with self.assertNumQueries(3): + with self.assertNumQueries(4): _assert_read(expected_pass=True, expected_percent=1.0) # updated to grade of 1.0 - num_queries = 29 + num_queries = 30 with self.assertNumQueries(num_queries), mock_get_score(0, 0): # the subsection now is worth zero grade_factory.update(self.request.user, self.course, force_update_subsections=True) - with self.assertNumQueries(3): + with self.assertNumQueries(4): _assert_read(expected_pass=False, expected_percent=0.0) # updated to grade of 0.0 @patch.dict(settings.FEATURES, {'ASSUME_ZERO_GRADE_IF_ABSENT_FOR_ALL_TESTS': False}) diff --git a/lms/djangoapps/grades/tests/test_tasks.py b/lms/djangoapps/grades/tests/test_tasks.py index c68b17f37bc5..4b64f4d1fad4 100644 --- a/lms/djangoapps/grades/tests/test_tasks.py +++ b/lms/djangoapps/grades/tests/test_tasks.py @@ -162,10 +162,10 @@ def test_block_structure_created_only_once(self): assert mock_block_structure_create.call_count == 1 @ddt.data( - (ModuleStoreEnum.Type.mongo, 1, 39, True), - (ModuleStoreEnum.Type.mongo, 1, 39, False), - (ModuleStoreEnum.Type.split, 3, 39, True), - (ModuleStoreEnum.Type.split, 3, 39, False), + (ModuleStoreEnum.Type.mongo, 1, 40, True), + (ModuleStoreEnum.Type.mongo, 1, 40, False), + (ModuleStoreEnum.Type.split, 3, 40, True), + (ModuleStoreEnum.Type.split, 3, 40, False), ) @ddt.unpack def test_query_counts(self, default_store, num_mongo_calls, num_sql_calls, create_multiple_subsections): @@ -177,8 +177,8 @@ def test_query_counts(self, default_store, num_mongo_calls, num_sql_calls, creat self._apply_recalculate_subsection_grade() @ddt.data( - (ModuleStoreEnum.Type.mongo, 1, 39), - (ModuleStoreEnum.Type.split, 3, 39), + (ModuleStoreEnum.Type.mongo, 1, 40), + (ModuleStoreEnum.Type.split, 3, 40), ) @ddt.unpack def test_query_counts_dont_change_with_more_content(self, default_store, num_mongo_calls, num_sql_calls): @@ -223,8 +223,8 @@ def test_other_inaccessible_subsection(self, mock_subsection_signal): ) @ddt.data( - (ModuleStoreEnum.Type.mongo, 1, 22), - (ModuleStoreEnum.Type.split, 3, 22), + (ModuleStoreEnum.Type.mongo, 1, 23), + (ModuleStoreEnum.Type.split, 3, 23), ) @ddt.unpack def test_persistent_grades_not_enabled_on_course(self, default_store, num_mongo_queries, num_sql_queries): @@ -238,8 +238,8 @@ def test_persistent_grades_not_enabled_on_course(self, default_store, num_mongo_ assert len(PersistentSubsectionGrade.bulk_read_grades(self.user.id, self.course.id)) == 0 @ddt.data( - (ModuleStoreEnum.Type.mongo, 1, 40), - (ModuleStoreEnum.Type.split, 3, 40), + (ModuleStoreEnum.Type.mongo, 1, 41), + (ModuleStoreEnum.Type.split, 3, 41), ) @ddt.unpack def test_persistent_grades_enabled_on_course(self, default_store, num_mongo_queries, num_sql_queries): diff --git a/openedx/core/djangoapps/schedules/tests/test_resolvers.py b/openedx/core/djangoapps/schedules/tests/test_resolvers.py index 4e8158c6d7d5..daa776bbe2d0 100644 --- a/openedx/core/djangoapps/schedules/tests/test_resolvers.py +++ b/openedx/core/djangoapps/schedules/tests/test_resolvers.py @@ -247,7 +247,7 @@ def create_resolver(self, user_start_date_offset=8): def test_schedule_context(self): resolver = self.create_resolver() # using this to make sure the select_related stays intact - with self.assertNumQueries(26): + with self.assertNumQueries(36): sc = resolver.get_schedules() schedules = list(sc) diff --git a/openedx/features/course_experience/tests/views/test_course_home.py b/openedx/features/course_experience/tests/views/test_course_home.py index 36dd785966e2..90eefa9ee9f0 100644 --- a/openedx/features/course_experience/tests/views/test_course_home.py +++ b/openedx/features/course_experience/tests/views/test_course_home.py @@ -205,7 +205,7 @@ def test_queries(self): # Fetch the view and verify the query counts # TODO: decrease query count as part of REVO-28 - with self.assertNumQueries(72, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): + with self.assertNumQueries(73, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): with check_mongo_calls(4): url = course_home_url(self.course) self.client.get(url) diff --git a/openedx/features/course_experience/tests/views/test_course_updates.py b/openedx/features/course_experience/tests/views/test_course_updates.py index a3abea4b3db8..6761a1aece73 100644 --- a/openedx/features/course_experience/tests/views/test_course_updates.py +++ b/openedx/features/course_experience/tests/views/test_course_updates.py @@ -49,7 +49,7 @@ def test_queries(self): # Fetch the view and verify that the query counts haven't changed # TODO: decrease query count as part of REVO-28 - with self.assertNumQueries(50, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): + with self.assertNumQueries(53, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST): with check_mongo_calls(4): url = course_updates_url(self.course) self.client.get(url) diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index b36f6a869176..94caaad71427 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -493,7 +493,7 @@ edx-toggles==4.2.0 # ora2 edx-user-state-client==1.3.2 # via -r requirements/edx/base.in -edx-when==2.2.1 +edx-when==2.2.2 # via # -r requirements/edx/base.in # edx-proctoring diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 5cf8095d4392..a6cad7be9776 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -608,7 +608,7 @@ edx-toggles==4.2.0 # ora2 edx-user-state-client==1.3.2 # via -r requirements/edx/testing.txt -edx-when==2.2.1 +edx-when==2.2.2 # via # -r requirements/edx/testing.txt # edx-proctoring diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 1a6863415dd4..36eb14b93a8f 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -589,7 +589,7 @@ edx-toggles==4.2.0 # ora2 edx-user-state-client==1.3.2 # via -r requirements/edx/base.txt -edx-when==2.2.1 +edx-when==2.2.2 # via # -r requirements/edx/base.txt # edx-proctoring