openedx / edx-platform

The Open edX LMS & Studio, powering education sites around the world!
https://openedx.org
GNU Affero General Public License v3.0
7.43k stars 3.88k forks source link

Fix these tests, which fail in both Tutor and Devstack #32353

Closed kdmccormick closed 4 months ago

kdmccormick commented 1 year ago

Background

From the result of https://github.com/openedx/wg-developer-experience/issues/36, 12 tests fail in both Devstack and Tutor. The tests are listed below, and the full requests are in this spreadsheet.

Let's get those tests passing in Tutor.

Tasks

Fix the following tests so that they pass in Tutor when run using Tutor's test-running instructions:

Notes

n/a

devkhan commented 4 months ago

The tests seem to be passing now. Here are the logs when running these specific tests:

export EDXAPP_TEST_MONGO_HOST=mongodb
pytest --ds=lms.envs.test \
lms/djangoapps/discussion/rest_api/tests/test_api.py::CourseTopicsV2Test::test_default_response lms/djangoapps/discussion/rest_api/tests/test_api.py::CourseTopicsV2Test::test_filtering lms/djangoapps/discussion/rest_api/tests/test_api.py::CourseTopicsV2Test::test_other_providers_ordering_error lms/djangoapps/discussion/rest_api/tests/test_api.py::CourseTopicsV2Test::test_sort_by_activity lms/djangoapps/discussion/rest_api/tests/test_api.py::CourseTopicsV2Test::test_sort_by_name lms/djangoapps/discussion/rest_api/tests/test_api.py::CourseTopicsV2Test::test_sort_by_structure lms/djangoapps/discussion/rest_api/tests/test_views.py::CourseTopicsViewTest::test_new_course_structure_response lms/djangoapps/discussion/rest_api/tests/test_views.py::CourseTopicsViewV3Test::test_basic lms/djangoapps/discussion/rest_api/tests/test_views.py::CourseTopicsViewV3Test::test_inactive lms/djangoapps/discussion/rest_api/tests/test_views.py::CourseTopicsViewV3Test::test_not_authenticated openedx/core/djangoapps/content_libraries/tests/test_runtime.py::ContentLibraryXBlockUserStateTest::test_i18n openedx/core/djangoapps/content_libraries/tests/test_runtime.py::ContentLibraryXBlockUserStateTest::test_state_for_anonymous_users

============================================================================= test session starts ==============================================================================
platform linux -- Python 3.11.8, pytest-8.2.0, pluggy-1.5.0
Using --randomly-seed=2537639032
django: version: 4.2.13, settings: lms.envs.test (from option)
rootdir: /openedx/edx-platform
configfile: setup.cfg
plugins: Faker-25.0.1, json-report-1.5.0, randomly-3.15.0, xdist-3.6.1, anyio-4.3.0, django-4.8.0, metadata-1.8.0, cov-5.0.0, attrib-0.1.3
collected 10 items

=============================================================================== warnings summary ===============================================================================
../venv/lib/python3.11/site-packages/webob/compat.py:5
  /openedx/venv/lib/python3.11/site-packages/webob/compat.py:5: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    from cgi import parse_header

../venv/lib/python3.11/site-packages/django/conf/__init__.py:267
  /openedx/venv/lib/python3.11/site-packages/django/conf/__init__.py:267: RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale.
    warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)

../venv/lib/python3.11/site-packages/django/conf/__init__.py:278
  /openedx/venv/lib/python3.11/site-packages/django/conf/__init__.py:278: RemovedInDjango51Warning: The DEFAULT_FILE_STORAGE setting is deprecated. Use STORAGES instead.
    warnings.warn(DEFAULT_FILE_STORAGE_DEPRECATED_MSG, RemovedInDjango51Warning)

../venv/lib/python3.11/site-packages/django/conf/__init__.py:289
  /openedx/venv/lib/python3.11/site-packages/django/conf/__init__.py:289: RemovedInDjango51Warning: The STATICFILES_STORAGE setting is deprecated. Use STORAGES instead.
    warnings.warn(STATICFILES_STORAGE_DEPRECATED_MSG, RemovedInDjango51Warning)

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'djpyfs.FSExpirations' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'coursewarehistoryextended.StudentModuleHistoryExtended' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'completion.BlockCompletion' instead.
    warnings.warn(

openedx/core/storage.py:114
  /openedx/edx-platform/openedx/core/storage.py:114: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.
    return get_storage_class(storage_class)(**kwargs)

../venv/lib/python3.11/site-packages/pgpy/constants.py:5
  /openedx/venv/lib/python3.11/site-packages/pgpy/constants.py:5: DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13
    import imghdr

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'celery_utils.FailedTask' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'grades.PersistentSubsectionGrade' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'grades.PersistentCourseGrade' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/user_tasks/conf.py:40
  /openedx/venv/lib/python3.11/site-packages/user_tasks/conf.py:40: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.
    return get_storage_class(import_path)()

../venv/lib/python3.11/site-packages/blockstore/apps/bundles/storage.py:146
  /openedx/venv/lib/python3.11/site-packages/blockstore/apps/bundles/storage.py:146: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.
    self.asset_backend = get_storage_class(storage_class)(**storage_kwargs)

../venv/lib/python3.11/site-packages/blockstore/apps/bundles/storage.py:87
  /openedx/venv/lib/python3.11/site-packages/blockstore/apps/bundles/storage.py:87: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.
    S3Boto3Storage = get_storage_class("storages.backends.s3boto3.S3Boto3Storage")

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'experiments.ExperimentData' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/edxval/utils.py:158
  /openedx/venv/lib/python3.11/site-packages/edxval/utils.py:158: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.
    return get_storage_class(

../venv/lib/python3.11/site-packages/edxval/utils.py:183
  /openedx/venv/lib/python3.11/site-packages/edxval/utils.py:183: RemovedInDjango51Warning: django.core.files.storage.get_storage_class is deprecated in favor of using django.core.files.storage.storages.
    return get_storage_class(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'learning_sequences.CourseSection' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/integrated_channels/utils.py:28
  /openedx/venv/lib/python3.11/site-packages/integrated_channels/utils.py:28: RemovedInDjango50Warning: The django.utils.timezone.utc alias is deprecated. Please update your code to use datetime.timezone.utc instead.
    UNIX_EPOCH = datetime(1970, 1, 1, tzinfo=timezone.utc)

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'integrated_channel.ContentMetadataItemTransmission' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'integrated_channel.OrphanedContentTransmissions' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'degreed.DegreedLearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'degreed2.Degreed2LearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'sap_success_factors.SapSuccessFactorsLearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'cornerstone.CornerstoneLearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'xapi.XAPILearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'blackboard.BlackboardLearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'canvas.CanvasLearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/django/db/models/options.py:210
  /openedx/venv/lib/python3.11/site-packages/django/db/models/options.py:210: RemovedInDjango51Warning: 'index_together' is deprecated. Use 'Meta.indexes' in 'moodle.MoodleLearnerDataTransmissionAudit' instead.
    warnings.warn(

../venv/lib/python3.11/site-packages/httpretty/core.py:176
  /openedx/venv/lib/python3.11/site-packages/httpretty/core.py:176: DeprecationWarning: 'urllib3.contrib.pyopenssl' module is deprecated and will be removed in a future release of urllib3 2.x. Read more in this issue: https://github.com/urllib3/urllib3/issues/2680
    from requests.packages.urllib3.contrib.pyopenssl import inject_into_urllib3, extract_from_urllib3

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================= 31 warnings in 3.88s =============================================================================
devkhan commented 4 months ago

Can be closed now.