我的问题是如何在docker容器中运行google chrome进行e2e测试.我创建了一个Dockerfile官方Jenkins图像,但是当尝试运行谷歌浏览器时,它会崩溃并显示错误:
Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
Trace/breakpoint trap (core dumped)
Run Code Online (Sandbox Code Playgroud)
Jenkins docker镜像使用Debian jessie.
我可以用--headless旗帜运行谷歌浏览器,不需要X服务器.
这是我的docker文件:
詹金斯官方形象:
一个人使用来自docker的GUI运行google chrome:
我的第一种方法是使用xvbf,但使用--headlessflag 时过程更简单.
我可以使用相同的安装命令在Ubuntu服务器上运行chrome,但是在docker中它会失败.
在其他意图之后,我使用了--no-sandboxflag,但是docker图像显示了下一个错误.
[0427/180929.595479:WARNING:audio_manager.cc(295)] Multiple instances of AudioManager detected
[0427/180929.595537:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected
libudev: udev_has_devtmpfs: name_to_handle_at on /dev: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
其实我运行了这个命令:
google-chrome-stable --headless --disable-gpu --no-sandbox http://www.google.com
我有一个有两个日期的类,我的搜索是动态的,Hibernate提供了Query By Example(QBE),但现在使用Spring Data的QBE.问题是当创建QBE但文档限制ExampleMatcher的String类型时,我需要创建一个ExampleMatcher来搜索此日期之间的所有实体.
如何使用查询实例来实现这个?
我现在的替代方案是:
创建一个hibernate dao并使用QBE和hibernate标准(Bye JPA:'()
探索这个http://spring.io/blog/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/(非常难看的代码)
类的示例属性:
private int id;
private String property1;
private String property2;
private Date dateFirst;
private Date dateSecond;
Run Code Online (Sandbox Code Playgroud)
相关: