我已经看到了许多类似的问题,但是似乎没有一个解决或描述我的确切问题。
我已经配置了一个Azure Devops管道,以使用以下容器:
container:
image: ptrthomas/karate-chrome
options: --cap-add=SYS_ADMIN
我将示例的内容从aipserver演示上传到存储库,然后运行以下内容:
steps:
- script: mvn clean test -DargLine='-Dkarate.env=docker' -Dtest=WebRunner
这是我的理解(从日志中可以看到),文件被加载到中容器,并且脚本命令正在执行内部容器。因此,该脚本命令等效于 docker exec -IT -W /src空手道MVN清洁测试-Dargline ='-dkarate.env = Docker'-dtest = Webrunner < /code>,而无需执行容器。
当我在本地运行示例时,它将执行测试没有问题,但是在Azure Dev Ops中,它在测试实际上开始运行时失败了,引发了此错误:
14:16:16:37.388 [main]错误
Localhost:9222 [localhost/127.0.0.1]失败:连接拒绝
(连接拒绝),HTTP调用在2毫秒后失败了URL:
http:// localhost:9222/json 14:16:39.388 [main]调试
com.intuit.karate.shell.command-尝试#4等待HTTP为
准备:http:// localhost:9222/json 14:16:39.391 [main]调试
com.intuit.karate-请求:5&gt;获取http:// localhost:9222/json 5&gt;
主持人:Local主机:9222 5&GT;连接:保持现象5&gt;用户代理:
apache-httpclient/4.5.13(java/1.8.0_275)5&gt;接受编码:
Gzip,Deflate
查看其他问题,有建议使用此行中指定功能文件中的驱动程序:
* configure driver = { type: 'chrome', executable: 'chrome' }
但是a)对我而言并不适用于我,b)不应该将这种配置呈现为不必要它应该与我本地运行的容器没有什么不同?
任何帮助!
谢谢
I have seen many similar issues to this but none seem to resolve or describe my exact issue.
I have configured an azure devops pipeline to use a container like below:
container:
image: ptrthomas/karate-chrome
options: --cap-add=SYS_ADMIN
I have uploaded the contents of the example from the jobserver demo to a repository and then run the following:
steps:
- script: mvn clean test -DargLine='-Dkarate.env=docker' -Dtest=WebRunner
It is my understanding (and I can see from the logs) that the files are loaded into the container and the script command is being executed inside the container. So that script command is the equivalent of docker exec -it -w /src karate mvn clean test -DargLine='-Dkarate.env=docker' -Dtest=WebRunner
just without having to exec into the container.
When I run the example locally it executes the tests with no issues but in azure dev ops it fails at the point the tests actually start running, throwing this error:
14:16:37.388 [main] ERROR com.intuit.karate - karate.org.apache.http.conn.HttpHostConnectException: Connect to
localhost:9222 [localhost/127.0.0.1] failed: Connection refused
(Connection refused), http call failed after 2 milliseconds for url:
http://localhost:9222/json 14:16:39.388 [main] DEBUG
com.intuit.karate.shell.Command - attempt #4 waiting for http to be
ready at: http://localhost:9222/json 14:16:39.391 [main] DEBUG
com.intuit.karate - request: 5 > GET http://localhost:9222/json 5 >
Host: localhost:9222 5 > Connection: Keep-Alive 5 > User-Agent:
Apache-HttpClient/4.5.13 (Java/1.8.0_275) 5 > Accept-Encoding:
gzip,deflate
Looking at other issues there have been suggestions to specify the driver in the feature files with this line:
* configure driver = { type: 'chrome', executable: 'chrome' }
but a) that hasn't worked for me and b) shouldn't the karate-chrome docker image render this configuration unnecessary as it should be no different than the container I run locally?
Any help appreciated!
Thanks
发布评论
评论(1)
我唯一能想到的是,Azure配置未调用图像的
entrypoint
。也许您应该尝试从头开始创建一个容器(进行大量的记录),看看会发生什么。使用空手道一作为参考。
编辑:很可能会更改Selenium/WebDriver,请参阅:
Only thing I can think of is that the Azure config does not call the
ENTRYPOINT
of the image.Maybe you should try to create a container from scratch (that does extensive logging) and see what happens. Use the Karate one as a reference.
EDIT: most likely a change in Selenium / Webdriver, refer: https://github.com/karatelabs/karate/issues/2358