-
Notifications
You must be signed in to change notification settings - Fork 32
♻️ Maintenance: Unify ApplicationSettings Testing Across Services and Prepare for External Env File Support
#7919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ Maintenance: Unify ApplicationSettings Testing Across Services and Prepare for External Env File Support
#7919
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7919 +/- ##
==========================================
+ Coverage 88.04% 88.05% +0.01%
==========================================
Files 1846 1839 -7
Lines 71225 71035 -190
Branches 1220 1220
==========================================
- Hits 62707 62553 -154
+ Misses 8166 8130 -36
Partials 352 352
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
94d77b8 to
b04258d
Compare
ApplicationSettings Testing Across Services and Prepare for External Env File Support
|
@mergify queue |
🟠 Waiting for conditions to match
|
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a very DANGEROUS feature and I would like to be sure that it is clear with every dev that this can affect the deployments depending on what test(s) are being run. Otherwise I like that it is made simpler. but ideally we should prevent tests that are not only read-only...
…`examples` instead
…or clarity in multiple test files
d588370 to
31b5d61
Compare
|



What do these changes do?
This PR aims to standardize the testing of
ApplicationSettingsacross all services. Currently, there are inconsistencies in how environment variables are mocked in tests. These differences must be addressed before we can enforce the upcoming feature that allows replacing.env-develwith an external env file. Some groundwork was left as-is where already present, but a thorough review is still required.Highlights
test_core_settings.pymoduleweb/server, where the file is namedtest_application_settings.pyApplicationSettingsbehavior for differentapp_environmentvaluesFollow-Up Work Required
To complete the unification:
.env-develfiltered viadocker-compose.yml’senvironmentsectionexternal_envfile_dict: will allow to run tests against configurations in deploysRelated issue/s
How to test
--external-envfilewith care. Some tests might unintentionally affect real deployments (e.g. delete/write databases, ...)This is how we validate an
ApplicationSettingsagainst an actual envfile ( NOTE: only for services that use--external-envfile).secrets.vscode/launch.jsonfrom the templatepytestwith--external-envfileoptiontest_core_settings.pyand runPython: Test w/ repo.configDev-ops
None