fix: set HOME env var when not present in environment#713
Conversation
RabbitMQ's Erlang runtime requires HOME to be set in the environment. In stripped environments like tox, this causes the rabbitmq-server to fail with 'HOME must be set'. Set HOME to the temporary directory path when it is not already present in os.environ. Fixes dbfixtures#37
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRabbitMQ executor initialisation now conditionally sets the HOME environment variable to the provided path when absent from os.environ, addressing environments where HOME is stripped. The os module is imported to support this, and parameter documentation is corrected. ChangesHOME Environment Variable Initialisation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@DC925928496 |
Problem
RabbitMQ's Erlang runtime requires the
HOMEenvironment variable to be set. In stripped environments liketox(which unsets all env vars), therabbitmq-serverprocess fails with:Users currently need a workaround in
tox.ini:Fix
When
HOMEis not already present inos.environ, set it to the temporary directory path (pathparameter) viaenvvarsinRabbitMqExecutor.__init__. This is the same directory that RabbitMQ already uses for its runtime data (RABBITMQ_MNESIA_BASE), so it's a safe and appropriate fallback.The fix is minimal — only 3 lines added to
executor.py:Related Issues
Fixes #37
Summary by CodeRabbit
Bug Fixes
Documentation