Repository navigation
test: read config via get_config() - #443
Merged
Merged
Conversation
Replace the deprecated `app.config.foca` in the gateway tests with `foca.get_config()` and `get_custom_config()`, in the app context of the app under test, as in FOCA's migration guide for 0.22. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis test-only change migrates File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #443 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 2685 2685
=========================================
Hits 2685 2685 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
November 6, 2026 00:55
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Linked issues
#441 test: stop using deprecated FOCA config access · 1 of 2 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Tests read config via get_config() in the app context instead of deprecated access. | ✅ Met | test_backend_entries uses get_config() and get_custom_config() inside the app's context. |
| 2 | The suite passes with pinned FOCA and FOCA's dev head without FOCA deprecation warnings. | 👀 Check by hand (runtime) | Run the suite with pinned FOCA and FOCA's dev head, confirming both pass without FOCA deprecation warnings. |
Sourcery assessment
Approved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_gateway.py::test_backend_entriesreads FOCA's configuration viafoca.get_config()andget_custom_config(CustomConfig)instead of the deprecatedapp.app.config.foca(deprecated on FOCA'sdev, elixir-cloud-aai/foca#716), as described in FOCA'sdocs/migration-0.22.md. The test already runs in the app context of the app under test (with app.app.app_context():), soget_config()returns that app's config.Closes #441
Verification
FOCA 0.21.0 (the locked version,
foca>=0.21.0,<0.22) already hasget_config()andget_custom_config(), which return the config ofcurrent_appin an app context, as on FOCA'sdev; the tests already use them elsewhere.Locally, Python 3.13, locked dependencies (
uv sync --locked --extra dev), Helm 3.22.1:ruff check .,ruff format --check .(ruff 0.17.3, as in pre-commit): passedmypy .: no issues in 77 source filesast-grep scan,semgrep --config=.semgrep --error: no findingscoverage run -m pytest -W ignore::DeprecationWarning(mongomock): 1614 passed, 11 skipped; coverage 100%devhead (438c8a1) installed,pytest -W default::DeprecationWarning -rw: 1614 passed, 11 skipped; noDeprecationWarningfrom FOCA (only those of jsonschema, via Connexion and FOCA, and mongomock). The test ofdevwarns there ('app.config.foca' is deprecated); this one doesn't. FOCA's dev head also logs warnings about Werkzeug classes in the exception map, which is another part of the migration, not this issue.The MongoDB 7.0 test job ran in CI only.
CI: all checks passed (Lint, Test (mongomock), Test (MongoDB 7.0), Chart, Docs, Smoke test, Scan image, CodeQL, Codecov, CI passed; integration and image pushes skipped as intended on PRs).
Light lane
Test-only change (config access in one test, no behaviour change), so no reviewer subagents; I reviewed the diff myself.
Declined review findings
None.
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Migrate the gateway configuration test to FOCA’s supported configuration accessors.
Enhancements:
Tests: