我正在使用jenkins的管道插件,我想爲每個運行生成代碼覆蓋率報告並將其與管道ui一起顯示。有沒有我可以用來做的插件(例如Cobertura,但似乎沒有被管道支持)?jenkins管道作業的Cobertura代碼覆蓋率報告
21
A
回答
0
在指定目錄中使用command linecobertura-report
生成報告,並將結果附加爲工件。
cobertura-report [--datafile file] --destination dir [--format
html|xml] [--encoding encoding] directory [--basedir dir]
14
有一種方法可以添加管道步驟來發布您的報道報告,但它不會顯示在BlueOcean界面下。它會在正常的用戶界面中顯示正常。
pipeline {
agent any
stages {
...
}
post {
always {
junit '**/nosetests.xml'
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: '**/coverage.xml', failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
}
}
}
請注意,Cobertura插件的其中一個參數是它將使用的XML(示例中的'**/coverage.xml')。
如果您正在使用python,你將要使用的東西,如:
nosetests --with-coverage --cover-xml --cover-package=pkg1,pkg2 --with-xunit test
+0
這是兩天頭痛後。非常感謝。 –
相關問題
- 1. 使用cobertura插件轉到Jenkins的代碼覆蓋率報告
- 2. JUnit測試與Cobertura覆蓋率報告
- 3. Cobertura報告沒有增加Powermock代碼覆蓋率
- 4. Cobertura代碼覆蓋率是錯誤的
- 5. 艾瑪代碼覆蓋率報告
- 6. pydev代碼覆蓋率報告爲零
- 7. maven emma代碼覆蓋率報告
- 8. PHPUnit代碼覆蓋率報告0/0
- 9. Jenkins REST API:獲取覆蓋率報告
- 10. jenkins空閒時自動作業(帶代碼覆蓋率的phpunit)?
- 11. Cobertura with Ant Script:xml/html覆蓋率報告總是顯示0%覆蓋率
- 12. 如何使用Hudson的Maven生成Cobertura代碼覆蓋率報告
- 13. 在UNIX上使用的Cobertura生成代碼覆蓋報告
- 14. Jacoco代碼覆蓋率顯示Jenkins覆蓋率爲0%
- 15. Cobertura - 代碼覆蓋儀表
- 16. Freemarker自動生成代碼的Cobertura代碼覆蓋率
- 17. 零代碼覆蓋率的Cobertura 1.9.2,但測試工作
- 18. 如何使用Cobertura Maven插件查看HTML覆蓋率報告?
- 19. SonarQube無法看到Junit cobertura覆蓋率報告
- 20. 如何將C++ Cobertura覆蓋率報告導入Sonar?
- 21. Xcode 7代碼覆蓋率報告不起作用
- 22. 我如何生成失敗的Jenkins版本的代碼覆蓋率報告
- 23. 用Fastlane/Jenkins生成代碼覆蓋率
- 24. PHPSpec和覆蓋率報告
- 25. PHPUnit,覆蓋率報告顯示非代碼行沒有涵蓋?
- 26. 如何使用與Jenkins的cucumber-jvm報告管道作業
- 27. scala代碼覆蓋工具jenkins上的Cobertura
- 28. VS2012專業代碼覆蓋率
- 29. Jenkins管道作業報告Groovy綁定錯誤
- 30. 從Jenkins管道作業運行多個Selenium Webdriver作業的報告
您應該提供更多的信息。你使用什麼編程語言?你更喜歡什麼構建工具? – luka5z
我有Python,JavaScript和其他種類的項目,我一直在自由式項目上使用Cobertura來顯示代碼覆蓋率報告。然而,切換到管道後,我沒有得到後期構建用戶界面來爲項目設置Cobertura。 – ebnius
通過Pipeline作業檢查您的插件是否支持(https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md)。 – luka5z