代码之家  ›  专栏  ›  技术社区  ›  Vincent F

黄瓜默认发布到某个URL?

  •  0
  • Vincent F  · 技术社区  · 5 年前

    我正试图使用Cucumber jvm 6.11.0生成一个报告,当我将这些属性放入 junit-platform.properties :

    cucumber.publish.enabled=true
    cucumber.plugin=pretty, json:build/reports/cucumber/report.json
    cucumber.junit-platform.naming-strategy=long   
    

    然而,当我在Jenkins上运行它时,我在发布过程中收到一个ConnectException:

    java.lang.RuntimeException: java.net.ConnectException: Connection timed out (Connection timed out)
        at io.cucumber.core.plugin.MessageFormatter.writeMessage(MessageFormatter.java:36)
        at io.cucumber.core.eventbus.AbstractEventPublisher.send(AbstractEventPublisher.java:51)
        at io.cucumber.core.eventbus.AbstractEventBus.send(AbstractEventBus.java:12)
        at io.cucumber.core.runtime.SynchronizedEventBus.send(SynchronizedEventBus.java:47)
        at io.cucumber.core.runtime.CucumberExecutionContext.emitTestRunFinished(CucumberExecutionContext.java:102)
        at io.cucumber.core.runtime.CucumberExecutionContext.finishTestRun(CucumberExecutionContext.java:74)
        at io.cucumber.junit.platform.engine.CucumberEngineExecutionContext.finishTestRun(CucumberEngineExecutionContext.java:98)
        at io.cucumber.junit.platform.engine.CucumberEngineDescriptor.after(CucumberEngineDescriptor.java:37)
        at io.cucumber.junit.platform.engine.CucumberEngineDescriptor.after(CucumberEngineDescriptor.java:10)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:149)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:149)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    ...
    Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1963)
        at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1958)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1957)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1525)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
        at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:329)
        at io.cucumber.core.plugin.UrlOutputStream.getResponseBody(UrlOutputStream.java:111)
        at io.cucumber.core.plugin.UrlOutputStream.sendRequest(UrlOutputStream.java:83)
    

    我尝试了不同的属性组合,我看到它从我启用发布的那一刻开始发生,只需:

    cucumber.publish.enabled=true
    

    我在中找不到默认行为 documentation ,一旦我们启用了发布:默认情况下,它在哪里发布?它真的尝试通过http上传吗?(我猜在Jenkins上运行时没有配置代理,而在我的机器上运行时找到了代理,因此行为不同)

    当我只是试图在磁盘上编写html或json报告时,为什么仍然会出现这个错误?

    0 回复  |  直到 5 年前
        1
  •  2
  •   Alexey R.    5 年前

    当您启用报告发布时,它会将测试结果上传到Cucumber云服务,您将获得唯一的URL,您(或与您共享该链接的任何人)可以使用该URL访问您的报告。

    这份报告在24小时内自我毁灭。您可以在官方网站上找到更多详细信息 Cucumber blog .