1

Xunit Plugin と Jenkins パイプラインを使用して MStest、Nunit3、Nunit2 の結果を表示しようとしていますが、同じ結果が得られませんでした。Xunit プラグインと、それに必要なさまざまなパラメーターの適切なドキュメントが見つかりません。

次のリンクを取得しましたが、あまり役に立ちません https://www.cloudbees.com/blog/xunit-and-pipeline https://wiki.jenkins.io/display/JENKINS/xUnit+Plugin

mstest、nunit3、およびnunit2の結果をjenkinsパイプラインに表示するためにXunitプラグインを使用する方法を知っている人はいますか?

以下は、MStest レポートの解析に使用したコードで、エラーが発生しました。私はジェンキンスのパイプラインにかなり慣れていないので、ヘルプ/ポインターは大歓迎です! 前もって感謝します!!

以下は私のパイプラインコードです

pipeline {
    agent any
    stages {
        stage('Copy Test Reports') {
            agent {
                node {
                    label 'test'
                    customWorkspace "C:\\jenkins\\workspace\\tests"
                }
            }
            steps {
                echo 'Hello world!'
                bat '''copy \\\\Precheck.xml .
                copy \\\\*.trx .'''
            }
            post {
                always {
                    xunit (
                        thresholds: [$class: 'FailedThreshold', unstableThreshold: '1'],
                        tools: [$class: 'MSTest', pattern: '*.trx']
                    )
                }
            }
        }        
    }
}


Error:
Missing required parameter: "thresholdMode" @ line 19, column 21.
                       xunit (
                       ^

WorkflowScript: 19: Missing required parameter: "testTimeMargin" @ line 19, column 21.
                       xunit (
                       ^
4

3 に答える 3

1

GoogleTest レポートを使用しても、同じ問題に遭遇しました。不足しているパラメーターを xunit() 呼び出しに追加すると、うまくいくはずです。

                xunit (
                    testTimeMargin: '3000',
                    thresholdMode: 1,
                    thresholds: [$class: 'FailedThreshold', unstableThreshold: '1'],
                    tools: [$class: 'MSTest', pattern: '*.trx']
                )

「3000」と「1」は、xunit-plugin が内部的に設定したデフォルトです。

于 2018-10-28T21:57:40.377 に答える