Skip to content

refactor: move shared test settings out of feedback package#46

Merged
farhan merged 4 commits into
openedx:mainfrom
irfanuddinahmad:fix/move-shared-test-settings
Jun 10, 2026
Merged

refactor: move shared test settings out of feedback package#46
farhan merged 4 commits into
openedx:mainfrom
irfanuddinahmad:fix/move-shared-test-settings

Conversation

@irfanuddinahmad

Copy link
Copy Markdown
Contributor

Summary

  • Moves src/feedback/settings/test.pytests/settings.py at the repo root
  • Creates tests/__init__.py to make it a proper package
  • Updates DJANGO_SETTINGS_MODULE in pyproject.toml from feedback.settings.testtests.settings

The settings file listed both feedback and freetextresponse in INSTALLED_APPS, making it clearly repo-wide. Having it inside a single XBlock package was misleading and will only grow more confusing as more XBlocks are added.

Closes #40

Test plan

  • Run make test — full test suite should pass with the new settings path
  • Confirm tests/settings.py is the only Django test settings file (no stale copy in feedback/)
  • Verify CI passes

🤖 Generated with Claude Code

Moves the repo-wide Django test settings from
`src/feedback/settings/test.py` to a top-level `tests/settings.py` so
it is no longer misleadingly tied to a single XBlock. Updates the
`DJANGO_SETTINGS_MODULE` reference in `pyproject.toml` accordingly.

Closes openedx#40

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jun 5, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @irfanuddinahmad!

This repository is currently maintained by @openedx/axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

pytest-django needs to import DJANGO_SETTINGS_MODULE as a Python module.
Adding pythonpath = ["."] makes the top-level tests/ package resolvable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.17%. Comparing base (43787fc) to head (ab9566b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
- Coverage   82.24%   82.17%   -0.08%     
==========================================
  Files          49       48       -1     
  Lines        1425     1419       -6     
  Branches      110      110              
==========================================
- Hits         1172     1166       -6     
  Misses        221      221              
  Partials       32       32              
Flag Coverage Δ
unittests 82.17% <ø> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Codecov's default project check has zero tolerance for any coverage drop.
This refactor removes src/feedback/settings/test.py from the measured
source (it moved to tests/settings.py outside src/), causing a small
coverage decrease. The 1% threshold accommodates this without relaxing
the patch check (new code must still be fully covered).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the repository’s Django test configuration so the test settings module is clearly repo-wide (not tied to a specific XBlock package), aligning with the intent described in Issue #40.

Changes:

  • Updates shared Django test settings documentation in tests/settings.py to reflect repo-wide usage.
  • Makes tests/ a Python package and points pytest-django to tests.settings via pyproject.toml (including ensuring the repo root is on sys.path during pytest runs).
  • Adds a minimal codecov.yml to configure Codecov status thresholds.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/settings.py Updates the module docstring to clarify these are shared, repo-wide Django test settings.
tests/__init__.py Adds tests package marker to support importing tests.settings.
pyproject.toml Updates pytest configuration to use DJANGO_SETTINGS_MODULE = "tests.settings" and adds pythonpath = ["."].
codecov.yml Introduces Codecov coverage status thresholds for project and patch reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@farhan farhan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 suggestion, rest all seems good.

Comment thread src/tests/settings.py
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready to Merge in Contributions Jun 5, 2026
@mphilbrick211 mphilbrick211 moved this from Ready to Merge to In Eng Review in Contributions Jun 5, 2026
Moves tests/settings.py into src/ alongside all other source code,
and updates pythonpath + testpaths in pyproject.toml accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan farhan merged commit 990f2e7 into openedx:main Jun 10, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Move shared Django test settings out of the feedback/freetextresponse package

5 participants