dotenv
dotenv copied to clipboard
dotenv-rails loads dev environment when running system tests with Rails 7
When running system tests with Rails 7, the development environment variable files are loaded before loading the test ones.
This is most likely a bug in Rails 7, see https://github.com/rails/rails/issues/43937
I am opening the issue here in case somebody else is hitting this and wonders whats happening.
Steps to reproduce
- In your
.env.dev
define a variable - Do not defineit in
.env.test
- Run your system tests
Expected behavior
Your env variable should not be defined
Actual behavior
The variable for dev env is defined
System configuration
dotenv version: 2.7.6
Rails version: 7.0.0
Ruby version: 3.0.3
See #219 and #241. Basically Rails had a hack, and we removed it, but we can add it here: #441
so is this fixed? the referred to PR is still open
Seeing all these open/ignored PRs and issues makes me think again about using dotenv in my project. Kinda worrying that Kamal is using it by default.
Seeing all these open/ignored PRs and issues makes me think again about using dotenv in my project. Kinda worrying that Kamal is using it by default.
@Samuelodan dotenv is an incredibly simple and stable library. I don't spend a lot of time maintaining it because it just works for me and most people, and I get tired of ungrateful users that complain and don't offer to help.
Seeing all these open/ignored PRs and issues makes me think again about using dotenv in my project. Kinda worrying that Kamal is using it by default.
@Samuelodan dotenv is an incredibly simple and stable library. I don't spend a lot of time maintaining it because it just works for me and most people, and I get tired of ungrateful users that complain and don't offer to help.
@bkeepers
Hmm, I'm fairly new to all this, and I'm worried about how to manage .env files. Looking at dotenv, it gets recommended a lot, and Kamal even uses it, but I see these issues and PRs that were made a long time ago that didn't get as much as a response from the maintainer(s).
These didn't seem to me like ungrateful users because they did in fact offer to help.
But I hear open source work can be thankless and exhausting at times, so I apologize if my remarks made you feel that kinda away about your work.
Thanks for (building? and) maintaining this library. Chances are I'm overanalyzing the problem, so I'll give it a shot and see how it goes.