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

Rails environment not taken into account when running tests #335

Open
YoranBrondsema opened this issue Sep 5, 2014 · 2 comments
Open

Rails environment not taken into account when running tests #335

YoranBrondsema opened this issue Sep 5, 2014 · 2 comments

Comments

@YoranBrondsema
Copy link

I have a dedicated ci environment for running the tests on Codeship. Before starting all the tests, I explicitely set RAILS_ENV to ci. When running bundle exec rake parallel:create and bundle exec rake parallel:prepare, the databases in the correct environment are prepared. However, when running the tests with SPEC_OPTS='--tag ~js' bundle exec rake parallel:spec (I exclude Capybara integration tests), it executes some tests in the test environment. This is the output (I can detect the environment by the deprecation warning for dotenv):

Auto-loading of `.env.ci` will be removed in 1.0. See https://github.com/bkeepers/dotenv-deployment if you would like to continue using this feature.
4 processes for 82 specs, ~ 20 specs per process
Auto-loading of `.env.test` will be removed in 1.0. See https://github.com/bkeepers/dotenv-deployment if you would like to continue using this feature.

Is this a bug? Or do I miss something in order for all processes to run in the ci environment?

@grosser
Copy link
Owner

grosser commented Sep 6, 2014

afaik it's not being forced anywhere, only doing RAILS_ENV || 'test',
maybe drop a puts into tasks / def rails_env and see what is going on ...

@YoranBrondsema
Copy link
Author

Hmmm yeah I see. I also added looked at what the value is of ENV['RAILS_ENV'] in ParallelTests::RSpec::Runner.run_tests but it's set at the correct value. Now I'm wondering where that process is coming from that executes in the test environment...

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

No branches or pull requests

2 participants