Skip to content
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

dotenv-rails loads dev environment when running system tests with Rails 7 #439

Closed
renchap opened this issue Dec 19, 2021 · 5 comments · Fixed by #470
Closed

dotenv-rails loads dev environment when running system tests with Rails 7 #439

renchap opened this issue Dec 19, 2021 · 5 comments · Fixed by #470

Comments

@renchap
Copy link

renchap commented Dec 19, 2021

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 rails/rails#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

@etiennebarrie
Copy link

See #219 and #241. Basically Rails had a hack, and we removed it, but we can add it here: #441

@ortonomy
Copy link

so is this fixed? the referred to PR is still open

@Samuelodan
Copy link

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.

@bkeepers
Copy link
Owner

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.

@Samuelodan
Copy link

Samuelodan commented Jan 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants