Dredd: Unable to pass environment variables to the server command

Created on 5 Jul 2016  路  3Comments  路  Source: apiaryio/dredd

Hello,
Currently is not possible to pass environment variables to the server command used by Dredd to start the server.
I've made a patch ( #542 ), but because my lack of experience on CoffeeScript, I'm missing something with my testing code and I'm not being able to cover the added code with new tests.

docs

Most helpful comment

@castarco

I'd say there's a very low-hanging workaround solution to just wrap the server command into a shell script.

#!/bin/bash
export RAILS_ENV=test
bundle exec rails serevr

All 3 comments

@castarco Thanks! Sorry for late response, we've been hit by vacation time. I'll take a look soon and will give you pointers or try to incorporate your contribution.

@netmilk In my opinion it is a good idea to be able to pass env vars to the server, what do you think?

@castarco

I'd say there's a very low-hanging workaround solution to just wrap the server command into a shell script.

#!/bin/bash
export RAILS_ENV=test
bundle exec rails serevr

@netmilk For me, this workaround breaks dredd's killing of the server (using a unicorn server). Using the command bundle exec unicorn in the YML file, the server stops correctly before dredd exits. Using a shell script with the same command, the server continues running.

Was this page helpful?
0 / 5 - 0 ratings