From e6493d609c47b0af6e71705c15cc98ce40923ce1 Mon Sep 17 00:00:00 2001
From: Ben Patterson <bpatterson@edx.org>
Date: Wed, 27 Apr 2016 12:23:03 -0400
Subject: [PATCH] Additional shard balancing changes for unit tests.

---
 lms/djangoapps/bulk_email/tests/test_tasks.py               | 2 +-
 lms/djangoapps/ccx/tests/test_field_override_performance.py | 2 +-
 lms/djangoapps/course_api/tests/test_serializers.py         | 1 -
 lms/djangoapps/courseware/tests/test_entrance_exam.py       | 2 +-
 lms/djangoapps/courseware/tests/test_group_access.py        | 2 +-
 lms/djangoapps/courseware/tests/test_submitting_problems.py | 2 +-
 lms/djangoapps/courseware/tests/test_views.py               | 2 +-
 lms/djangoapps/shoppingcart/tests/test_models.py            | 5 +++++
 lms/djangoapps/shoppingcart/tests/test_views.py             | 4 ++++
 9 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/lms/djangoapps/bulk_email/tests/test_tasks.py b/lms/djangoapps/bulk_email/tests/test_tasks.py
index 583f649..d0f1bc1 100644
--- a/lms/djangoapps/bulk_email/tests/test_tasks.py
+++ b/lms/djangoapps/bulk_email/tests/test_tasks.py
@@ -75,7 +75,7 @@ def my_update_subtask_status(entry_id, current_task_id, new_subtask_status):
         update_subtask_status(entry_id, current_task_id, new_subtask_status)
 
 
-@attr('shard_1')
+@attr('shard_3')
 @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
 class TestBulkEmailInstructorTask(InstructorTaskCourseTestCase):
     """Tests instructor task that send bulk email."""
diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py
index f8c58ff..32fcb6d 100644
--- a/lms/djangoapps/ccx/tests/test_field_override_performance.py
+++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py
@@ -30,7 +30,7 @@ from ccx_keys.locator import CCXLocator
 from lms.djangoapps.ccx.tests.factories import CcxFactory
 
 
-@attr('shard_1')
+@attr('shard_3')
 @mock.patch.dict(
     'django.conf.settings.FEATURES',
     {
diff --git a/lms/djangoapps/course_api/tests/test_serializers.py b/lms/djangoapps/course_api/tests/test_serializers.py
index 9dc55de..5b14ac2 100644
--- a/lms/djangoapps/course_api/tests/test_serializers.py
+++ b/lms/djangoapps/course_api/tests/test_serializers.py
@@ -125,7 +125,6 @@ class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase):
         self.assertEqual(result['pacing'], expected_pacing)
 
 
-@attr('shard_3')
 class TestCourseDetailSerializer(TestCourseSerializer):  # pylint: disable=test-inherits-tests
     """
     Test CourseDetailSerializer by rerunning all the tests
diff --git a/lms/djangoapps/courseware/tests/test_entrance_exam.py b/lms/djangoapps/courseware/tests/test_entrance_exam.py
index 53c8386..8e33be6 100644
--- a/lms/djangoapps/courseware/tests/test_entrance_exam.py
+++ b/lms/djangoapps/courseware/tests/test_entrance_exam.py
@@ -38,7 +38,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
 from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
 
 
-@attr('shard_1')
+@attr('shard_2')
 @patch.dict('django.conf.settings.FEATURES', {'ENTRANCE_EXAMS': True, 'MILESTONES_APP': True})
 class EntranceExamTestCases(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTestCaseMixin):
     """
diff --git a/lms/djangoapps/courseware/tests/test_group_access.py b/lms/djangoapps/courseware/tests/test_group_access.py
index 1a6fab3..5a04076 100644
--- a/lms/djangoapps/courseware/tests/test_group_access.py
+++ b/lms/djangoapps/courseware/tests/test_group_access.py
@@ -51,7 +51,7 @@ def resolve_attrs(test_method):
     return _wrapper
 
 
-@attr('shard_1')
+@attr('shard_2')
 @ddt.ddt
 class GroupAccessTestCase(ModuleStoreTestCase):
     """
diff --git a/lms/djangoapps/courseware/tests/test_submitting_problems.py b/lms/djangoapps/courseware/tests/test_submitting_problems.py
index 8a7761a..0892ef6 100644
--- a/lms/djangoapps/courseware/tests/test_submitting_problems.py
+++ b/lms/djangoapps/courseware/tests/test_submitting_problems.py
@@ -316,7 +316,7 @@ class TestSubmittingProblems(ModuleStoreTestCase, LoginEnrollmentTestCase, Probl
         return [s.earned for s in hw_section['scores']]
 
 
-@attr('shard_1')
+@attr('shard_3')
 class TestCourseGrader(TestSubmittingProblems):
     """
     Suite of tests for the course grader.
diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py
index 426ed78..3d0004c 100644
--- a/lms/djangoapps/courseware/tests/test_views.py
+++ b/lms/djangoapps/courseware/tests/test_views.py
@@ -184,7 +184,7 @@ class TestJumpTo(ModuleStoreTestCase):
         self.assertEqual(response.status_code, 404)
 
 
-@attr('shard_1')
+@attr('shard_2')
 @ddt.ddt
 class ViewsTestCase(ModuleStoreTestCase):
     """
diff --git a/lms/djangoapps/shoppingcart/tests/test_models.py b/lms/djangoapps/shoppingcart/tests/test_models.py
index 9236044..9091a48 100644
--- a/lms/djangoapps/shoppingcart/tests/test_models.py
+++ b/lms/djangoapps/shoppingcart/tests/test_models.py
@@ -50,6 +50,11 @@ from opaque_keys.edx.locator import CourseLocator
 @attr('shard_3')
 @ddt.ddt
 class OrderTest(ModuleStoreTestCase):
+    """
+    Test shopping cart orders (e.g., cart contains various items,
+    order is taken through various pieces of cart state, etc.)
+    """
+
     def setUp(self):
         super(OrderTest, self).setUp()
 
diff --git a/lms/djangoapps/shoppingcart/tests/test_views.py b/lms/djangoapps/shoppingcart/tests/test_views.py
index f250a09..60a12ee 100644
--- a/lms/djangoapps/shoppingcart/tests/test_views.py
+++ b/lms/djangoapps/shoppingcart/tests/test_views.py
@@ -69,6 +69,10 @@ postpay_mock = Mock()
 @patch.dict('django.conf.settings.FEATURES', {'ENABLE_PAID_COURSE_REGISTRATION': True})
 @ddt.ddt
 class ShoppingCartViewsTests(SharedModuleStoreTestCase, XssTestMixin):
+    """
+    Test shopping cart view under various states
+    """
+
     @classmethod
     def setUpClass(cls):
         super(ShoppingCartViewsTests, cls).setUpClass()
--
libgit2 0.26.0