Repository navigation
Keep a login in backend/.env out of the backend tests - #296
Merged
Merged
Conversation
With SENTRA_USERS set in a developer's .env the role guards close, and two upload tests got 401 on that machine only. The test configuration now blanks SENTRA_USERS and SESSION_SECRET in the environment, which outranks the dotenv file; tests about the login pass their own values to Settings.
Contributor
Author
Other infos
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 16, 2026
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.
Closes #272
The backend test suite read the developer's
backend/.env. Once a login is configured there (SENTRA_USERSandSESSION_SECRET, which running the stack locally now needs), the role guards close and two upload tests got 401, on that machine only and never in CI.tests/conftest.pynow sets both to empty in the environment. Environment variables outrank the dotenv file in pydantic-settings, so this wins. Tests about the login pass their own users and secret toSettingsdirectly, which outranks both.🤖 Generated with Claude Code