是否有可能在docker中运行我的meteortesting?

一旦我用我的Meteor应用程序构build了我的容器,我真的很想去

docker run me/myapp velocity test-app --ci --once --settings settings-test.json

如果成功,它会以0退出,在这种情况下,我会将它推送到docker中心,将其部署到某处等。

但是,当我尝试这个只是挂起:

 [velocity] is in continuous integration mode [velocity] mocha is starting a mirror at http://localhost:56381/. [velocity] *** Meteor Tools is installing *** This takes a few minutes the first time. [velocity] You can see the mirror logs at: tail -/app/.meteor/local/log/mocha.log 

我使用茉莉花按照https://github.com/meteor-velocity/velocity-examples (我开始与摩卡,但切换,看看是否有任何区别)。

检查我的.meteor/local/log文件我发现jasmine-client- unit.log有这在底部:

 WARN [watcher]: [39m Pattern "/app/tests/jasmine/client/unit/**/*-+(stub|stubs|mock|mocks).+(js|coffee|litcoffee|coffee.md)" does not match any file. WARN [karma]: [39m No captured browser, open http://localhost:9876/ INFO [karma]: [39m Karma v0.13.9 server started at http://localhost:9876/ INFO [launcher]: [39m Starting browser Chrome ERROR [launcher]: [39m No binary for Chrome browser on your platform. Please, set "CHROME_BIN" env variable Parent process ( 725 ) is dead! Exiting jasmine-client-unit 

Chrome显然不会在docker中可用 – phantomjs是否应该安装在这个点上,并指定为运行选项? 如果指定了--ci选项,我会预料到这种情况是默认情况下的情况。

谢谢。

理想情况下,您应该使用真正的浏览器(如Chrome或Firefox)进行自动testing,而不是PhantomJS。 你可以使用Xvfb无界运行浏览器。

这些可能是有用的:

http://codeutopia.net/blog/2013/07/13/headless-chromefirefox-testing-in-nodejs-with-selenium-and-xvfb/

http://elementalselenium.com/tips/38-headless

selenium是testing的方式。 IMO最好的设置是使用像Jenkins或TeamCity这样的安装了Xvfb的CI服务器,并且在Jenkins中有一个testing/部署shell脚本,例如:

 #!/bin/sh set -ex cd $WORKSPACE export VELOCITY_CI=1 meteor --test --settings $WORKSPACE/.deploy-staging/settings.json cd .deploy-staging mupx setup mupx deploy 

(请注意,尽pipe这里没有实现Xvfb)。 这个testing并不完全正常,我还没有自己跳进Xvfb,虽然我知道这是正确的方向。

我正在使用mupx来部署我的应用程序,这会自动在远程服务器上为我创build一个Docker实例,并完全处理部署。