refactor: lift shared test settings up to common module#37714
refactor: lift shared test settings up to common module#37714wgu-taylor-payne merged 1 commit intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @wgu-taylor-payne! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
1 similar comment
|
Thanks for the pull request, @wgu-taylor-payne! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
|
Thanks @wgu-taylor-payne ! @feanil , I'm swamped with Ulmo stuff right now, do you have cycles to review this one? |
f1b21e2 to
df2611b
Compare
|
Yes, happy to take a look at this, @wgu-taylor-payne I see it's still in draft, is it ready for review? |
|
@feanil Thanks for being willing to look this over. I'm still working to get the checks passing and then I'll mark it as ready. |
df2611b to
cb1a1cf
Compare
|
|
1a4f8c8 to
cb1a1cf
Compare
| for theme_dir in COMPREHENSIVE_THEME_DIRS: # pylint: disable=not-an-iterable | ||
| preview_template['DIRS'].insert(0, theme_dir) |
There was a problem hiding this comment.
This is to match the mutation to the LMS version of MAKO_TEMPLATE_DIRS_BASE that used to happen here.
As a side note, I'm not sure if mutating MAKO_TEMPLATE_DIRS_BASE in that function was intentional or an oversight.
There was a problem hiding this comment.
Yea, I tried to see if it was being used anywhere directly and I didn't see MAKO_TEMPLATE_DIRS_BASE mentioned directly either. Given that the tasts are passing, I think it's fine to make the test modifications without updating that settings value.
There was a problem hiding this comment.
Are you saying that keep this as is, since the tests are passing, or remove these lines and see if the tests pass without them?
There was a problem hiding this comment.
Sorry for the lack of clarity, I think you can keep this as is since the tests are passing.
|
@feanil This is ready to look over when you get the chance. Thanks! |
feanil
left a comment
There was a problem hiding this comment.
Did a first pass, mostly minor improvements to reduce duplication further and some documentation improvements.
| for theme_dir in COMPREHENSIVE_THEME_DIRS: # pylint: disable=not-an-iterable | ||
| preview_template['DIRS'].insert(0, theme_dir) |
There was a problem hiding this comment.
Yea, I tried to see if it was being used anywhere directly and I didn't see MAKO_TEMPLATE_DIRS_BASE mentioned directly either. Given that the tasts are passing, I think it's fine to make the test modifications without updating that settings value.
|
@feanil I've made some changes and responded to your comments. Ready for another look. |
feanil
left a comment
There was a problem hiding this comment.
@wgu-taylor-payne I'm good with you merging this as is, or you can add one more comment, feel free to merge when you're ready, I don't need to review it again.
| for theme_dir in COMPREHENSIVE_THEME_DIRS: # pylint: disable=not-an-iterable | ||
| preview_template['DIRS'].insert(0, theme_dir) |
There was a problem hiding this comment.
Sorry for the lack of clarity, I think you can keep this as is since the tests are passing.
| REGISTRATION_EXTRA_FIELDS.pop("marketing_emails_opt_in", None) | ||
|
|
||
| # Course Live | ||
| COURSE_LIVE_GLOBAL_CREDENTIALS["BIG_BLUE_BUTTON"] = big_blue_button_credentials |
There was a problem hiding this comment.
I think we can consider that in the future, but it feels too complicated and we can just leave this as is for now. It was initially hard for me to grok that the openedx/envs/test.py file doesn't have access to the two common.py files when it is being read, now that I understand that this makes a lot of sense.
Suggestion: add a comment to explain the above fact neard the definition of the big_blue_button_credentials variable in the test file?
8a3f39e to
f31306e
Compare
Description
Fixes #37348.
Extract common test setting values into a new shared module,
openedx/envs/test.py. This prevents duplication and also allows us to remove thecms/envs/test.pydependency onlms/envs/test.py.Supporting information
Part of effort to simplify settings. See ADR 0022 - Simplify Django Settings.
Testing instructions
Run the
dump_settingsmanagement command on the different terminal settings modules, given differentymlconfig files and compare the diff on the rendered settings betweenmasterandtpayne/add-common-test-module. To simplify this, I used the script diff_settings.py and also table_diff.py to simplify the diff output. I've added the output of these scripts in this gist.There are two differences in the rendered
cms/envs/test.pysettings that I thought were tolerable:PROCTORING_USER_OBFUSCATION_KEY- This was previously declared twice incms/envs/test.py. It didn't seem that anything directly depends on this key having a specific value. This change aligns the value withlms/envs/test.py.VERIFY_STUDENT- With the introduction ofopenedx/envs/common.py, whenlms/envs/test.pywould alter this value, it would also alter the value forcms/envs/test.py, since they are pointing to the same mutable object. Now, since we do not import, and thus not executelms/envs/test.py, this value is no longer mutated.Deadline
None