日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

android gradle + junit +jacoco +sonarscaner(sonarrunner) 获取单元测试覆盖率以及代码质量

發布時間:2023/12/19 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android gradle + junit +jacoco +sonarscaner(sonarrunner) 获取单元测试覆盖率以及代码质量 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

android gradle? job config xml 如下:

This XML file does not appear to have any style information associated with it. The document tree is shown below. <project> <actions/> <description/> <keepDependencies>false</keepDependencies> <properties> <com.tikal.hudson.plugins.notification.HudsonNotificationProperty plugin="notification@1.7"> <endpoints> <com.tikal.hudson.plugins.notification.Endpoint> <protocol>HTTP</protocol> <format>JSON</format> <url> http://10.24.40.107:8080/uranus/buildjob/jenkinsNotify </url> </com.tikal.hudson.plugins.notification.Endpoint> </endpoints> </com.tikal.hudson.plugins.notification.HudsonNotificationProperty> <jenkins.model.BuildDiscarderProperty> <strategy class="hudson.tasks.LogRotator"> <daysToKeep>7</daysToKeep> <numToKeep>-1</numToKeep> <artifactDaysToKeep>-1</artifactDaysToKeep> <artifactNumToKeep>-1</artifactNumToKeep> </strategy> </jenkins.model.BuildDiscarderProperty> </properties> <scm class="hudson.plugins.git.GitSCM" plugin="git@2.2.12"> <configVersion>2</configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <url>http://10.27.97.39/baitest/lxlandroid.git</url> <credentialsId>00be9c9f-6fab-45d2-af6f-00a05a0d9316</credentialsId> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name>*/master</name> </hudson.plugins.git.BranchSpec> </branches> <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> <submoduleCfg class="list"/> <extensions/> </scm> <assignedNode>gradle</assignedNode> <canRoam>false</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <jdk>win7-jdk1.8.101</jdk> <triggers/> <concurrentBuild>false</concurrentBuild> <builders> <hudson.plugins.gradle.Gradle plugin="gradle@1.24"> <description/> <switches/> <tasks>build -x lint</tasks> <rootBuildScriptDir/> <buildFile/> <gradleName>win7-2.14.1</gradleName> <useWrapper>false</useWrapper> <makeExecutable>false</makeExecutable> <fromRootBuildScriptDir>true</fromRootBuildScriptDir> <useWorkspaceAsHome>false</useWorkspaceAsHome> </hudson.plugins.gradle.Gradle> <hudson.plugins.sonar.SonarRunnerBuilder plugin="sonar@2.1"> <project/> <properties> sonar.projectKey=baitest_master_20171124154315 sonar.projectName=baitest sonar.projectVersion=6.2 sonar.sources=./ sonar.java.binaries=./ sonar.sourceEncoding=UTF-8 sonar.language=java sonar.java.source=1.8.0_51 sonar.branch=master sonar.junit.reportsPath=/opt/CI/jenkins/workspace/testgit/app/build/test-results/debug/ sonar.jacoco.reportPath=/opt/CI/jenkins/workspace/testgit/app/build/jacoco/testDebugUnitTest.exec sonar.android.lint.report=/opt/CI/jenkins/workspace/testgit/app/build/outputs/lint-results-debug.xml sonar.profile=Android Lint </properties> <javaOpts/> <jdk>win7-jdk1.8.101</jdk> <sonarRunnerName>sonar-scanner-2.9.0.670</sonarRunnerName> <task/> </hudson.plugins.sonar.SonarRunnerBuilder> </builders> <publishers/> <buildWrappers/> </project>
這一塊是關于sonar-runner 的配置:

<properties> sonar.projectKey=baitest_master_20171124154315 sonar.projectName=baitest sonar.projectVersion=6.2 sonar.sources=./ sonar.java.binaries=./ sonar.sourceEncoding=UTF-8 sonar.language=java sonar.java.source=1.8.0_51 sonar.branch=master sonar.junit.reportsPath=/opt/CI/jenkins/workspace/testgit/app/build/test-results/debug/ sonar.jacoco.reportPath=/opt/CI/jenkins/workspace/testgit/app/build/jacoco/testDebugUnitTest.exec sonar.android.lint.report=/opt/CI/jenkins/workspace/testgit/app/build/outputs/lint-results-debug.xml sonar.profile=Android Lint </properties>設置了find-bugs.xml, 設置了jacoco.exec 目錄 還有編碼,sonar版本,語言等參數。


這個job.config.xml 在jenkins上配置頁面上的映射:

Invoke Standalone Sonar Analysis ?
? Sonar Installation sonarsonar1 ?
? ? ?
? ? ?
? Task to run ?
? ? ?
? ? ?
? JDK (Inherit From Job)JAVA_1.6 JAVA_1.7.0_25IBM-JDK JAVA_1.6.0_45JAVA_1.8.0_51 openjdk-1.8.0_92jdk1.8.0 win7-jdk1.8.101 ?
? ?
? JDK to be used for this sonar analysis ?
? ? ?
? Sonar Runner sonar-scanner-2.8 sonar-scanner-2.9.0.670 ?
? ? ?
? ? ?
? Path to project properties ?
? ? ?
? ? ?
? Project properties sonar.projectKey=baitest_master_20171124154315
? ? ? ? sonar.projectName=baitest
? ? ? ? sonar.projectVersion=6.2
? ? ? ? sonar.sources=./
? ? sonar.java.binaries=./
? ? sonar.sourceEncoding=UTF-8
? ? sonar.language=java
? ? sonar.java.source=1.8.0_51
? ? sonar.branch=master
? ? sonar.junit.reportsPath=/opt/CI/jenkins/workspace/testgit/app/build/test-results/debug/
? ? sonar.jacoco.reportPath=/opt/CI/jenkins/workspace/testgit/app/build/jacoco/testDebugUnitTest.exec
? ? sonar.android.lint.report=/opt/CI/jenkins/workspace/testgit/app/build/outputs/lint-results-debug.xml
? ? sonar.profile=Android Lint
?
? ? ?
? ? ?
? JVM Options






總結

以上是生活随笔為你收集整理的android gradle + junit +jacoco +sonarscaner(sonarrunner) 获取单元测试覆盖率以及代码质量的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。