首页 > 解决方案 > KotlinTest jUnit 报告不包含 BehaviorSpec 步骤

问题描述

将 KotlinTest 与 gradle 一起使用。尽管生成的报告不包含 BehaviorSpec 步骤,但在 Jenkins 管道中执行测试。这使我的报告无法使用。

有没有人遇到过类似的问题或知道生成更具描述性的报告的不同方法。

分级测试任务

test {
    useJUnitPlatform()
    systemProperties = System.properties
    // show standard out and standard error of the test JVM(s) on the console
    scanForTestClasses = false

    // show standard out and standard error of the test JVM(s) on the console
    testLogging.showStandardStreams = true

    // Always run tests, even when nothing changed.
    dependsOn 'cleanTest'

    testLogging {
        events "PASSED", "FAILED", "SKIPPED", "STANDARD_OUT", "STANDARD_ERROR"
    }
}

管道后步骤

post {
           always {
           archiveArtifacts artifacts: 'build/libs/**/*.jar', fingerprint: true
                     junit 'build/test-results/test/*.xml'
           }
       }

标签: kotlinjunitreportkotlintest

解决方案


推荐阅读