是否有可能在Heroku Cedar上运行capybara-webkit(即分叉的webkit_server)? [英] Is it possible to run capybara-webkit (i.e. forked webkit_server) on Heroku Cedar?

查看:146
本文介绍了是否有可能在Heroku Cedar上运行capybara-webkit(即分叉的webkit_server)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Rails应用程序中运行capybara-webkit,以支持使用JavaScript支持的无头网页浏览(即不用于测试/ CI目的,并且webrat或其他验收测试驱动程序/框架不起作用)。我想知道这是否可以在Heroku部署中使用,特别是因为它需要QtWebKit以及使用套接字通信分离webkit_server进程的能力。对于如何在Heroku上进行这项工作(例如工作人员动态库),我很乐意提供创意。我希望有人能够更好地处理Heroku环境中存在的约束,或者可以明确排除这种可能性,以便我可以在必要时转移到AWS EC2。



搜索这个项目往往会涉及很多关于CI服务器的水豚测试和附加组件,这两者都与我的使用案例无关。我没有测试任何东西(至少不是在传统的cucumber / rspec / etc中) - 我正在使用Capybara与webkit驱动程序,查找程序和节点/元素模型的集成来浏览一个需要大量客户端 - 我也开放给其他(原生Ruby)解决方案,以便使用支持JavaScript的DOM以编程方式与网站进行交互。

解决方案

我跟Heroku支持过这个问题,他们的回答是,这基本上是a)不受支持的; b)非常困难,包括(除其他之外)静态构建的QtWebKit版本。

我在Amazon EC2上对此进行的调查也让我意识到QtWebKit需要一个运行的Xvfb实例。我非常怀疑这个功能可以在Heroku上使用,而且我认为这样做会非常困难。



我自己的方法是将此功能放在EC2上实例。在对亚马逊的标准AMI(他们的构建和RHEL)进行了一些尝试之后,我发现通过Ubuntu的软件包管理系统可用的软件包使得启动运行起来更容易。

长话短说:Heroku不是首发,使用Ubuntu的Amazon EC2是最好的选择。


I need to run capybara-webkit inside a Rails application to enable headless web browsing with JavaScript support (i.e. not for testing/CI purposes, and webrat or other acceptance testing drivers/frameworks will not work). I'm wondering if this is possible on a Heroku deployment, specifically because it requires QtWebKit and the ability to fork the webkit_server process with socket communication. I'm open to creative ideas on how to make this work on Heroku (e.g. a pool of worker dynos). I'm hoping someone has a better handle on what constraints exist in the Heroku environment, or can categorically rule out the possibility so I can move on to AWS EC2 if necessary.

Searching for this tends to turn up a lot about capybara testing and add-ons for CI servers, neither of which are relevant for my use case. I'm not testing anything (at least not in the traditional cucumber/rspec/etc sense) - I'm using Capybara's integration with the webkit driver, finders and node/element model to navigate a website that requires a significant amount of client-side JS in order to work.

I'm also open to other (native Ruby) solutions for programmatically interacting with web sites using JavaScript-enabled DOM.

解决方案

I spoke to Heroku support about this and their answer was that this is basically a) unsupported; b) very difficult, including (among other things) a statically built version of QtWebKit.

My own investigation into this on Amazon EC2 also made me realize that QtWebKit requires a running instance of Xvfb. I highly doubt this would be available on Heroku, and I suspect it would be extremely difficult to make it work.

My own approach has been to put this functionality on an EC2 instance. After making some attempts with Amazon's standard AMIs (their build and RHEL), I found that the packages available through Ubuntu's package management systems made it MUCH easier to get up an running.

Long story short: Heroku is a non-starter, Amazon EC2 with Ubuntu is the best way to go.

这篇关于是否有可能在Heroku Cedar上运行capybara-webkit(即分叉的webkit_server)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆