Create a 3rd explicit shard for unit tests.

More accurately, this creates a 4th shard because the
last shard is always the default.
This commit is contained in:
Ben Patterson
2016-04-26 15:24:50 -04:00
committed by Clinton Blackburn
parent afc5b47ebe
commit d76f50d93b
41 changed files with 98 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
Test for LMS instructor background task queue management
"""
from mock import patch, Mock, MagicMock
from nose.plugins.attrib import attr
from bulk_email.models import CourseEmail, SEND_TO_ALL
from courseware.tests.factories import UserFactory
from xmodule.modulestore.exceptions import ItemNotFoundError
@@ -82,6 +83,7 @@ class InstructorTaskReportTest(InstructorTaskTestCase):
self.assertEquals(set(task_ids), set())
@attr('shard_3')
class InstructorTaskModuleSubmitTest(InstructorTaskModuleTestCase):
"""Tests API methods that involve the submission of module-based background tasks."""
@@ -172,6 +174,7 @@ class InstructorTaskModuleSubmitTest(InstructorTaskModuleTestCase):
self._test_submit_task(submit_delete_problem_state_for_all_students)
@attr('shard_3')
@patch('bulk_email.models.html_to_text', Mock(return_value='Mocking CourseEmail.text_message', autospec=True))
class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCase):
"""Tests API methods that involve the submission of course-based background tasks."""

View File

@@ -8,6 +8,7 @@ paths actually work.
import json
import logging
from mock import patch
from nose.plugins.attrib import attr
import textwrap
from celery.states import SUCCESS, FAILURE
@@ -63,6 +64,7 @@ class TestIntegrationTask(InstructorTaskModuleTestCase):
self.assertEqual(status['message'], expected_message)
@attr('shard_3')
class TestRescoringTask(TestIntegrationTask):
"""
Integration-style tests for rescoring problems in a background task.

View File

@@ -9,6 +9,7 @@ import json
from uuid import uuid4
from mock import Mock, MagicMock, patch
from nose.plugins.attrib import attr
from celery.states import SUCCESS, FAILURE
from django.utils.translation import ugettext_noop
@@ -213,6 +214,7 @@ class TestInstructorTasks(InstructorTaskModuleTestCase):
self.assertEquals(output['traceback'][-3:], "...")
@attr('shard_3')
class TestRescoreInstructorTask(TestInstructorTasks):
"""Tests problem-rescoring instructor task."""
@@ -315,6 +317,7 @@ class TestRescoreInstructorTask(TestInstructorTasks):
self.assertGreater(output.get('duration_ms'), 0)
@attr('shard_3')
class TestResetAttemptsInstructorTask(TestInstructorTasks):
"""Tests instructor task that resets problem attempts."""
@@ -413,6 +416,7 @@ class TestResetAttemptsInstructorTask(TestInstructorTasks):
self._test_reset_with_student(True)
@attr('shard_3')
class TestDeleteStateInstructorTask(TestInstructorTasks):
"""Tests instructor task that deletes problem state."""

View File

@@ -16,6 +16,7 @@ import urllib
import ddt
from freezegun import freeze_time
from mock import Mock, patch
from nose.plugins.attrib import attr
import tempfile
from openedx.core.djangoapps.course_groups import cohorts
import unicodecsv
@@ -666,6 +667,7 @@ class TestProblemGradeReport(TestReportMixin, InstructorTaskModuleTestCase):
])
@attr('shard_3')
class TestProblemReportSplitTestContent(TestReportMixin, TestConditionalContent, InstructorTaskModuleTestCase):
"""
Test the problem report on a course that has split tests.
@@ -1674,6 +1676,7 @@ class TestGradeReportEnrollmentAndCertificateInfo(TestReportMixin, InstructorTas
self._verify_csv_data(user.username, expected_output)
@attr('shard_3')
@ddt.ddt
@override_settings(CERT_QUEUE='test-queue')
class TestCertificateGeneration(InstructorTaskModuleTestCase):