【发布时间】:2018-04-21 09:27:07
【问题描述】:
我需要在 Travis 上启动一个 Rails 服务器来运行集成测试。 我已将此添加到配置文件中:
before_script:
- psql -c 'create database scalia_test;' -U postgres
- "bundle exec rails server -p 3000 &"
但是,我仍然收到来自 Cypress 的错误:
http://localhost:3000/users/sign_in
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: connect ECONNREFUSED 127.0.0.1:3000
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
The stack trace for this error is:
Error: connect ECONNREFUSED 127.0.0.1:3000
at Object.exports._errnoException (util.js:1024:11)
at exports._exceptionWithHostPort (util.js:1047:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1150:14)
有人知道如何在 Travis 上启动 Rails 服务器吗?
【问题讨论】:
-
在启动服务器后尝试添加
sleep 3命令。还要确保设置了RAILS_ENV=test环境变量 -
这有什么更新吗?从未收到您的任何反馈
标签: ruby-on-rails travis-ci cypress