我有一个简单的 Scala 项目,用 sbt 构建,用 JUnit 测试。该项目已插入 Shippable CI,在 CI 界面中,我可以在运行构建时看到 Tests 选项卡。查看 "No test reports exist, skipping test report processing" 消息并阅读 Shippable 文档导致将以下内容添加到 shippable.yml 文件中:

before_script:
    - mkdir -p shippable/testresults
    - ln -s ../target/test-reports shippable/testresults

Shippable 现在识别出这些文件 - 它们看起来像常规的 JUnit XML 测试输出:
<?xml version='1.0' encoding='UTF-8'?>
<testsuite hostname="Davids-MacBook-Pro.local" name="recfun.PascalSuite" tests="3" errors="0" failures="0" time="0.027">
    <properties>
        <property name="jline.esc.timeout" value="0"/>
        <property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
....

,但我从 Shippable 收到以下错误,并且未提供测试结果:
reports --destination /shippableci/testresults tests --source /root/src/bitbucket.org/gaincore/recfun/shippable/testresults
No valid test reports found in path: /root/src/bitbucket.org/gaincore/recfun/shippable/testresults exiting...

我有什么问题?我还需要对 xml 输出做些什么吗?是否需要解析,或者是否有任何命名约定?

最佳答案

它对我来说工作正常。这是构建链接:https://app.shippable.com/runs/56ebcfb56b2b030d006f133d

shippable.yml 是:

language: scala

scala:
  - 2.11.0

before_script:
  - mkdir -p shippable/testresults
  - ln -s ../target/test-reports shippable/testresults

示例项目链接是:https://github.com/akskas/sample_scala/tree/test-normal

如果您仍然遇到此问题,请提供有关您的 shippable.yml 文件的更多上下文。
你可以在这里关注这个问题的进展:GITHUB: Shippable/support/issues/2409

10-07 18:27