Codeship CI issue: "stream error Network error: ws://localhost:3000/websocket: connect ECONNREFUSED"

While trying to use Codeship as my CI I’m receiving this error:
stream error Network error: ws://localhost:3000/websocket: connect ECONNREFUSED

My setup is as follow:

cd <target_project>
nvm install 0.10.36
nvm use 0.10.36
npm install -g bcrypt
npm install -g velocity-cli
curl -o meteor_install_script.sh https://install.meteor.com/
chmod +x meteor_install_script.sh
sed -i "s/type sudo >\/dev\/null 2>&1/\ false /g" meteor_install_script.sh
./meteor_install_script.sh
export PATH=$HOME/.meteor:$PATH
meteor refresh```

And my test commands is a follows: 
```set -e
export VELOCITY_DEBUG=1
export VELOCITY_CI=1
export DEBUG=1
export VELOCITY_DEBUG_MIRROR=1
export NODE_ENV="development"
export METEOR_SETTINGS='{my_settings}'
meteor --test --once --release velocity:METEOR@1.1.0.2_3```

From a related thread on SO I read that some people thought Browser Policy could be an issue, so I updated my Meteor Settings and my browser policy config to respect all connections to localhost. That didn't solve it however. 
If you've got a working Codeship/Meteor/Velocity setup, I would love to learn how to do it.

EDIT: The issue was `set -e` which causes the test/build to fail upon first error, which `stream error Network ...` was.

The error is usually harmless. Are you saying there is also an issue with the actual tests?

Here’s an example of a project that works nicely on CircleCI

1 Like

That looks highly valuable. Thanks!

I ended up using the velocity-cli npm package (installed in the setup phase):
npm install velocity-cli
and rewrote the test settings like this:
velocity test-app --ci --settings settings.json
and included a settings file instead of using env variable, since I couldn’t make them work.

That works, Cucumber is now running.