探索flutter框架开发的app在移动应用市场的潜力与挑战
960
2023-03-07
如何使用pipeline和jacoco获取自动化测试代码覆盖率
1-jacoco,并上传至服务器:https://eclemma.org/jacoco/
2.应用服务tomcat的catalina.sh增加jacocoagent
#java_OPTS="$JAVA_OPTS -javaagent:/Users/qiaojiafei/Documents/work/jacoco/jacoco-0.8.3/lib/jacocoagent.jar=includes=*,classdumpdir=claMHzBEsses,output=tcpserver,address=127.0.0.1,port=6300"
2.jenkins的pipeline配置
node {
stage('Test') {
echo 'This is a test step'
checkout poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/develop']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'bad9f924--4416-9f5e-', url: 'http://:8000/qiaojiafei/platform-qa.git']]]
sh 'mvn clean test -DapiTest.xml -Dmaven.test.failure.ignore=true'
}
stage('rd code') {
echo 'This is a tMHzBEest step'
checkout poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'bad9f924--4416-9f5e-', MHzBEurl: 'http://:8000/qingzhuhotel/qingzhutool.git']]]
sh 'mvn compile'
}
stage('DumpFromServer'){
echo 'This is a DumpFromServer step'
http://sh label: '', script: 'mvn org.jacoco:jacoco-maven-plugin:0.8.3:dump -Djacoco.address=192.168.162.224 -Djacoco.port=6300'
}
stage('jacoco'){
jacoco()
}
}
结果展示
jacoco原理
官网介绍:
https://jacoco.org/jacoco/trunk/doc/implementation.html
参考:
https://testerhome.com/topics/5757
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~