简体   繁体   English

在Nginx和Passenger中使用SimpleCov

[英]Using SimpleCov with nginx and passenger

We have an application written in Rails 3 which we deploy to Ubuntu servers running nginx/Passenger. 我们有一个用Rails 3编写的应用程序,我们将它部署到运行nginx / Passenger的Ubuntu服务器上。 We run a suite of tests against a test server using Watir. 我们使用Watir在测试服务器上运行了一套测试。

I have SimpleCov installed and running locally. 我已经在本地安装并运行了SimpleCov。 It works as expected on the test server as well but only when started using 'rails s'. 它也可以在测试服务器上按预期方式工作,但仅在开始使用“ rails s”时才起作用。

The issue is when the Rails application is running using passenger -- the coverage results are never generated. 问题是当使用乘客运行Rails应用程序时-永远不会生成coverage结果。 I suspect this may be because the application doesn't exit as it typically does when running unit tests. 我怀疑这可能是因为应用程序没有像运行单元测试时那样退出。

Does anyone know if this is a valid use of SimpleCov? 有人知道这是否是SimpleCov的有效用法吗? If so, are there special configuration requirements? 如果是,是否有特殊的配置要求?

That is probably because SimpleCov hooks into 'exit', but Phusion Passenger 3 calls 'exit!' 那可能是因为SimpleCov挂接到“出口”,但是Phusion Passenger 3却将其称为“出口!”。 to shut down application processes, which bypasses 'exit' hooks. 关闭应用程序进程,从而绕过“退出”挂钩。 This problem has been solved in Phusion Passenger 4. 这个问题已经在Phusion Passenger 4中解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM