5

I've started using Jenkins in order to compile and test my builds periodically. The job is fairly simple. It compiles the build and then executes the tests.

The test results are stored in a file. There's also a distinct line saying how many tests have passed. (Something like X tests passed out of Y).

I'd like to know what's the simplest way/plug-in to display these results at the end of the build.

I'd like a visual display, since I know Jenkins is very nice in displaying graphs over time/job.

I appreciate your help, and forgive me if this question already exists on Stackoverflow. I haven't found anything close enough for me.

4

2 に答える 2

6

Jenkins がより理解しやすい形式でテスト結果を公開できるとよいと思いませんか? その場合は、簡単なテスト結果を生成する方法について、このリンクを参照してください。それが完了すると、Jenkins が提供するビジュアル表示が無料で提供されます。

于 2013-02-08T09:43:40.637 に答える
5

Groovy Postbuild Pluginをインストールし、それを使用して個別の行を解析し、ビルド結果のすぐ隣に表示できます。

def matcher = manager.getLogMatcher("(.*)  tests passed out of (.*)\$")
if(matcher != null && matcher.matches()) {
    passedTests = matcher.group(1)
    totalTests = matcher.group(2)
    manager.addShortText("${passedTests} / ${totalTests}")
}

成功率に応じて、バッジまたはカスタマイズされた色で強化することもできます.

それが役に立てば幸い

于 2013-02-07T16:16:32.443 に答える