-
Notifications
You must be signed in to change notification settings - Fork 27
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
Set RAILS_ENV=test
/RACK_ENV=test
in Queue Mode
#199
Conversation
@@ -0,0 +1,106 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe no cassettes at all should be recorded when the domain is fake. You could kill your http server running on 3000 port before you run tests.
6e59811
to
beb6966
Compare
I researched more why
When invoking
|
@@ -3,6 +3,8 @@ module Runners | |||
module Queue | |||
class CucumberRunner < BaseRunner | |||
def self.run(args) | |||
# ENV['RAILS_ENV'] = ENV['RACK_ENV'] = 'test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are good to remove comments now since we establish solution with $PROGRAM_NAME
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are good to release it.
test
in Queue Mode
test
in Queue ModeRAILS_ENV=test
/RACK_ENV=test
in Queue Mode
We want to make Queue Mode as easy as changing
bundle exec knapsack_pro:RUNNER
to
bundle exec knapsack_pro:queue:RUNNER
This PR removes the need to set
RAILS_ENV=test
likeRAILS_ENV=test bundle exec knapsack_pro:queue:RUNNER
I tried to set
RAILS_ENV=test
andRACK_ENV=test
in two different placesbut I got some (strange) errors when running
bin/knapsack_pro_all
.In particular, the following error popped out to me (to reproduce remove
RAILS_ENV=test \
frombin/knapsack_pro_queue_minitest
and runbin/knapsack_pro_queue_minitest
):The
rails-controller-testing
gem is in thetest
group, which made me think the app needs to be loaded WITHRAILS_ENV=test
. So I decided to try by shelling out to a separate process by usingsh
. That did the trick andbin/knapsack_pro_all
passes.