Merge pull request #18023 from edx/estute/TE-2427-reshard-lms4

Reshard python unittests
This commit is contained in:
Stu Young
2018-05-03 11:53:32 -04:00
committed by GitHub
244 changed files with 862 additions and 129 deletions

View File

@@ -37,7 +37,7 @@ class BookmarkApiEventTestMixin(object):
self.assertFalse(mock_tracker.called) # pylint: disable=maybe-no-member
@attr(shard=2)
@attr(shard=9)
@ddt.ddt
@skip_unless_lms
@pytest.mark.django111_expected_failure

View File

@@ -225,7 +225,7 @@ class BookmarksTestsBase(ModuleStoreTestCase):
self.assertEqual(bookmark_data['path'], bookmark.path)
@attr(shard=2)
@attr(shard=9)
@ddt.ddt
@skip_unless_lms
class BookmarkModelTests(BookmarksTestsBase):
@@ -417,7 +417,7 @@ class BookmarkModelTests(BookmarksTestsBase):
self.assertEqual(bookmark.path, [])
@attr(shard=2)
@attr(shard=9)
@ddt.ddt
class XBlockCacheModelTest(ModuleStoreTestCase):
"""

View File

@@ -11,7 +11,7 @@ from ..services import BookmarksService
from .test_models import BookmarksTestsBase
@attr(shard=2)
@attr(shard=9)
@skip_unless_lms
@pytest.mark.django111_expected_failure
class BookmarksServiceTests(BookmarksTestsBase):

View File

@@ -12,7 +12,7 @@ from ..tasks import _calculate_course_xblocks_data, _update_xblocks_cache
from .test_models import BookmarksTestsBase
@attr(shard=2)
@attr(shard=9)
@ddt.ddt
@pytest.mark.django111_expected_failure
class XBlockCacheTaskTests(BookmarksTestsBase):

View File

@@ -63,7 +63,7 @@ class BookmarksViewsTestsBase(BookmarksTestsBase, BookmarkApiEventTestMixin):
return response
@attr(shard=2)
@attr(shard=9)
@ddt.ddt
@skip_unless_lms
@pytest.mark.django111_expected_failure
@@ -369,7 +369,7 @@ class BookmarksListViewTests(BookmarksViewsTestsBase):
)
@attr(shard=2)
@attr(shard=9)
@ddt.ddt
@skip_unless_lms
@pytest.mark.django111_expected_failure

View File

@@ -32,6 +32,7 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
"Can't test schedules if the app isn't installed",
)
class TestSendCourseUpdate(ScheduleUpsellTestMixin, ScheduleSendEmailTestMixin, ModuleStoreTestCase):
shard = 6
__test__ = True
# pylint: disable=protected-access

View File

@@ -16,6 +16,8 @@ from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_un
@skipUnless('openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS,
"Can't test schedules if the app isn't installed")
class TestSendEmailBaseCommand(CacheIsolationTestCase):
shard = 6
def setUp(self):
self.command = SendEmailBaseCommand()
self.site = SiteFactory()

View File

@@ -24,6 +24,7 @@ from openedx.core.djangolib.testing.utils import skip_unless_lms, CacheIsolation
"Can't test schedules if the app isn't installed",
)
class TestSendRecurringNudge(ScheduleUpsellTestMixin, ScheduleSendEmailTestMixin, CacheIsolationTestCase):
shard = 6
__test__ = True
# pylint: disable=protected-access

View File

@@ -31,6 +31,7 @@ LOG = logging.getLogger(__name__)
@skipUnless('openedx.core.djangoapps.schedules.apps.SchedulesConfig' in settings.INSTALLED_APPS,
"Can't test schedules if the app isn't installed")
class TestUpgradeReminder(ScheduleSendEmailTestMixin, CacheIsolationTestCase):
shard = 6
__test__ = True
resolver = resolvers.UpgradeReminderResolver

View File

@@ -134,7 +134,7 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
self.assert_request_status_code(200, self.course_url)
@attr(shard=1)
@attr(shard=6)
class TestHinterFunctions(TestCrowdsourceHinter):
"""
Check that the essential functions of the hinter work as expected.

View File

@@ -196,7 +196,7 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
self.assert_request_status_code(200, self.course_url)
@attr(shard=1)
@attr(shard=6)
class TestRecommenderCreateFromEmpty(TestRecommender):
"""
Check whether we can add resources to an empty database correctly
@@ -223,7 +223,7 @@ class TestRecommenderCreateFromEmpty(TestRecommender):
self.assert_request_status_code(200, self.course_url)
@attr(shard=1)
@attr(shard=6)
class TestRecommenderResourceBase(TestRecommender):
"""Base helper class for tests with resources."""
def setUp(self):
@@ -256,7 +256,7 @@ class TestRecommenderResourceBase(TestRecommender):
return resource
@attr(shard=1)
@attr(shard=6)
class TestRecommenderWithResources(TestRecommenderResourceBase):
"""
Check whether we can add/edit/flag/export resources correctly
@@ -421,7 +421,7 @@ class TestRecommenderWithResources(TestRecommenderResourceBase):
self.assert_request_status_code(200, self.course_url)
@attr(shard=1)
@attr(shard=6)
@ddt
class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
"""
@@ -535,7 +535,7 @@ class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
self.check_event_response_by_key('handle_vote', resource, 'newVotes', test_case['new_votes'])
@attr(shard=1)
@attr(shard=6)
@ddt
class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
"""
@@ -630,7 +630,7 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
self.check_event_response_by_http_status(test_case['handler'], resource, test_case['status'])
@attr(shard=1)
@attr(shard=6)
@ddt
class TestRecommenderFileUploading(TestRecommender):
"""

View File

@@ -191,7 +191,7 @@ class TestReviewXBlock(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
self.enroll(course, verify=True)
@attr(shard=1)
@attr(shard=6)
@ddt.ddt
class TestReviewFunctions(TestReviewXBlock):
"""