diff --git a/common/djangoapps/course_modes/tests/test_views.py b/common/djangoapps/course_modes/tests/test_views.py index 67a84502f0..be2e7c2382 100644 --- a/common/djangoapps/course_modes/tests/test_views.py +++ b/common/djangoapps/course_modes/tests/test_views.py @@ -27,7 +27,7 @@ from util.testing import UrlResetMixin from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme -@attr('shard_3') +@attr(shard=3) @ddt.ddt @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') class CourseModeViewTest(UrlResetMixin, ModuleStoreTestCase): diff --git a/common/djangoapps/embargo/tests/test_api.py b/common/djangoapps/embargo/tests/test_api.py index fc4a5c77b4..108b3b95bf 100644 --- a/common/djangoapps/embargo/tests/test_api.py +++ b/common/djangoapps/embargo/tests/test_api.py @@ -38,7 +38,7 @@ from mock import patch MODULESTORE_CONFIG = mixed_store_config(settings.COMMON_TEST_DATA_ROOT, {}) -@attr('shard_3') +@attr(shard=3) @ddt.ddt @override_settings(MODULESTORE=MODULESTORE_CONFIG) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') diff --git a/common/djangoapps/embargo/tests/test_middleware.py b/common/djangoapps/embargo/tests/test_middleware.py index 953989ff5b..55cac586df 100644 --- a/common/djangoapps/embargo/tests/test_middleware.py +++ b/common/djangoapps/embargo/tests/test_middleware.py @@ -21,7 +21,7 @@ from embargo.models import RestrictedCourse, IPFilter from embargo.test_utils import restrict_course -@attr('shard_3') +@attr(shard=3) @ddt.ddt @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') class EmbargoMiddlewareAccessTests(UrlResetMixin, ModuleStoreTestCase): diff --git a/common/djangoapps/enrollment/tests/test_views.py b/common/djangoapps/enrollment/tests/test_views.py index 9a8add5fbf..7409923bd4 100644 --- a/common/djangoapps/enrollment/tests/test_views.py +++ b/common/djangoapps/enrollment/tests/test_views.py @@ -126,7 +126,7 @@ class EnrollmentTestMixin(object): self.assertEqual(actual_mode, expected_mode) -@attr('shard_3') +@attr(shard=3) @override_settings(EDX_API_KEY="i am a key") @ddt.ddt @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') diff --git a/common/djangoapps/external_auth/tests/test_shib.py b/common/djangoapps/external_auth/tests/test_shib.py index 028766a106..62615bb88c 100644 --- a/common/djangoapps/external_auth/tests/test_shib.py +++ b/common/djangoapps/external_auth/tests/test_shib.py @@ -73,7 +73,7 @@ def gen_all_identities(): yield _build_identity_dict(mail, display_name, given_name, surname) -@attr('shard_3') +@attr(shard=3) @ddt @override_settings(SESSION_ENGINE='django.contrib.sessions.backends.cache') class ShibSPTest(CacheIsolationTestCase): diff --git a/common/djangoapps/student/tests/test_enrollment.py b/common/djangoapps/student/tests/test_enrollment.py index acabe344c3..ce96ad3532 100644 --- a/common/djangoapps/student/tests/test_enrollment.py +++ b/common/djangoapps/student/tests/test_enrollment.py @@ -21,7 +21,7 @@ from student.roles import ( ) -@attr('shard_3') +@attr(shard=3) @ddt.ddt @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') class EnrollmentTest(UrlResetMixin, SharedModuleStoreTestCase): diff --git a/common/djangoapps/student/tests/test_recent_enrollments.py b/common/djangoapps/student/tests/test_recent_enrollments.py index 4aa01451ab..8dfd143cfe 100644 --- a/common/djangoapps/student/tests/test_recent_enrollments.py +++ b/common/djangoapps/student/tests/test_recent_enrollments.py @@ -20,7 +20,7 @@ from student.views import get_course_enrollments, _get_recently_enrolled_courses from common.test.utils import XssTestMixin -@attr('shard_3') +@attr(shard=3) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @ddt.ddt class TestRecentEnrollments(ModuleStoreTestCase, XssTestMixin): diff --git a/common/djangoapps/student/tests/test_verification_status.py b/common/djangoapps/student/tests/test_verification_status.py index 447fccdd96..342ad05b07 100644 --- a/common/djangoapps/student/tests/test_verification_status.py +++ b/common/djangoapps/student/tests/test_verification_status.py @@ -25,7 +25,7 @@ from lms.djangoapps.verify_student.models import VerificationDeadline, SoftwareS from util.testing import UrlResetMixin -@attr('shard_3') +@attr(shard=3) @patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True}) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @ddt.ddt diff --git a/common/djangoapps/student/tests/tests.py b/common/djangoapps/student/tests/tests.py index b2569025f5..4e0f996ceb 100644 --- a/common/djangoapps/student/tests/tests.py +++ b/common/djangoapps/student/tests/tests.py @@ -890,7 +890,7 @@ class AnonymousLookupTable(ModuleStoreTestCase): # TODO: Clean up these tests so that they use program factories and don't mention XSeries! -@attr('shard_3') +@attr(shard=3) @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @ddt.ddt class DashboardTestXSeriesPrograms(ModuleStoreTestCase, ProgramsApiConfigMixin): diff --git a/common/djangoapps/track/views/tests/test_segmentio.py b/common/djangoapps/track/views/tests/test_segmentio.py index 004443eee9..8b0bf980f3 100644 --- a/common/djangoapps/track/views/tests/test_segmentio.py +++ b/common/djangoapps/track/views/tests/test_segmentio.py @@ -37,7 +37,7 @@ def expect_failure_with_message(message): return test_decorator -@attr('shard_3') +@attr(shard=3) @ddt @override_settings( TRACKING_SEGMENTIO_WEBHOOK_SECRET=SECRET, diff --git a/common/test/acceptance/tests/discussion/test_cohort_management.py b/common/test/acceptance/tests/discussion/test_cohort_management.py index b0878d03a7..9b4ba2c2c4 100644 --- a/common/test/acceptance/tests/discussion/test_cohort_management.py +++ b/common/test/acceptance/tests/discussion/test_cohort_management.py @@ -21,7 +21,7 @@ import unicodecsv import uuid -@attr('shard_8') +@attr(shard=8) class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin): """ Tests for cohort management on the LMS Instructor Dashboard @@ -690,7 +690,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin self.assertEquals(expected_message, messages[0]) -@attr('shard_6') +@attr(shard=6) class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin): """ Tests for cohorting the inline and course-wide discussion topics. @@ -981,7 +981,7 @@ class CohortDiscussionTopicsTest(UniqueCourseTest, CohortTestMixin): self.verify_discussion_topics_after_reload(self.inline_key, cohorted_topics_after) -@attr('shard_6') +@attr(shard=6) class CohortContentGroupAssociationTest(UniqueCourseTest, CohortTestMixin): """ Tests for linking between content groups and cohort in the instructor dashboard. diff --git a/common/test/acceptance/tests/discussion/test_cohorts.py b/common/test/acceptance/tests/discussion/test_cohorts.py index b578101408..dbdbac8237 100644 --- a/common/test/acceptance/tests/discussion/test_cohorts.py +++ b/common/test/acceptance/tests/discussion/test_cohorts.py @@ -79,7 +79,7 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase): self.thread_page.wait_for_page() -@attr('shard_5') +@attr(shard=5) class CohortedDiscussionTabSingleThreadTest(DiscussionTabSingleThreadTest, CohortedDiscussionTestMixin): """ Tests for the discussion page displaying a single cohorted thread. @@ -88,7 +88,7 @@ class CohortedDiscussionTabSingleThreadTest(DiscussionTabSingleThreadTest, Cohor pass -@attr('shard_5') +@attr(shard=5) class NonCohortedDiscussionTabSingleThreadTest(DiscussionTabSingleThreadTest, NonCohortedDiscussionTestMixin): """ Tests for the discussion page displaying a single non-cohorted thread. @@ -137,7 +137,7 @@ class InlineDiscussionTest(UniqueCourseTest): self.show_thread(thread_id) -@attr('shard_5') +@attr(shard=5) class CohortedInlineDiscussionTest(InlineDiscussionTest, CohortedDiscussionTestMixin): """ Tests for cohorted inline discussions. @@ -146,7 +146,7 @@ class CohortedInlineDiscussionTest(InlineDiscussionTest, CohortedDiscussionTestM pass -@attr('shard_5') +@attr(shard=5) class NonCohortedInlineDiscussionTest(InlineDiscussionTest, NonCohortedDiscussionTestMixin): """ Tests for non-cohorted inline discussions. diff --git a/common/test/acceptance/tests/discussion/test_discussion.py b/common/test/acceptance/tests/discussion/test_discussion.py index 28f4f2d0f1..84dc9111d7 100644 --- a/common/test/acceptance/tests/discussion/test_discussion.py +++ b/common/test/acceptance/tests/discussion/test_discussion.py @@ -178,7 +178,7 @@ class DiscussionResponsePaginationTestMixin(BaseDiscussionMixin): self.assertFalse(self.thread_page.has_add_response_button()) -@attr('shard_2') +@attr(shard=2) class DiscussionHomePageTest(UniqueCourseTest): """ Tests for the discussion home page. @@ -217,7 +217,7 @@ class DiscussionHomePageTest(UniqueCourseTest): self.page.a11y_audit.check_for_accessibility_errors() -@attr('shard_2') +@attr(shard=2) class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePaginationTestMixin): """ Tests for the discussion page displaying a single thread @@ -290,7 +290,7 @@ class DiscussionTabSingleThreadTest(BaseDiscussionTestCase, DiscussionResponsePa self.assertFalse(self.thread_page.is_show_comments_visible(response_id)) -@attr('shard_2') +@attr(shard=2) class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase): """ Tests for the discussion page with multiple threads @@ -371,7 +371,7 @@ class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase): self.thread_page_2.a11y_audit.check_for_accessibility_errors() -@attr('shard_2') +@attr(shard=2) class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase): """ Tests for checking the display of attributes on open and closed threads @@ -446,7 +446,7 @@ class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase): page.a11y_audit.check_for_accessibility_errors() -@attr('shard_2') +@attr(shard=2) class DiscussionCommentDeletionTest(BaseDiscussionTestCase): """ Tests for deleting comments displayed beneath responses in the single thread view. @@ -486,7 +486,7 @@ class DiscussionCommentDeletionTest(BaseDiscussionTestCase): page.delete_comment("comment_other_author") -@attr('shard_2') +@attr(shard=2) class DiscussionResponseEditTest(BaseDiscussionTestCase): """ Tests for editing responses displayed beneath thread in the single thread view. @@ -737,7 +737,7 @@ class DiscussionResponseEditTest(BaseDiscussionTestCase): page.a11y_audit.check_for_accessibility_errors() -@attr('shard_2') +@attr(shard=2) class DiscussionCommentEditTest(BaseDiscussionTestCase): """ Tests for editing comments displayed beneath responses in the single thread view. @@ -837,7 +837,7 @@ class DiscussionCommentEditTest(BaseDiscussionTestCase): page.a11y_audit.check_for_accessibility_errors() -@attr('shard_2') +@attr(shard=2) class InlineDiscussionTest(UniqueCourseTest, DiscussionResponsePaginationTestMixin): """ Tests for inline discussions @@ -996,7 +996,7 @@ class InlineDiscussionTest(UniqueCourseTest, DiscussionResponsePaginationTestMix self.assertFalse(self.additional_discussion_page._is_element_visible(".new-post-article")) -@attr('shard_2') +@attr(shard=2) class DiscussionUserProfileTest(UniqueCourseTest): """ Tests for user profile page in discussion tab. @@ -1125,7 +1125,7 @@ class DiscussionUserProfileTest(UniqueCourseTest): self.assertTrue(learner_profile_page.field_is_visible('username')) -@attr('shard_2') +@attr(shard=2) class DiscussionSearchAlertTest(UniqueCourseTest): """ Tests for spawning and dismissing alerts related to user search actions and their results. @@ -1211,7 +1211,7 @@ class DiscussionSearchAlertTest(UniqueCourseTest): self.page.a11y_audit.check_for_accessibility_errors() -@attr('shard_2') +@attr(shard=2) class DiscussionSortPreferenceTest(UniqueCourseTest): """ Tests for the discussion page displaying a single thread. diff --git a/common/test/acceptance/tests/lms/test_account_settings.py b/common/test/acceptance/tests/lms/test_account_settings.py index 9ffadd658c..d83ae64663 100644 --- a/common/test/acceptance/tests/lms/test_account_settings.py +++ b/common/test/acceptance/tests/lms/test_account_settings.py @@ -90,7 +90,7 @@ class AccountSettingsTestMixin(EventsTestMixin, WebAppTest): self.assert_no_matching_events_were_emitted({'event_type': self.USER_SETTINGS_CHANGED_EVENT_NAME}) -@attr('shard_8') +@attr(shard=8) class DashboardMenuTest(AccountSettingsTestMixin, WebAppTest): """ Tests that the dashboard menu works correctly with the account settings page. @@ -113,7 +113,7 @@ class DashboardMenuTest(AccountSettingsTestMixin, WebAppTest): dashboard_page.click_account_settings_link() -@attr('shard_8') +@attr(shard=8) class AccountSettingsPageTest(AccountSettingsTestMixin, WebAppTest): """ Tests that verify behaviour of the Account Settings page. diff --git a/common/test/acceptance/tests/lms/test_bookmarks.py b/common/test/acceptance/tests/lms/test_bookmarks.py index ef36dddd97..b773fff3d9 100644 --- a/common/test/acceptance/tests/lms/test_bookmarks.py +++ b/common/test/acceptance/tests/lms/test_bookmarks.py @@ -60,7 +60,7 @@ class BookmarksTestMixin(EventsTestMixin, UniqueCourseTest): self.assert_events_match(event_data, actual_events) -@attr('shard_8') +@attr(shard=8) class BookmarksTest(BookmarksTestMixin): """ Tests to verify bookmarks functionality. diff --git a/common/test/acceptance/tests/lms/test_ccx.py b/common/test/acceptance/tests/lms/test_ccx.py index 7cc78cf3ec..1a284f36cf 100644 --- a/common/test/acceptance/tests/lms/test_ccx.py +++ b/common/test/acceptance/tests/lms/test_ccx.py @@ -10,7 +10,7 @@ from common.test.acceptance.pages.lms.auto_auth import AutoAuthPage from common.test.acceptance.pages.lms.ccx_dashboard_page import CoachDashboardPage -@attr('shard_7') +@attr(shard=7) class CreateCCXCoachTest(EventsTestMixin, UniqueCourseTest): """ Test ccx end to end process. diff --git a/common/test/acceptance/tests/lms/test_certificate_web_view.py b/common/test/acceptance/tests/lms/test_certificate_web_view.py index deb07e623f..1b928dd47e 100644 --- a/common/test/acceptance/tests/lms/test_certificate_web_view.py +++ b/common/test/acceptance/tests/lms/test_certificate_web_view.py @@ -13,7 +13,7 @@ from common.test.acceptance.pages.lms.course_nav import CourseNavPage from common.test.acceptance.pages.lms.progress import ProgressPage -@attr('shard_5') +@attr(shard=5) class CertificateWebViewTest(EventsTestMixin, UniqueCourseTest): """ Tests for verifying certificate web view features @@ -94,7 +94,7 @@ class CertificateWebViewTest(EventsTestMixin, UniqueCourseTest): self.assert_events_match(expected_events, actual_events) -@attr('shard_5') +@attr(shard=5) class CertificateProgressPageTest(UniqueCourseTest): """ Tests for verifying Certificate info on Progress tab of course page. diff --git a/common/test/acceptance/tests/lms/test_learner_profile.py b/common/test/acceptance/tests/lms/test_learner_profile.py index 7b18ced3c4..a684b9d57e 100644 --- a/common/test/acceptance/tests/lms/test_learner_profile.py +++ b/common/test/acceptance/tests/lms/test_learner_profile.py @@ -180,7 +180,7 @@ class LearnerProfileTestMixin(EventsTestMixin): return username, user_id -@attr('shard_4') +@attr(shard=4) class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest): """ Tests that verify a student's own profile page. @@ -695,7 +695,7 @@ class OwnLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest): profile_page.upload_file(filename='image.jpg', wait_for_upload_button=False) -@attr('shard_4') +@attr(shard=4) class DifferentUserLearnerProfilePageTest(LearnerProfileTestMixin, WebAppTest): """ Tests that verify viewing the profile page of a different user. diff --git a/common/test/acceptance/tests/lms/test_library.py b/common/test/acceptance/tests/lms/test_library.py index 7904a21fca..a42bf211c2 100644 --- a/common/test/acceptance/tests/lms/test_library.py +++ b/common/test/acceptance/tests/lms/test_library.py @@ -21,7 +21,7 @@ SUBSECTION_NAME = 'Test Subsection' UNIT_NAME = 'Test Unit' -@attr('shard_7') +@attr(shard=7) class LibraryContentTestBase(UniqueCourseTest): """ Base class for library content block tests """ USERNAME = "STUDENT_TESTER" @@ -144,7 +144,7 @@ class LibraryContentTestBase(UniqueCourseTest): @ddt.ddt -@attr('shard_7') +@attr(shard=7) class LibraryContentTest(LibraryContentTestBase): """ Test courseware. @@ -197,7 +197,7 @@ class LibraryContentTest(LibraryContentTestBase): @ddt.ddt -@attr('shard_7') +@attr(shard=7) class StudioLibraryContainerCapaFilterTest(LibraryContentTestBase, TestWithSearchIndexMixin): """ Test Library Content block in LMS diff --git a/common/test/acceptance/tests/lms/test_lms.py b/common/test/acceptance/tests/lms/test_lms.py index 28e0cc5347..53fe85aa97 100644 --- a/common/test/acceptance/tests/lms/test_lms.py +++ b/common/test/acceptance/tests/lms/test_lms.py @@ -42,7 +42,7 @@ from common.test.acceptance.pages.lms.course_wiki import CourseWikiPage, CourseW from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc, CourseUpdateDesc -@attr('shard_8') +@attr(shard=8) class ForgotPasswordPageTest(UniqueCourseTest): """ Test that forgot password forms is rendered if url contains 'forgot-password-modal' @@ -84,7 +84,7 @@ class ForgotPasswordPageTest(UniqueCourseTest): self.assertIn("Password Reset Email Sent", self.reset_password_page.get_success_message()) -@attr('shard_8') +@attr(shard=8) class LoginFromCombinedPageTest(UniqueCourseTest): """Test that we can log in using the combined login/registration page. @@ -275,7 +275,7 @@ class LoginFromCombinedPageTest(UniqueCourseTest): return (email, password) -@attr('shard_8') +@attr(shard=8) class RegisterFromCombinedPageTest(UniqueCourseTest): """Test that we can register a new user from the combined login/registration page. """ @@ -398,7 +398,7 @@ class RegisterFromCombinedPageTest(UniqueCourseTest): account_settings.wait_for_message(field_id, "Successfully unlinked") -@attr('shard_8') +@attr(shard=8) class PayAndVerifyTest(EventsTestMixin, UniqueCourseTest): """Test that we can proceed through the payment and verification flow.""" def setUp(self): @@ -537,7 +537,7 @@ class PayAndVerifyTest(EventsTestMixin, UniqueCourseTest): self.assertEqual(enrollment_mode, 'verified') -@attr('shard_1') +@attr(shard=1) class CourseWikiTest(UniqueCourseTest): """ Tests that verify the course wiki. @@ -591,7 +591,7 @@ class CourseWikiTest(UniqueCourseTest): self.assertEqual(content, actual_content) -@attr('shard_1') +@attr(shard=1) class HighLevelTabTest(UniqueCourseTest): """ Tests that verify each of the high-level tabs available within a course. @@ -748,7 +748,7 @@ class HighLevelTabTest(UniqueCourseTest): self.assertIn(expected, actual_items) -@attr('shard_1') +@attr(shard=1) class PDFTextBooksTabTest(UniqueCourseTest): """ Tests that verify each of the textbook tabs available within a course. @@ -789,7 +789,7 @@ class PDFTextBooksTabTest(UniqueCourseTest): self.tab_nav.go_to_tab("PDF Book {}".format(i)) -@attr('shard_1') +@attr(shard=1) class VisibleToStaffOnlyTest(UniqueCourseTest): """ Tests that content with visible_to_staff_only set to True cannot be viewed by students. @@ -874,7 +874,7 @@ class VisibleToStaffOnlyTest(UniqueCourseTest): self.assertEqual([u'Test Unit'], self.course_nav.sequence_items) -@attr('shard_1') +@attr(shard=1) class TooltipTest(UniqueCourseTest): """ Tests that tooltips are displayed @@ -919,7 +919,7 @@ class TooltipTest(UniqueCourseTest): self.courseware_page.verify_tooltips_displayed() -@attr('shard_1') +@attr(shard=1) class PreRequisiteCourseTest(UniqueCourseTest): """ Tests that pre-requisite course messages are displayed @@ -1004,7 +1004,7 @@ class PreRequisiteCourseTest(UniqueCourseTest): self.settings_page.save_changes() -@attr('shard_1') +@attr(shard=1) class ProblemExecutionTest(UniqueCourseTest): """ Tests of problems. @@ -1083,7 +1083,7 @@ class ProblemExecutionTest(UniqueCourseTest): self.assertFalse(problem_page.is_correct()) -@attr('shard_1') +@attr(shard=1) class EntranceExamTest(UniqueCourseTest): """ Tests that course has an entrance exam. @@ -1154,7 +1154,7 @@ class EntranceExamTest(UniqueCourseTest): )) -@attr('shard_1') +@attr(shard=1) class NotLiveRedirectTest(UniqueCourseTest): """ Test that a banner is shown when the user is redirected to @@ -1186,7 +1186,7 @@ class NotLiveRedirectTest(UniqueCourseTest): ) -@attr('shard_1') +@attr(shard=1) class EnrollmentClosedRedirectTest(UniqueCourseTest): """ Test that a banner is shown when the user is redirected to the @@ -1275,7 +1275,7 @@ class EnrollmentClosedRedirectTest(UniqueCourseTest): self._assert_dashboard_message() -@attr('shard_1') +@attr(shard=1) class LMSLanguageTest(UniqueCourseTest): """ Test suite for the LMS Language """ def setUp(self): diff --git a/common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py b/common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py index f4c27c44fe..5ae5c723ad 100644 --- a/common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py +++ b/common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py @@ -25,7 +25,7 @@ from common.test.acceptance.pages.lms.instructor_dashboard import InstructorDash from bok_choy.promise import EmptyPromise -@attr('shard_1') +@attr(shard=1) class CoursewareSearchCohortTest(ContainerBase): """ Test courseware search. diff --git a/common/test/acceptance/tests/lms/test_lms_courseware_search.py b/common/test/acceptance/tests/lms/test_lms_courseware_search.py index e566ed44fa..c07479cf9a 100644 --- a/common/test/acceptance/tests/lms/test_lms_courseware_search.py +++ b/common/test/acceptance/tests/lms/test_lms_courseware_search.py @@ -16,7 +16,7 @@ from common.test.acceptance.pages.lms.courseware_search import CoursewareSearchP from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc -@attr('shard_5') +@attr(shard=5) class CoursewareSearchTest(UniqueCourseTest): """ Test courseware search. diff --git a/common/test/acceptance/tests/lms/test_lms_edxnotes.py b/common/test/acceptance/tests/lms/test_lms_edxnotes.py index 03eb10862e..cf0e050532 100644 --- a/common/test/acceptance/tests/lms/test_lms_edxnotes.py +++ b/common/test/acceptance/tests/lms/test_lms_edxnotes.py @@ -122,7 +122,7 @@ class EdxNotesTestMixin(UniqueCourseTest): self.edxnotes_fixture.install() -@attr('shard_4') +@attr(shard=4) class EdxNotesDefaultInteractionsTest(EdxNotesTestMixin): """ Tests for creation, editing, deleting annotations inside annotatable components in LMS. @@ -338,7 +338,7 @@ class EdxNotesDefaultInteractionsTest(EdxNotesTestMixin): self.assertTrue(note.has_sr_label(1, 3, "Tags (space-separated)")) -@attr('shard_4') +@attr(shard=4) class EdxNotesPageTest(EventsTestMixin, EdxNotesTestMixin): """ Tests for Notes page. @@ -1410,7 +1410,7 @@ class EdxNotesPageTest(EventsTestMixin, EdxNotesTestMixin): ) -@attr('shard_4') +@attr(shard=4) class EdxNotesToggleSingleNoteTest(EdxNotesTestMixin): """ Tests for toggling single annotation. @@ -1479,7 +1479,7 @@ class EdxNotesToggleSingleNoteTest(EdxNotesTestMixin): self.assertTrue(note_2.is_visible) -@attr('shard_4') +@attr(shard=4) class EdxNotesToggleNotesTest(EdxNotesTestMixin): """ Tests for toggling visibility of all notes. diff --git a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py index 77b9840c12..cc8fbc1fc4 100644 --- a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py +++ b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py @@ -100,7 +100,7 @@ class BulkEmailTest(BaseInstructorDashboardTest): self.send_email_page.a11y_audit.check_for_accessibility_errors() -@attr('shard_7') +@attr(shard=7) class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest): """ End-to-end tests for Auto-Registration and enrollment functionality via CSV file. @@ -218,7 +218,7 @@ class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest): self.auto_enroll_section.a11y_audit.check_for_accessibility_errors() -@attr('shard_7') +@attr(shard=7) class ProctoredExamsTest(BaseInstructorDashboardTest): """ End-to-end tests for Proctoring Sections of the Instructor Dashboard. @@ -407,7 +407,7 @@ class ProctoredExamsTest(BaseInstructorDashboardTest): self.assertFalse(exam_attempts_section.is_student_attempt_visible) -@attr('shard_7') +@attr(shard=7) class EntranceExamGradeTest(BaseInstructorDashboardTest): """ Tests for Entrance exam specific student grading tasks. @@ -606,7 +606,7 @@ class EntranceExamGradeTest(BaseInstructorDashboardTest): self.assertTrue(self.student_admin_section.is_background_task_history_table_visible()) -@attr('shard_7') +@attr(shard=7) class DataDownloadsTest(BaseInstructorDashboardTest): """ Bok Choy tests for the "Data Downloads" tab. @@ -724,7 +724,7 @@ class DataDownloadsTest(BaseInstructorDashboardTest): self.data_download_section.a11y_audit.check_for_accessibility_errors() -@attr('shard_7') +@attr(shard=7) @ddt.ddt class CertificatesTest(BaseInstructorDashboardTest): """ @@ -1057,7 +1057,7 @@ class CertificatesTest(BaseInstructorDashboardTest): self.certificates_section.a11y_audit.check_for_accessibility_errors() -@attr('shard_7') +@attr(shard=7) class CertificateInvalidationTest(BaseInstructorDashboardTest): """ Tests for Certificates functionality on instructor dashboard. diff --git a/common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py b/common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py index a9d5782a08..77c133f1bc 100644 --- a/common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py +++ b/common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py @@ -21,7 +21,7 @@ from common.test.acceptance.tests.studio.base_studio_test import ContainerBase from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage as StudioAutoAuthPage -@attr('shard_1') +@attr(shard=1) class SplitTestCoursewareSearchTest(ContainerBase): """ Test courseware search on Split Test Module. diff --git a/common/test/acceptance/tests/lms/test_lms_user_preview.py b/common/test/acceptance/tests/lms/test_lms_user_preview.py index 9774c1512d..ac02b2705d 100644 --- a/common/test/acceptance/tests/lms/test_lms_user_preview.py +++ b/common/test/acceptance/tests/lms/test_lms_user_preview.py @@ -17,7 +17,7 @@ from xmodule.partitions.partitions import Group from textwrap import dedent -@attr('shard_3') +@attr(shard=3) class StaffViewTest(UniqueCourseTest): """ Tests that verify the staff view. @@ -55,7 +55,7 @@ class StaffViewTest(UniqueCourseTest): return staff_page -@attr('shard_3') +@attr(shard=3) class CourseWithoutContentGroupsTest(StaffViewTest): """ Setup for tests that have no content restricted to specific content groups. @@ -86,7 +86,7 @@ class CourseWithoutContentGroupsTest(StaffViewTest): ) -@attr('shard_3') +@attr(shard=3) class StaffViewToggleTest(CourseWithoutContentGroupsTest): """ Tests for the staff view toggle button. @@ -103,7 +103,7 @@ class StaffViewToggleTest(CourseWithoutContentGroupsTest): self.assertFalse(course_page.has_tab('Instructor')) -@attr('shard_3') +@attr(shard=3) class StaffDebugTest(CourseWithoutContentGroupsTest): """ Tests that verify the staff debug info. @@ -235,7 +235,7 @@ class StaffDebugTest(CourseWithoutContentGroupsTest): 'for user {}'.format(self.USERNAME), msg) -@attr('shard_3') +@attr(shard=3) class CourseWithContentGroupsTest(StaffViewTest): """ Verifies that changing the "View this course as" selector works properly for content groups. diff --git a/common/test/acceptance/tests/lms/test_problem_types.py b/common/test/acceptance/tests/lms/test_problem_types.py index 0654d3e5d6..6370fd48f8 100644 --- a/common/test/acceptance/tests/lms/test_problem_types.py +++ b/common/test/acceptance/tests/lms/test_problem_types.py @@ -138,7 +138,7 @@ class ProblemTypeTestMixin(object): """ can_submit_blank = False - @attr('shard_7') + @attr(shard=7) def test_answer_correctly(self): """ Scenario: I can answer a problem correctly @@ -174,7 +174,7 @@ class ProblemTypeTestMixin(object): for event in expected_events: self.wait_for_events(event_filter=event, number_of_matches=1) - @attr('shard_7') + @attr(shard=7) def test_answer_incorrectly(self): """ Scenario: I can answer a problem incorrectly @@ -194,7 +194,7 @@ class ProblemTypeTestMixin(object): self.problem_page.click_check() self.wait_for_status('incorrect') - @attr('shard_7') + @attr(shard=7) def test_submit_blank_answer(self): """ Scenario: I can submit a blank answer @@ -215,7 +215,7 @@ class ProblemTypeTestMixin(object): self.problem_page.click_check() self.wait_for_status('incorrect') - @attr('shard_7') + @attr(shard=7) def test_cant_submit_blank_answer(self): """ Scenario: I can't submit a blank answer diff --git a/common/test/acceptance/tests/lms/test_teams.py b/common/test/acceptance/tests/lms/test_teams.py index 5763bb30e4..fec3e5a7f1 100644 --- a/common/test/acceptance/tests/lms/test_teams.py +++ b/common/test/acceptance/tests/lms/test_teams.py @@ -157,7 +157,7 @@ class TeamsTabBase(EventsTestMixin, UniqueCourseTest): @ddt.ddt -@attr('shard_5') +@attr(shard=5) class TeamsTabTest(TeamsTabBase): """ Tests verifying when the Teams tab is present. @@ -303,7 +303,7 @@ class TeamsTabTest(TeamsTabBase): self.assertTrue(self.teams_page.q(css=selector).visible) -@attr('shard_5') +@attr(shard=5) class MyTeamsTest(TeamsTabBase): """ Tests for the "My Teams" tab of the Teams page. @@ -367,7 +367,7 @@ class MyTeamsTest(TeamsTabBase): self.assertEqual(self.my_teams_page.team_memberships[0], '4 / 10 Members') -@attr('shard_5') +@attr(shard=5) @ddt.ddt class BrowseTopicsTest(TeamsTabBase): """ @@ -602,7 +602,7 @@ class BrowseTopicsTest(TeamsTabBase): self.topics_page.visit() -@attr('shard_5') +@attr(shard=5) @ddt.ddt class BrowseTeamsWithinTopicTest(TeamsTabBase): """ @@ -906,7 +906,7 @@ class BrowseTeamsWithinTopicTest(TeamsTabBase): alert.accept() -@attr('shard_5') +@attr(shard=5) class TeamFormActions(TeamsTabBase): """ Base class for create, edit, and delete team. @@ -1619,7 +1619,7 @@ class EditMembershipTest(TeamFormActions): self.edit_membership_helper(role, cancel=True) -@attr('shard_5') +@attr(shard=5) @ddt.ddt class TeamPageTest(TeamsTabBase): """Tests for viewing a specific team""" diff --git a/common/test/acceptance/tests/studio/test_import_export.py b/common/test/acceptance/tests/studio/test_import_export.py index bc3f7fc215..40987b90ec 100644 --- a/common/test/acceptance/tests/studio/test_import_export.py +++ b/common/test/acceptance/tests/studio/test_import_export.py @@ -40,7 +40,7 @@ class ExportTestMixin(object): self.assertTrue(is_tarball_mimetype) -@attr('shard_7') +@attr(shard=7) class TestCourseExport(ExportTestMixin, StudioCourseTest): """ Export tests for courses. @@ -63,7 +63,7 @@ class TestCourseExport(ExportTestMixin, StudioCourseTest): self.assertEqual(self.export_page.header_text, 'Course Export') -@attr('shard_7') +@attr(shard=7) class TestLibraryExport(ExportTestMixin, StudioLibraryTest): """ Export tests for libraries. @@ -112,7 +112,7 @@ class BadExportMixin(object): ) -@attr('shard_7') +@attr(shard=7) class TestLibraryBadExport(BadExportMixin, StudioLibraryTest): """ Verify exporting a bad library causes an error. @@ -136,7 +136,7 @@ class TestLibraryBadExport(BadExportMixin, StudioLibraryTest): ) -@attr('shard_7') +@attr(shard=7) class TestCourseBadExport(BadExportMixin, StudioCourseTest): """ Verify exporting a bad course causes an error. @@ -168,7 +168,7 @@ class TestCourseBadExport(BadExportMixin, StudioCourseTest): ) -@attr('shard_7') +@attr(shard=7) class ImportTestMixin(object): """ Tests to run for both course and library import pages. @@ -283,7 +283,7 @@ class ImportTestMixin(object): self.import_page.wait_for_tasks(fail_on='Updating') -@attr('shard_7') +@attr(shard=7) class TestEntranceExamCourseImport(ImportTestMixin, StudioCourseTest): """ Tests the Course import page @@ -329,7 +329,7 @@ class TestEntranceExamCourseImport(ImportTestMixin, StudioCourseTest): ) -@attr('shard_7') +@attr(shard=7) class TestCourseImport(ImportTestMixin, StudioCourseTest): """ Tests the Course import page @@ -399,7 +399,7 @@ class TestCourseImport(ImportTestMixin, StudioCourseTest): self.assertFalse(self.import_page.is_timestamp_visible()) -@attr('shard_7') +@attr(shard=7) class TestLibraryImport(ImportTestMixin, StudioLibraryTest): """ Tests the Library import page diff --git a/common/test/acceptance/tests/studio/test_studio_container.py b/common/test/acceptance/tests/studio/test_studio_container.py index 05c9174bba..231732ba10 100644 --- a/common/test/acceptance/tests/studio/test_studio_container.py +++ b/common/test/acceptance/tests/studio/test_studio_container.py @@ -72,7 +72,7 @@ class NestedVerticalTest(ContainerBase): @skip("Flaky: 01/16/2015") -@attr('shard_1') +@attr(shard=1) class DragAndDropTest(NestedVerticalTest): """ Tests of reordering within the container page. @@ -152,7 +152,7 @@ class DragAndDropTest(NestedVerticalTest): self.do_action_and_verify(add_new_components_and_rearrange, expected_ordering) -@attr('shard_1') +@attr(shard=1) class AddComponentTest(NestedVerticalTest): """ Tests of adding a component to the container page. @@ -192,7 +192,7 @@ class AddComponentTest(NestedVerticalTest): self.add_and_verify(container_menu, expected_ordering) -@attr('shard_1') +@attr(shard=1) class DuplicateComponentTest(NestedVerticalTest): """ Tests of duplicating a component on the container page. @@ -238,7 +238,7 @@ class DuplicateComponentTest(NestedVerticalTest): self.do_action_and_verify(duplicate_twice, expected_ordering) -@attr('shard_1') +@attr(shard=1) class DeleteComponentTest(NestedVerticalTest): """ Tests of deleting a component from the container page. @@ -261,7 +261,7 @@ class DeleteComponentTest(NestedVerticalTest): self.delete_and_verify(group_a_item_1_delete_index, expected_ordering) -@attr('shard_1') +@attr(shard=1) class EditContainerTest(NestedVerticalTest): """ Tests of editing a container. @@ -312,7 +312,7 @@ class EditContainerTest(NestedVerticalTest): self.assertEqual(component.student_content, "modified content") -@attr('shard_3') +@attr(shard=3) class EditVisibilityModalTest(ContainerBase): """ Tests of the visibility settings modal for components on the unit @@ -572,7 +572,7 @@ class EditVisibilityModalTest(ContainerBase): self.verify_visibility_set(self.html_component, True) -@attr('shard_1') +@attr(shard=1) class UnitPublishingTest(ContainerBase): """ Tests of the publishing control and related widgets on the Unit page. @@ -1042,7 +1042,7 @@ class UnitPublishingTest(ContainerBase): # self.assertEqual('discussion', self.courseware.xblock_component_type(1)) -@attr('shard_3') +@attr(shard=3) class DisplayNameTest(ContainerBase): """ Test consistent use of display_name_with_default @@ -1079,7 +1079,7 @@ class DisplayNameTest(ContainerBase): self.assertEqual(container.name, title_on_unit_page) -@attr('shard_3') +@attr(shard=3) class ProblemCategoryTabsTest(ContainerBase): """ Test to verify tabs in problem category. diff --git a/common/test/acceptance/tests/studio/test_studio_course_create.py b/common/test/acceptance/tests/studio/test_studio_course_create.py index b8441dab8b..a45f9b2fdd 100644 --- a/common/test/acceptance/tests/studio/test_studio_course_create.py +++ b/common/test/acceptance/tests/studio/test_studio_course_create.py @@ -10,7 +10,7 @@ from common.test.acceptance.pages.studio.index import DashboardPage from common.test.acceptance.pages.studio.overview import CourseOutlinePage -@attr('shard_8') +@attr(shard=8) class CreateCourseTest(WebAppTest): """ Test that we can create a new course the studio home page. diff --git a/common/test/acceptance/tests/studio/test_studio_course_team.py b/common/test/acceptance/tests/studio/test_studio_course_team.py index 9a76bdf8c8..8079747124 100644 --- a/common/test/acceptance/tests/studio/test_studio_course_team.py +++ b/common/test/acceptance/tests/studio/test_studio_course_team.py @@ -10,7 +10,7 @@ from common.test.acceptance.pages.studio.users import CourseTeamPage from common.test.acceptance.pages.studio.index import DashboardPage -@attr('shard_2') +@attr(shard=2) class CourseTeamPageTest(StudioCourseTest): """ As a course author, I want to be able to add others to my team """ def _make_user(self, username): diff --git a/common/test/acceptance/tests/studio/test_studio_library.py b/common/test/acceptance/tests/studio/test_studio_library.py index c6049c178d..ee9412f312 100644 --- a/common/test/acceptance/tests/studio/test_studio_library.py +++ b/common/test/acceptance/tests/studio/test_studio_library.py @@ -13,7 +13,7 @@ from common.test.acceptance.pages.studio.library import LibraryEditPage from common.test.acceptance.pages.studio.users import LibraryUsersPage -@attr('shard_2') +@attr(shard=2) @ddt class LibraryEditPageTest(StudioLibraryTest): """ @@ -186,7 +186,7 @@ class LibraryEditPageTest(StudioLibraryTest): self.assertIn("Checkboxes", problem_block.name) -@attr('shard_2') +@attr(shard=2) @ddt class LibraryNavigationTest(StudioLibraryTest): """ diff --git a/common/test/acceptance/tests/studio/test_studio_library_container.py b/common/test/acceptance/tests/studio/test_studio_library_container.py index 27aa0ef850..1d7bf1831a 100644 --- a/common/test/acceptance/tests/studio/test_studio_library_container.py +++ b/common/test/acceptance/tests/studio/test_studio_library_container.py @@ -17,7 +17,7 @@ SUBSECTION_NAME = 'Test Subsection' UNIT_NAME = 'Test Unit' -@attr('shard_5') +@attr(shard=5) @ddt.ddt class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest, TestWithSearchIndexMixin): """ diff --git a/common/test/acceptance/tests/studio/test_studio_outline.py b/common/test/acceptance/tests/studio/test_studio_outline.py index 934311eece..6a18e3c464 100644 --- a/common/test/acceptance/tests/studio/test_studio_outline.py +++ b/common/test/acceptance/tests/studio/test_studio_outline.py @@ -74,7 +74,7 @@ class CourseOutlineTest(StudioCourseTest): verify_ordering(self, outline_page, expected_ordering) -@attr('shard_3') +@attr(shard=3) class CourseOutlineDragAndDropTest(CourseOutlineTest): """ Tests of drag and drop within the outline page. @@ -129,7 +129,7 @@ class CourseOutlineDragAndDropTest(CourseOutlineTest): self.drag_and_verify(self.seq_1_vert_2_handle, self.chap_1_seq_2_handle, expected_ordering, course_outline_page) -@attr('shard_3') +@attr(shard=3) class WarningMessagesTest(CourseOutlineTest): """ Feature: Warning messages on sections, subsections, and units @@ -337,7 +337,7 @@ class WarningMessagesTest(CourseOutlineTest): unit.toggle_staff_lock() -@attr('shard_3') +@attr(shard=3) class EditingSectionsTest(CourseOutlineTest): """ Feature: Editing Release date, Due date and grading type. @@ -493,7 +493,7 @@ class EditingSectionsTest(CourseOutlineTest): self.assertIn(release_text, self.course_outline_page.section_at(0).subsection_at(0).release_date) -@attr('shard_3') +@attr(shard=3) class StaffLockTest(CourseOutlineTest): """ Feature: Sections, subsections, and units can be locked and unlocked from the course outline. @@ -875,7 +875,7 @@ class StaffLockTest(CourseOutlineTest): self._remove_staff_lock_and_verify_warning(subsection, False) -@attr('shard_3') +@attr(shard=3) class EditNamesTest(CourseOutlineTest): """ Feature: Click-to-edit section/subsection names @@ -991,7 +991,7 @@ class EditNamesTest(CourseOutlineTest): self.assertTrue(self.course_outline_page.section_at(0).is_collapsed) -@attr('shard_3') +@attr(shard=3) class CreateSectionsTest(CourseOutlineTest): """ Feature: Create new sections/subsections/units @@ -1078,7 +1078,7 @@ class CreateSectionsTest(CourseOutlineTest): self.assertTrue(unit_page.is_inline_editing_display_name()) -@attr('shard_3') +@attr(shard=3) class DeleteContentTest(CourseOutlineTest): """ Feature: Deleting sections/subsections/units @@ -1190,7 +1190,7 @@ class DeleteContentTest(CourseOutlineTest): self.assertTrue(self.course_outline_page.has_no_content_message) -@attr('shard_3') +@attr(shard=3) class ExpandCollapseMultipleSectionsTest(CourseOutlineTest): """ Feature: Courses with multiple sections can expand and collapse all sections. @@ -1322,7 +1322,7 @@ class ExpandCollapseMultipleSectionsTest(CourseOutlineTest): self.verify_all_sections(collapsed=False) -@attr('shard_3') +@attr(shard=3) class ExpandCollapseSingleSectionTest(CourseOutlineTest): """ Feature: Courses with a single section can expand and collapse all sections. @@ -1362,7 +1362,7 @@ class ExpandCollapseSingleSectionTest(CourseOutlineTest): self.assertFalse(self.course_outline_page.section_at(0).subsection_at(1).is_collapsed) -@attr('shard_3') +@attr(shard=3) class ExpandCollapseEmptyTest(CourseOutlineTest): """ Feature: Courses with no sections initially can expand and collapse all sections after addition. @@ -1400,7 +1400,7 @@ class ExpandCollapseEmptyTest(CourseOutlineTest): self.assertFalse(self.course_outline_page.section_at(0).is_collapsed) -@attr('shard_3') +@attr(shard=3) class DefaultStatesEmptyTest(CourseOutlineTest): """ Feature: Misc course outline default states/actions when starting with an empty course @@ -1425,7 +1425,7 @@ class DefaultStatesEmptyTest(CourseOutlineTest): self.assertTrue(self.course_outline_page.bottom_add_section_button.is_present()) -@attr('shard_3') +@attr(shard=3) class DefaultStatesContentTest(CourseOutlineTest): """ Feature: Misc course outline default states/actions when starting with a course with content @@ -1450,7 +1450,7 @@ class DefaultStatesContentTest(CourseOutlineTest): self.assertEqual(courseware.xblock_component_type(2), 'discussion') -@attr('shard_3') +@attr(shard=3) class UnitNavigationTest(CourseOutlineTest): """ Feature: Navigate to units @@ -1471,7 +1471,7 @@ class UnitNavigationTest(CourseOutlineTest): self.assertTrue(unit.is_browser_on_page) -@attr('shard_3') +@attr(shard=3) class PublishSectionTest(CourseOutlineTest): """ Feature: Publish sections. @@ -1597,7 +1597,7 @@ class PublishSectionTest(CourseOutlineTest): return (section, subsection, unit) -@attr('shard_3') +@attr(shard=3) class DeprecationWarningMessageTest(CourseOutlineTest): """ Feature: Verify deprecation warning message. @@ -1763,7 +1763,7 @@ class DeprecationWarningMessageTest(CourseOutlineTest): ) -@attr('shard_4') +@attr(shard=4) class SelfPacedOutlineTest(CourseOutlineTest): """Test the course outline for a self-paced course.""" diff --git a/common/test/acceptance/tests/studio/test_studio_settings.py b/common/test/acceptance/tests/studio/test_studio_settings.py index b0dd155311..06d42fb8c5 100644 --- a/common/test/acceptance/tests/studio/test_studio_settings.py +++ b/common/test/acceptance/tests/studio/test_studio_settings.py @@ -22,7 +22,7 @@ from textwrap import dedent from xmodule.partitions.partitions import Group -@attr('shard_8') +@attr(shard=8) class ContentGroupConfigurationTest(StudioCourseTest): """ Tests for content groups in the Group Configurations Page. @@ -234,7 +234,7 @@ class ContentGroupConfigurationTest(StudioCourseTest): ).fulfill() -@attr('shard_8') +@attr(shard=8) class AdvancedSettingsValidationTest(StudioCourseTest): """ Tests for validation feature in Studio's advanced settings tab @@ -407,7 +407,7 @@ class AdvancedSettingsValidationTest(StudioCourseTest): self.assertEquals(set(displayed_fields), set(expected_fields)) -@attr('shard_1') +@attr(shard=1) class ContentLicenseTest(StudioCourseTest): """ Tests for course-level licensing (that is, setting the license, diff --git a/common/test/acceptance/tests/studio/test_studio_settings_certificates.py b/common/test/acceptance/tests/studio/test_studio_settings_certificates.py index f56e75546e..52721b19ac 100644 --- a/common/test/acceptance/tests/studio/test_studio_settings_certificates.py +++ b/common/test/acceptance/tests/studio/test_studio_settings_certificates.py @@ -13,7 +13,7 @@ from common.test.acceptance.pages.studio.settings_advanced import AdvancedSettin from common.test.acceptance.tests.helpers import skip_if_browser -@attr('shard_8') +@attr(shard=8) class CertificatesTest(StudioCourseTest): """ Tests for settings/certificates Page. diff --git a/common/test/acceptance/tests/studio/test_studio_settings_details.py b/common/test/acceptance/tests/studio/test_studio_settings_details.py index 835ea93e94..6cae983ac8 100644 --- a/common/test/acceptance/tests/studio/test_studio_settings_details.py +++ b/common/test/acceptance/tests/studio/test_studio_settings_details.py @@ -19,7 +19,7 @@ from common.test.acceptance.tests.helpers import ( ) -@attr('shard_4') +@attr(shard=4) class StudioSettingsDetailsTest(StudioCourseTest): """Base class for settings and details page tests.""" @@ -37,7 +37,7 @@ class StudioSettingsDetailsTest(StudioCourseTest): self.assertTrue(self.settings_detail.is_browser_on_page()) -@attr('shard_4') +@attr(shard=4) class SettingsMilestonesTest(StudioSettingsDetailsTest): """ Tests for milestones feature in Studio's settings tab @@ -206,7 +206,7 @@ class SettingsMilestonesTest(StudioSettingsDetailsTest): )) -@attr('shard_4') +@attr(shard=4) class CoursePacingTest(StudioSettingsDetailsTest): """Tests for setting a course to self-paced.""" diff --git a/common/test/acceptance/tests/studio/test_studio_split_test.py b/common/test/acceptance/tests/studio/test_studio_split_test.py index 137dcb1dc2..e91c1deba4 100644 --- a/common/test/acceptance/tests/studio/test_studio_split_test.py +++ b/common/test/acceptance/tests/studio/test_studio_split_test.py @@ -66,7 +66,7 @@ class SplitTestMixin(object): Promise(missing_groups_button_not_present, "Add missing groups button should not be showing.").fulfill() -@attr('shard_2') +@attr(shard=2) class SplitTest(ContainerBase, SplitTestMixin): """ Tests for creating and editing split test instances in Studio. @@ -199,7 +199,7 @@ class SplitTest(ContainerBase, SplitTestMixin): self.verify_groups(container, ['alpha'], [], verify_missing_groups_not_present=False) -@attr('shard_2') +@attr(shard=2) class GroupConfigurationsNoSplitTest(StudioCourseTest): """ Tests how the Group Configuration page should look when the split_test module is not enabled. @@ -224,7 +224,7 @@ class GroupConfigurationsNoSplitTest(StudioCourseTest): self.assertFalse(self.group_configurations_page.experiment_group_sections_present) -@attr('shard_2') +@attr(shard=2) class GroupConfigurationsTest(ContainerBase, SplitTestMixin): """ Tests that Group Configurations page works correctly with previously diff --git a/common/test/acceptance/tests/studio/test_studio_textbooks.py b/common/test/acceptance/tests/studio/test_studio_textbooks.py index 2d95277638..cdfe8fce97 100644 --- a/common/test/acceptance/tests/studio/test_studio_textbooks.py +++ b/common/test/acceptance/tests/studio/test_studio_textbooks.py @@ -8,7 +8,7 @@ from common.test.acceptance.tests.helpers import disable_animations from nose.plugins.attrib import attr -@attr('shard_2') +@attr(shard=2) class TextbooksTest(StudioCourseTest): """ Test that textbook functionality is working properly on studio side diff --git a/common/test/acceptance/tests/test_cohorted_courseware.py b/common/test/acceptance/tests/test_cohorted_courseware.py index 98eca6c02b..deee9bdbd8 100644 --- a/common/test/acceptance/tests/test_cohorted_courseware.py +++ b/common/test/acceptance/tests/test_cohorted_courseware.py @@ -21,8 +21,11 @@ from bok_choy.promise import EmptyPromise from bok_choy.page_object import XSS_INJECTION -@attr('shard_5') +@attr(shard=5) class EndToEndCohortedCoursewareTest(ContainerBase): + """ + End-to-end of cohorted courseware. + """ def setUp(self, is_staff=True): diff --git a/common/test/acceptance/tests/video/test_studio_video_editor.py b/common/test/acceptance/tests/video/test_studio_video_editor.py index cea89c3720..90f43dfc55 100644 --- a/common/test/acceptance/tests/video/test_studio_video_editor.py +++ b/common/test/acceptance/tests/video/test_studio_video_editor.py @@ -7,7 +7,7 @@ from nose.plugins.attrib import attr from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest -@attr('shard_6') +@attr(shard=6) class VideoEditorTest(CMSVideoBaseTest): """ CMS Video Editor Test Class diff --git a/common/test/acceptance/tests/video/test_studio_video_module.py b/common/test/acceptance/tests/video/test_studio_video_module.py index cda6b09a8f..f1b834803d 100644 --- a/common/test/acceptance/tests/video/test_studio_video_module.py +++ b/common/test/acceptance/tests/video/test_studio_video_module.py @@ -161,7 +161,7 @@ class CMSVideoBaseTest(UniqueCourseTest): self.unit_page.xblocks[1].save_settings() -@attr('shard_4') +@attr(shard=4) class CMSVideoTest(CMSVideoBaseTest): """ CMS Video Test Class diff --git a/common/test/acceptance/tests/video/test_studio_video_transcript.py b/common/test/acceptance/tests/video/test_studio_video_transcript.py index d6266cecdc..7a56991df4 100644 --- a/common/test/acceptance/tests/video/test_studio_video_transcript.py +++ b/common/test/acceptance/tests/video/test_studio_video_transcript.py @@ -22,7 +22,7 @@ from nose.plugins.attrib import attr from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest -@attr('shard_6') +@attr(shard=6) class VideoTranscriptTest(CMSVideoBaseTest): """ CMS Video Transcript Test Class diff --git a/common/test/acceptance/tests/video/test_video_events.py b/common/test/acceptance/tests/video/test_video_events.py index f1aa207f01..7e8327fdc3 100644 --- a/common/test/acceptance/tests/video/test_video_events.py +++ b/common/test/acceptance/tests/video/test_video_events.py @@ -149,7 +149,7 @@ class VideoEventsTest(VideoEventsTestMixin): assert_events_equal(static_fields_pattern, load_video_event) -@attr('shard_8') +@attr(shard=8) @ddt.ddt class VideoBumperEventsTest(VideoEventsTestMixin): """ Test bumper video event emission """ diff --git a/common/test/acceptance/tests/video/test_video_handout.py b/common/test/acceptance/tests/video/test_video_handout.py index 68c0d7f78a..06ace1b623 100644 --- a/common/test/acceptance/tests/video/test_video_handout.py +++ b/common/test/acceptance/tests/video/test_video_handout.py @@ -7,7 +7,7 @@ from nose.plugins.attrib import attr from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest -@attr('shard_5') +@attr(shard=5) class VideoHandoutTest(CMSVideoBaseTest): """ CMS Video Handout Test Class diff --git a/common/test/acceptance/tests/video/test_video_license.py b/common/test/acceptance/tests/video/test_video_license.py index 80f42b28e7..b5e073081c 100644 --- a/common/test/acceptance/tests/video/test_video_license.py +++ b/common/test/acceptance/tests/video/test_video_license.py @@ -12,7 +12,7 @@ from common.test.acceptance.pages.lms.courseware import CoursewarePage from common.test.acceptance.fixtures.course import XBlockFixtureDesc -@attr('shard_2') +@attr(shard=2) class VideoLicenseTest(StudioCourseTest): """ Tests for video module-level licensing (that is, setting the license, diff --git a/common/test/acceptance/tests/video/test_video_module.py b/common/test/acceptance/tests/video/test_video_module.py index 9616e7fd62..56e18a198b 100644 --- a/common/test/acceptance/tests/video/test_video_module.py +++ b/common/test/acceptance/tests/video/test_video_module.py @@ -198,7 +198,7 @@ class VideoBaseTest(UniqueCourseTest): self.video.wait_for_video_player_render() -@attr('shard_4') +@attr(shard=4) class YouTubeVideoTest(VideoBaseTest): """ Test YouTube Video Player """ @@ -935,7 +935,7 @@ class YouTubeVideoTest(VideoBaseTest): execute_video_steps(tab1_video_names) -@attr('shard_4') +@attr(shard=4) class YouTubeHtml5VideoTest(VideoBaseTest): """ Test YouTube HTML5 Video Player """ @@ -957,7 +957,7 @@ class YouTubeHtml5VideoTest(VideoBaseTest): self.assertTrue(self.video.is_video_rendered('youtube')) -@attr('shard_4') +@attr(shard=4) class Html5VideoTest(VideoBaseTest): """ Test HTML5 Video Player """ @@ -1143,7 +1143,7 @@ class Html5VideoTest(VideoBaseTest): self.assertTrue(all([source in HTML5_SOURCES for source in self.video.sources])) -@attr('shard_4') +@attr(shard=4) class YouTubeQualityTest(VideoBaseTest): """ Test YouTube Video Quality Button """ @@ -1192,7 +1192,7 @@ class YouTubeQualityTest(VideoBaseTest): self.video.wait_for(lambda: self.video.is_quality_button_active, 'waiting for quality button activation') -@attr('shard_4') +@attr(shard=4) class DragAndDropTest(VideoBaseTest): """ Tests draggability of closed captions within videos. diff --git a/lms/djangoapps/badges/api/tests.py b/lms/djangoapps/badges/api/tests.py index 47199bfaea..441c593eba 100644 --- a/lms/djangoapps/badges/api/tests.py +++ b/lms/djangoapps/badges/api/tests.py @@ -152,7 +152,7 @@ class TestUserCourseBadgeAssertions(UserAssertionTestCase): self.check_assertion_structure(assertion, response['results'][0]) -@attr('shard_3') +@attr(shard=3) @ddt class TestUserBadgeAssertionsByClass(UserAssertionTestCase): """ diff --git a/lms/djangoapps/badges/tests/test_models.py b/lms/djangoapps/badges/tests/test_models.py index 87745cb258..fc56ab66b3 100644 --- a/lms/djangoapps/badges/tests/test_models.py +++ b/lms/djangoapps/badges/tests/test_models.py @@ -29,7 +29,7 @@ def get_image(name): return ImageFile(open(TEST_DATA_ROOT / 'badges' / name + '.png')) -@attr('shard_1') +@attr(shard=1) class BadgeImageConfigurationTest(TestCase): """ Test the validation features of BadgeImageConfiguration. diff --git a/lms/djangoapps/branding/tests/test_models.py b/lms/djangoapps/branding/tests/test_models.py index d03f155921..a3d6c3fcae 100644 --- a/lms/djangoapps/branding/tests/test_models.py +++ b/lms/djangoapps/branding/tests/test_models.py @@ -8,7 +8,7 @@ from nose.plugins.attrib import attr from branding.models import BrandingInfoConfig -@attr('shard_1') +@attr(shard=1) class BrandingInfoConfigTest(TestCase): """ Test the BrandingInfoConfig model. diff --git a/lms/djangoapps/branding/tests/test_page.py b/lms/djangoapps/branding/tests/test_page.py index b5f21850b3..247c4d1332 100644 --- a/lms/djangoapps/branding/tests/test_page.py +++ b/lms/djangoapps/branding/tests/test_page.py @@ -40,7 +40,7 @@ def mock_render_to_response(*args, **kwargs): RENDER_MOCK = Mock(side_effect=mock_render_to_response) -@attr('shard_1') +@attr(shard=1) class AnonymousIndexPageTest(ModuleStoreTestCase): """ Tests that anonymous users can access the '/' page, Need courses with start date @@ -112,7 +112,7 @@ class AnonymousIndexPageTest(ModuleStoreTestCase): self.assertEqual(response._headers.get("location")[1], "/login") # pylint: disable=protected-access -@attr('shard_1') +@attr(shard=1) class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, MilestonesTestCaseMixin): """ Test to simulate and verify fix for disappearing courses in @@ -156,7 +156,7 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, Mi self.assertIn('course that has pre requisite', resp.content) -@attr('shard_1') +@attr(shard=1) class IndexPageCourseCardsSortingTests(ModuleStoreTestCase): """ Test for Index page course cards sorting diff --git a/lms/djangoapps/bulk_email/tests/test_course_optout.py b/lms/djangoapps/bulk_email/tests/test_course_optout.py index 1780066823..d43d94d9e0 100644 --- a/lms/djangoapps/bulk_email/tests/test_course_optout.py +++ b/lms/djangoapps/bulk_email/tests/test_course_optout.py @@ -17,7 +17,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from bulk_email.models import BulkEmailFlag -@attr('shard_1') +@attr(shard=1) @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True)) class TestOptoutCourseEmails(ModuleStoreTestCase): """ diff --git a/lms/djangoapps/bulk_email/tests/test_email.py b/lms/djangoapps/bulk_email/tests/test_email.py index cd20d9a3fd..f922492760 100644 --- a/lms/djangoapps/bulk_email/tests/test_email.py +++ b/lms/djangoapps/bulk_email/tests/test_email.py @@ -129,7 +129,7 @@ class EmailSendFromDashboardTestCase(SharedModuleStoreTestCase): BulkEmailFlag.objects.all().delete() -@attr('shard_1') +@attr(shard=1) @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True)) class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase): """ @@ -442,7 +442,7 @@ class TestEmailSendFromDashboardMockedHtmlToText(EmailSendFromDashboardTestCase) self.assertItemsEqual(outbox_contents, should_send_contents) -@attr('shard_1') +@attr(shard=1) @skipIf(os.environ.get("TRAVIS") == 'true', "Skip this test in Travis CI.") class TestEmailSendFromDashboard(EmailSendFromDashboardTestCase): """ diff --git a/lms/djangoapps/bulk_email/tests/test_err_handling.py b/lms/djangoapps/bulk_email/tests/test_err_handling.py index 9c4363b4df..f1bdcbe5df 100644 --- a/lms/djangoapps/bulk_email/tests/test_err_handling.py +++ b/lms/djangoapps/bulk_email/tests/test_err_handling.py @@ -36,7 +36,7 @@ class EmailTestException(Exception): pass -@attr('shard_1') +@attr(shard=1) @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True)) class TestEmailErrors(ModuleStoreTestCase): """ diff --git a/lms/djangoapps/bulk_email/tests/test_forms.py b/lms/djangoapps/bulk_email/tests/test_forms.py index b823acc44e..7ea5771481 100644 --- a/lms/djangoapps/bulk_email/tests/test_forms.py +++ b/lms/djangoapps/bulk_email/tests/test_forms.py @@ -12,7 +12,7 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory -@attr('shard_1') +@attr(shard=1) class CourseAuthorizationFormTest(ModuleStoreTestCase): """Test the CourseAuthorizationAdminForm form for Mongo-backed courses.""" diff --git a/lms/djangoapps/bulk_email/tests/test_models.py b/lms/djangoapps/bulk_email/tests/test_models.py index db3fd2b591..b0b588f112 100644 --- a/lms/djangoapps/bulk_email/tests/test_models.py +++ b/lms/djangoapps/bulk_email/tests/test_models.py @@ -21,7 +21,7 @@ from openedx.core.djangoapps.course_groups.models import CourseCohort from opaque_keys.edx.keys import CourseKey -@attr('shard_1') +@attr(shard=1) @patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True)) class CourseEmailTest(TestCase): """Test the CourseEmail model.""" @@ -82,7 +82,7 @@ class CourseEmailTest(TestCase): self.assertEqual(target.long_display(), 'Cohort: test cohort') -@attr('shard_1') +@attr(shard=1) class NoCourseEmailTemplateTest(TestCase): """Test the CourseEmailTemplate model without loading the template data.""" @@ -91,7 +91,7 @@ class NoCourseEmailTemplateTest(TestCase): CourseEmailTemplate.get_template() -@attr('shard_1') +@attr(shard=1) class CourseEmailTemplateTest(TestCase): """Test the CourseEmailTemplate model.""" @@ -190,7 +190,7 @@ class CourseEmailTemplateTest(TestCase): self.assertIn(context['name'], message) -@attr('shard_1') +@attr(shard=1) class CourseAuthorizationTest(TestCase): """Test the CourseAuthorization model.""" diff --git a/lms/djangoapps/bulk_email/tests/test_tasks.py b/lms/djangoapps/bulk_email/tests/test_tasks.py index 0f457effc3..06ad3d07c9 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_3') +@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/api/v0/tests/test_views.py b/lms/djangoapps/ccx/api/v0/tests/test_views.py index 01aa9cd1f4..a306433656 100644 --- a/lms/djangoapps/ccx/api/v0/tests/test_views.py +++ b/lms/djangoapps/ccx/api/v0/tests/test_views.py @@ -139,7 +139,7 @@ class CcxRestApiTest(CcxTestCase, APITestCase): self.assertEqual(expected_field_errors, resp_dict_error) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class CcxListTest(CcxRestApiTest): """ @@ -655,7 +655,7 @@ class CcxListTest(CcxRestApiTest): self.assertEqual(course_user, ccx_user) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class CcxDetailTest(CcxRestApiTest): """ diff --git a/lms/djangoapps/ccx/tests/test_field_override_performance.py b/lms/djangoapps/ccx/tests/test_field_override_performance.py index 263715e5ae..e00a8cedd9 100644 --- a/lms/djangoapps/ccx/tests/test_field_override_performance.py +++ b/lms/djangoapps/ccx/tests/test_field_override_performance.py @@ -31,7 +31,7 @@ from lms.djangoapps.ccx.tests.factories import CcxFactory from openedx.core.djangoapps.content.block_structure.api import get_course_in_cache -@attr('shard_3') +@attr(shard=3) @mock.patch.dict( 'django.conf.settings.FEATURES', { diff --git a/lms/djangoapps/ccx/tests/test_models.py b/lms/djangoapps/ccx/tests/test_models.py index e81681c43e..c756b61de0 100644 --- a/lms/djangoapps/ccx/tests/test_models.py +++ b/lms/djangoapps/ccx/tests/test_models.py @@ -25,7 +25,7 @@ from ..overrides import override_field_for_ccx @ddt.ddt -@attr('shard_1') +@attr(shard=1) class TestCCX(ModuleStoreTestCase): """Unit tests for the CustomCourseForEdX model """ diff --git a/lms/djangoapps/ccx/tests/test_overrides.py b/lms/djangoapps/ccx/tests/test_overrides.py index 6ddfde9dcb..6110a74bf7 100644 --- a/lms/djangoapps/ccx/tests/test_overrides.py +++ b/lms/djangoapps/ccx/tests/test_overrides.py @@ -26,7 +26,7 @@ from lms.djangoapps.ccx.overrides import override_field_for_ccx from lms.djangoapps.ccx.tests.utils import flatten, iter_blocks -@attr('shard_1') +@attr(shard=1) @override_settings( XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'], MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'], diff --git a/lms/djangoapps/ccx/tests/test_utils.py b/lms/djangoapps/ccx/tests/test_utils.py index 76c1ba9967..50af4df918 100644 --- a/lms/djangoapps/ccx/tests/test_utils.py +++ b/lms/djangoapps/ccx/tests/test_utils.py @@ -37,7 +37,7 @@ from lms.djangoapps.ccx.tests.factories import CcxFactory from lms.djangoapps.ccx.tests.utils import CcxTestCase -@attr('shard_1') +@attr(shard=1) class TestGetCCXFromCCXLocator(ModuleStoreTestCase): """Verify that get_ccx_from_ccx_locator functions properly""" MODULESTORE = TEST_DATA_SPLIT_MODULESTORE @@ -70,7 +70,7 @@ class TestGetCCXFromCCXLocator(ModuleStoreTestCase): self.assertEqual(result, ccx) -@attr('shard_1') +@attr(shard=1) class TestGetCourseChapters(CcxTestCase): """ Tests for the `get_course_chapters` util function diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 33ee588f0d..55110aac8c 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -188,7 +188,7 @@ class TestAdminAccessCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): self.assertEqual(response.status_code, 403) -@attr('shard_1') +@attr(shard=1) @override_settings( XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'], MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'], @@ -303,7 +303,7 @@ class TestCCXProgressChanges(CcxTestCase, LoginEnrollmentTestCase): self.assert_progress_summary(ccx_course_key, due) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): """ @@ -917,7 +917,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): ) -@attr('shard_1') +@attr(shard=1) class TestCoachDashboardSchedule(CcxTestCase, LoginEnrollmentTestCase, ModuleStoreTestCase): """ Tests of the CCX Coach Dashboard which need to modify the course content. @@ -1059,7 +1059,7 @@ def patched_get_children(self, usage_key_filter=None): return list(iter_children()) -@attr('shard_1') +@attr(shard=1) @override_settings( XBLOCK_FIELD_DATA_WRAPPERS=['lms.djangoapps.courseware.field_overrides:OverrideModulestoreFieldData.wrap'], MODULESTORE_FIELD_OVERRIDE_PROVIDERS=['ccx.overrides.CustomCoursesForEdxOverrideProvider'], diff --git a/lms/djangoapps/certificates/tests/test_api.py b/lms/djangoapps/certificates/tests/test_api.py index dcf95c4fb4..1b9812c2da 100644 --- a/lms/djangoapps/certificates/tests/test_api.py +++ b/lms/djangoapps/certificates/tests/test_api.py @@ -83,7 +83,7 @@ class WebCertificateTestMixin(object): self.store.update_item(self.course, self.user.id) -@attr('shard_1') +@attr(shard=1) class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTestCase): """Tests for the `certificate_downloadable_status` helper function. """ @@ -203,7 +203,7 @@ class CertificateDownloadableStatusTests(WebCertificateTestMixin, ModuleStoreTes ) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase): """Tests for the `is_certificate_invalid` helper function. """ @@ -315,7 +315,7 @@ class CertificateisInvalid(WebCertificateTestMixin, ModuleStoreTestCase): ) -@attr('shard_1') +@attr(shard=1) class CertificateGetTests(SharedModuleStoreTestCase): """Tests for the `test_get_certificate_for_user` helper function. """ @classmethod @@ -402,7 +402,7 @@ class CertificateGetTests(SharedModuleStoreTestCase): ) -@attr('shard_1') +@attr(shard=1) @override_settings(CERT_QUEUE='certificates') class GenerateUserCertificatesTest(EventTestMixin, WebCertificateTestMixin, ModuleStoreTestCase): """Tests for generating certificates for students. """ @@ -494,7 +494,7 @@ class GenerateUserCertificatesTest(EventTestMixin, WebCertificateTestMixin, Modu self.assertEqual(url, "") -@attr('shard_1') +@attr(shard=1) @ddt.ddt class CertificateGenerationEnabledTest(EventTestMixin, TestCase): """Test enabling/disabling self-generated certificates for a course. """ @@ -562,7 +562,7 @@ class CertificateGenerationEnabledTest(EventTestMixin, TestCase): self.assertEqual(expect_enabled, actual_enabled) -@attr('shard_1') +@attr(shard=1) class GenerateExampleCertificatesTest(TestCase): """Test generation of example certificates. """ @@ -650,7 +650,7 @@ def set_microsite(domain): @override_settings(FEATURES=FEATURES_WITH_CERTS_ENABLED) -@attr('shard_1') +@attr(shard=1) class CertificatesBrandingTest(TestCase): """Test certificates branding. """ diff --git a/lms/djangoapps/certificates/tests/test_cert_management.py b/lms/djangoapps/certificates/tests/test_cert_management.py index e9df7d7420..1a119d75bd 100644 --- a/lms/djangoapps/certificates/tests/test_cert_management.py +++ b/lms/djangoapps/certificates/tests/test_cert_management.py @@ -65,7 +65,7 @@ class CertificateManagementTest(ModuleStoreTestCase): self.assertEqual(cert.status, expected_status) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class ResubmitErrorCertificatesTest(CertificateManagementTest): """Tests for the resubmit_error_certificates management command. """ @@ -153,7 +153,7 @@ class ResubmitErrorCertificatesTest(CertificateManagementTest): @ddt.ddt -@attr('shard_1') +@attr(shard=1) class RegenerateCertificatesTest(CertificateManagementTest): """ Tests for regenerating certificates. @@ -222,7 +222,7 @@ class RegenerateCertificatesTest(CertificateManagementTest): self.assertFalse(mock_send_to_queue.called) -@attr('shard_1') +@attr(shard=1) class UngenerateCertificatesTest(CertificateManagementTest): """ Tests for generating certificates. diff --git a/lms/djangoapps/certificates/tests/test_create_fake_cert.py b/lms/djangoapps/certificates/tests/test_create_fake_cert.py index a35715e254..860447ff07 100644 --- a/lms/djangoapps/certificates/tests/test_create_fake_cert.py +++ b/lms/djangoapps/certificates/tests/test_create_fake_cert.py @@ -9,7 +9,7 @@ from certificates.management.commands import create_fake_cert from certificates.models import GeneratedCertificate -@attr('shard_1') +@attr(shard=1) class CreateFakeCertTest(TestCase): """Tests for the create_fake_certs management command. """ diff --git a/lms/djangoapps/certificates/tests/test_models.py b/lms/djangoapps/certificates/tests/test_models.py index 9aad0b6771..0c572478bb 100644 --- a/lms/djangoapps/certificates/tests/test_models.py +++ b/lms/djangoapps/certificates/tests/test_models.py @@ -40,7 +40,7 @@ PLATFORM_ROOT = TEST_DIR.parent.parent.parent.parent TEST_DATA_ROOT = PLATFORM_ROOT / TEST_DATA_DIR -@attr('shard_1') +@attr(shard=1) class ExampleCertificateTest(TestCase): """Tests for the ExampleCertificate model. """ @@ -106,7 +106,7 @@ class ExampleCertificateTest(TestCase): self.assertIs(result, None) -@attr('shard_1') +@attr(shard=1) class CertificateHtmlViewConfigurationTest(TestCase): """ Test the CertificateHtmlViewConfiguration model. @@ -173,7 +173,7 @@ class CertificateHtmlViewConfigurationTest(TestCase): self.assertEquals(self.config.get_config(), {}) -@attr('shard_1') +@attr(shard=1) class CertificateTemplateAssetTest(TestCase): """ Test Assets are uploading/saving successfully for CertificateTemplateAsset. @@ -201,7 +201,7 @@ class CertificateTemplateAssetTest(TestCase): self.assertEqual(certificate_template_asset.asset, 'certificate_template_assets/1/picture2.jpg') -@attr('shard_1') +@attr(shard=1) class EligibleCertificateManagerTest(SharedModuleStoreTestCase): """ Test the GeneratedCertificate model's object manager for filtering @@ -240,7 +240,7 @@ class EligibleCertificateManagerTest(SharedModuleStoreTestCase): ) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class TestCertificateGenerationHistory(TestCase): """ @@ -306,7 +306,7 @@ class TestCertificateGenerationHistory(TestCase): ) -@attr('shard_1') +@attr(shard=1) class CertificateInvalidationTest(SharedModuleStoreTestCase): """ Test for the Certificate Invalidation model. diff --git a/lms/djangoapps/certificates/tests/test_queue.py b/lms/djangoapps/certificates/tests/test_queue.py index 8597ca2845..0b21f652cd 100644 --- a/lms/djangoapps/certificates/tests/test_queue.py +++ b/lms/djangoapps/certificates/tests/test_queue.py @@ -39,7 +39,7 @@ from lms.djangoapps.verify_student.tests.factories import SoftwareSecurePhotoVer @ddt.ddt -@attr('shard_1') +@attr(shard=1) @override_settings(CERT_QUEUE='certificates') class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): """Test the "add to queue" operation of the XQueue interface. """ @@ -283,7 +283,7 @@ class XQueueCertInterfaceAddCertificateTest(ModuleStoreTestCase): ) -@attr('shard_1') +@attr(shard=1) @override_settings(CERT_QUEUE='certificates') class XQueueCertInterfaceExampleCertificateTest(TestCase): """Tests for the XQueue interface for certificate generation. """ diff --git a/lms/djangoapps/certificates/tests/test_views.py b/lms/djangoapps/certificates/tests/test_views.py index b4f0c9b2e4..6ccab264ae 100644 --- a/lms/djangoapps/certificates/tests/test_views.py +++ b/lms/djangoapps/certificates/tests/test_views.py @@ -36,7 +36,7 @@ FEATURES_WITH_CUSTOM_CERTS_ENABLED = { FEATURES_WITH_CUSTOM_CERTS_ENABLED.update(FEATURES_WITH_CERTS_ENABLED) -@attr('shard_1') +@attr(shard=1) @ddt.ddt class UpdateExampleCertificateViewTest(CacheIsolationTestCase): """Tests for the XQueue callback that updates example certificates. """ @@ -180,7 +180,7 @@ class UpdateExampleCertificateViewTest(CacheIsolationTestCase): self.assertEqual(content['return_code'], 0) -@attr('shard_1') +@attr(shard=1) class MicrositeCertificatesViewsTests(ModuleStoreTestCase): """ Tests for the microsite certificates web/html views diff --git a/lms/djangoapps/certificates/tests/test_webview_views.py b/lms/djangoapps/certificates/tests/test_webview_views.py index de9e061872..86b2356b7a 100644 --- a/lms/djangoapps/certificates/tests/test_webview_views.py +++ b/lms/djangoapps/certificates/tests/test_webview_views.py @@ -171,7 +171,7 @@ class CommonCertificatesTestCase(ModuleStoreTestCase): template.save() -@attr('shard_1') +@attr(shard=1) @ddt.ddt class CertificatesViewsTests(CommonCertificatesTestCase): """ @@ -1145,7 +1145,7 @@ class CertificatesViewsTests(CommonCertificatesTestCase): ) -@attr('shard_1') +@attr(shard=1) class CertificateEventTests(CommonCertificatesTestCase, EventTrackingTestCase): """ Test events emitted by certificate handling. diff --git a/lms/djangoapps/certificates/tests/tests.py b/lms/djangoapps/certificates/tests/tests.py index 6a813d5a96..cb65f8140e 100644 --- a/lms/djangoapps/certificates/tests/tests.py +++ b/lms/djangoapps/certificates/tests/tests.py @@ -26,7 +26,7 @@ from util.milestones_helpers import ( from milestones.tests.utils import MilestonesTestCaseMixin -@attr('shard_1') +@attr(shard=1) @ddt class CertificatesModelTest(ModuleStoreTestCase, MilestonesTestCaseMixin): """ diff --git a/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py b/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py index d968984e14..616c4aa600 100644 --- a/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py +++ b/lms/djangoapps/class_dashboard/tests/test_dashboard_data.py @@ -27,7 +27,7 @@ from class_dashboard.views import has_instructor_access_for_class USER_COUNT = 11 -@attr('shard_1') +@attr(shard=1) class TestGetProblemGradeDistribution(SharedModuleStoreTestCase): """ Tests related to class_dashboard/dashboard_data.py diff --git a/lms/djangoapps/class_dashboard/tests/test_views.py b/lms/djangoapps/class_dashboard/tests/test_views.py index 209ecb136a..adf5ff6b07 100644 --- a/lms/djangoapps/class_dashboard/tests/test_views.py +++ b/lms/djangoapps/class_dashboard/tests/test_views.py @@ -13,7 +13,7 @@ from class_dashboard import views from student.tests.factories import AdminFactory -@attr('shard_1') +@attr(shard=1) class TestViews(ModuleStoreTestCase): """ Tests related to class_dashboard/views.py diff --git a/lms/djangoapps/commerce/api/v0/tests/test_views.py b/lms/djangoapps/commerce/api/v0/tests/test_views.py index 2ec8039dda..b17bfdc4be 100644 --- a/lms/djangoapps/commerce/api/v0/tests/test_views.py +++ b/lms/djangoapps/commerce/api/v0/tests/test_views.py @@ -30,7 +30,7 @@ from student.tests.tests import EnrollmentEventTestMixin from xmodule.modulestore.django import modulestore -@attr('shard_1') +@attr(shard=1) @ddt.ddt @override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY) class BasketsViewTests(EnrollmentEventTestMixin, UserMixin, ModuleStoreTestCase): @@ -362,7 +362,7 @@ class BasketsViewTests(EnrollmentEventTestMixin, UserMixin, ModuleStoreTestCase) self.assertEqual(self._post_to_view().status_code, 406) -@attr('shard_1') +@attr(shard=1) @override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY) class BasketOrderViewTests(UserMixin, TestCase): """ Tests for the basket order view. """ diff --git a/lms/djangoapps/commerce/api/v1/tests/test_views.py b/lms/djangoapps/commerce/api/v1/tests/test_views.py index 41efd05595..ca6c4d31dd 100644 --- a/lms/djangoapps/commerce/api/v1/tests/test_views.py +++ b/lms/djangoapps/commerce/api/v1/tests/test_views.py @@ -104,7 +104,7 @@ class CourseListViewTests(CourseApiViewTestMixin, ModuleStoreTestCase): self.assertListEqual(actual, expected) -@attr('shard_3') +@attr(shard=3) @ddt.ddt class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase): """ Tests for CourseRetrieveUpdateView. """ @@ -390,7 +390,7 @@ class CourseRetrieveUpdateViewTests(CourseApiViewTestMixin, ModuleStoreTestCase) self.assertDictEqual(expected_dict, json.loads(response.content)) -@attr('shard_1') +@attr(shard=1) @override_settings(ECOMMERCE_API_URL=TEST_API_URL, ECOMMERCE_API_SIGNING_KEY=TEST_API_SIGNING_KEY) class OrderViewTests(UserMixin, TestCase): """ Tests for the basket order view. """ diff --git a/lms/djangoapps/commerce/tests/test_views.py b/lms/djangoapps/commerce/tests/test_views.py index 50ab358d89..2c8e90c786 100644 --- a/lms/djangoapps/commerce/tests/test_views.py +++ b/lms/djangoapps/commerce/tests/test_views.py @@ -23,7 +23,7 @@ class UserMixin(object): self.client.login(username=self.user.username, password='test') -@attr('shard_1') +@attr(shard=1) @ddt.ddt class ReceiptViewTests(UserMixin, TestCase): """ Tests for the receipt view. """ diff --git a/lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py b/lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py index 92c0e81fe5..5e1fd4e960 100644 --- a/lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py +++ b/lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py @@ -16,7 +16,7 @@ from ..milestones import MilestonesTransformer from ...api import get_course_blocks -@attr('shard_3') +@attr(shard=3) @ddt.ddt @patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True, 'MILESTONES_APP': True}) class MilestonesTransformerTestCase(CourseStructureTestCase, MilestonesTestCaseMixin): diff --git a/lms/djangoapps/course_api/tests/test_serializers.py b/lms/djangoapps/course_api/tests/test_serializers.py index 5b14ac21b8..96bee1f644 100644 --- a/lms/djangoapps/course_api/tests/test_serializers.py +++ b/lms/djangoapps/course_api/tests/test_serializers.py @@ -21,7 +21,7 @@ from ..serializers import CourseSerializer, CourseDetailSerializer from .mixins import CourseApiFactoryMixin -@attr('shard_3') +@attr(shard=3) @ddt.ddt class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase): """ diff --git a/lms/djangoapps/course_api/tests/test_views.py b/lms/djangoapps/course_api/tests/test_views.py index 104e8f1713..bb88688349 100644 --- a/lms/djangoapps/course_api/tests/test_views.py +++ b/lms/djangoapps/course_api/tests/test_views.py @@ -47,7 +47,7 @@ class CourseApiTestViewMixin(CourseApiFactoryMixin): return response -@attr('shard_3') +@attr(shard=3) class CourseListViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase): """ Test responses returned from CourseListView. diff --git a/lms/djangoapps/course_blocks/transformers/tests/test_hidden_content.py b/lms/djangoapps/course_blocks/transformers/tests/test_hidden_content.py index 480480e94f..4424133bca 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/test_hidden_content.py +++ b/lms/djangoapps/course_blocks/transformers/tests/test_hidden_content.py @@ -10,7 +10,7 @@ from ..hidden_content import HiddenContentTransformer from .helpers import BlockParentsMapTestCase, update_block -@attr('shard_3') +@attr(shard=3) @ddt.ddt class HiddenContentTransformerTestCase(BlockParentsMapTestCase): """ diff --git a/lms/djangoapps/course_blocks/transformers/tests/test_split_test.py b/lms/djangoapps/course_blocks/transformers/tests/test_split_test.py index 27fe36748f..f5110868f5 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/test_split_test.py +++ b/lms/djangoapps/course_blocks/transformers/tests/test_split_test.py @@ -15,7 +15,7 @@ from ..user_partitions import UserPartitionTransformer, _get_user_partition_grou from .helpers import CourseStructureTestCase, create_location -@attr('shard_3') +@attr(shard=3) @ddt.ddt class SplitTestTransformerTestCase(CourseStructureTestCase): """ diff --git a/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py b/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py index 3f823912ee..bbe4ae0725 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py +++ b/lms/djangoapps/course_blocks/transformers/tests/test_start_date.py @@ -12,7 +12,7 @@ from ..start_date import StartDateTransformer, DEFAULT_START_DATE from .helpers import BlockParentsMapTestCase, update_block -@attr('shard_3') +@attr(shard=3) @ddt.ddt class StartDateTransformerTestCase(BlockParentsMapTestCase): """ diff --git a/lms/djangoapps/course_blocks/transformers/tests/test_user_partitions.py b/lms/djangoapps/course_blocks/transformers/tests/test_user_partitions.py index 511b8f7016..2d51078a3b 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/test_user_partitions.py +++ b/lms/djangoapps/course_blocks/transformers/tests/test_user_partitions.py @@ -68,7 +68,7 @@ class UserPartitionTestMixin(object): self.partition_cohorts.append(partition_cohorts) -@attr('shard_3') +@attr(shard=3) @ddt.ddt class UserPartitionTransformerTestCase(UserPartitionTestMixin, CourseStructureTestCase): """ @@ -241,7 +241,7 @@ class UserPartitionTransformerTestCase(UserPartitionTestMixin, CourseStructureTe ) -@attr('shard_3') +@attr(shard=3) @ddt.ddt class MergedGroupAccessTestData(UserPartitionTestMixin, CourseStructureTestCase): """ diff --git a/lms/djangoapps/course_blocks/transformers/tests/test_visibility.py b/lms/djangoapps/course_blocks/transformers/tests/test_visibility.py index 8aa6d8c7e2..9bc1d01c9e 100644 --- a/lms/djangoapps/course_blocks/transformers/tests/test_visibility.py +++ b/lms/djangoapps/course_blocks/transformers/tests/test_visibility.py @@ -8,7 +8,7 @@ from ..visibility import VisibilityTransformer from .helpers import BlockParentsMapTestCase, update_block -@attr('shard_3') +@attr(shard=3) @ddt.ddt class VisibilityTransformerTestCase(BlockParentsMapTestCase): """ diff --git a/lms/djangoapps/course_wiki/tests/test_access.py b/lms/djangoapps/course_wiki/tests/test_access.py index df2fbaae55..7c0be1bf36 100644 --- a/lms/djangoapps/course_wiki/tests/test_access.py +++ b/lms/djangoapps/course_wiki/tests/test_access.py @@ -52,7 +52,7 @@ class TestWikiAccessBase(ModuleStoreTestCase): ] -@attr('shard_1') +@attr(shard=1) class TestWikiAccess(TestWikiAccessBase): """Test wiki access for course staff.""" def setUp(self): @@ -113,7 +113,7 @@ class TestWikiAccess(TestWikiAccessBase): self.assertFalse(user_is_article_course_staff(course_staff, self.wiki_310b.article)) -@attr('shard_1') +@attr(shard=1) class TestWikiAccessForStudent(TestWikiAccessBase): """Test access for students.""" def setUp(self): @@ -129,7 +129,7 @@ class TestWikiAccessForStudent(TestWikiAccessBase): self.assertFalse(user_is_article_course_staff(self.student, page.article)) -@attr('shard_1') +@attr(shard=1) class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase): """Test staff has access if course number is numerical and wiki slug has an underscore appended.""" def setUp(self): @@ -149,7 +149,7 @@ class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase): self.assertTrue(user_is_article_course_staff(course_staff, page.article)) -@attr('shard_1') +@attr(shard=1) class TestWikiAccessForOldFormatCourseStaffGroups(TestWikiAccessBase): """Test staff has access if course group has old format.""" def setUp(self): diff --git a/lms/djangoapps/course_wiki/tests/test_comprehensive_theming.py b/lms/djangoapps/course_wiki/tests/test_comprehensive_theming.py index 375415b252..ecd677b805 100644 --- a/lms/djangoapps/course_wiki/tests/test_comprehensive_theming.py +++ b/lms/djangoapps/course_wiki/tests/test_comprehensive_theming.py @@ -14,7 +14,7 @@ from courseware.tests.factories import InstructorFactory from course_wiki.views import get_or_create_root -@attr('shard_1') +@attr(shard=1) class TestComprehensiveTheming(ModuleStoreTestCase): """Tests for comprehensive theming of wiki pages.""" diff --git a/lms/djangoapps/course_wiki/tests/test_middleware.py b/lms/djangoapps/course_wiki/tests/test_middleware.py index 494b0c4ff2..23fd4e830f 100644 --- a/lms/djangoapps/course_wiki/tests/test_middleware.py +++ b/lms/djangoapps/course_wiki/tests/test_middleware.py @@ -13,7 +13,7 @@ from courseware.tests.factories import InstructorFactory from course_wiki.views import get_or_create_root -@attr('shard_1') +@attr(shard=1) class TestWikiAccessMiddleware(ModuleStoreTestCase): """Tests for WikiAccessMiddleware.""" diff --git a/lms/djangoapps/course_wiki/tests/tests.py b/lms/djangoapps/course_wiki/tests/tests.py index 387d964f83..f6dbaa6a2f 100644 --- a/lms/djangoapps/course_wiki/tests/tests.py +++ b/lms/djangoapps/course_wiki/tests/tests.py @@ -8,7 +8,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from mock import patch -@attr('shard_1') +@attr(shard=1) class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): """ Tests for wiki course redirection. diff --git a/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py b/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py index bf4dc2bc6b..40af376df2 100644 --- a/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py +++ b/lms/djangoapps/courseware/management/commands/tests/test_dump_course.py @@ -27,7 +27,7 @@ DATA_DIR = settings.COMMON_TEST_DATA_ROOT XML_COURSE_DIRS = ['simple'] -@attr('shard_1') +@attr(shard=1) class CommandsTestBase(SharedModuleStoreTestCase): """ Base class for testing different django commands. diff --git a/lms/djangoapps/courseware/tests/test_about.py b/lms/djangoapps/courseware/tests/test_about.py index d2b6e26ae3..0b733ad20e 100644 --- a/lms/djangoapps/courseware/tests/test_about.py +++ b/lms/djangoapps/courseware/tests/test_about.py @@ -41,7 +41,7 @@ REG_STR = "