512433465 / jacocoplus Goto Github PK
View Code? Open in Web Editor NEW基于jacoco,JGit 二次开发增量代码覆盖率工具
License: Other
基于jacoco,JGit 二次开发增量代码覆盖率工具
License: Other
作者可以发一下readme.md里面的代码样例工程吗?就是package com.keking.report对应的那个
看了下对比的方式,一个是分支跟分支,还有tag跟tag的比较,怎么使用才能够支持两个commit的diff呢?
报错:Caused by: org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files:
报错代码:
// 拉取最新代码
git.pull().setCredentialsProvider(usernamePasswordCredentialsProvider).call();
报错原因:
JGit 对于代码检出自动合并Merge支持不好,看看有解决方案么
下下策解决方案:
脚本+命令 远程执行
一套代码在测试期会多次因改bug发版,会有多次exec文件
想看下本轮测试,总的覆盖率是多少,这个包支持嘛?支持的话如何写命令?求教
对于jacoco的增量代码覆盖率,只需要修改CoverageBuilder,让它支持从git服务获取差异的是吧
2,自己动手模式:下载我的代码,执行mvn clean package -Dmaven.javadoc.test=true -Dmaven.test.skip=true自行打包。注意事项IDE下载后,在IDE中执行maven打包命令可能不成功。 建议在命令行中执行maven打包命令。打包成功后,用官网包lib/jacocoagent.jar 替换自己新打包生成的jacocoagent.jar文件,否则可能引起Tomcat无法启动。-----z这是为什么嘛,我就是要用生成的jacocoanent.jar呢
代码部署后收集覆盖率, 新分支可能还在一直的提交代码,这样收集覆盖率阶段, 新分支 和 master 代码 diff 可能 与 之前的代码不一致,会出问题。
建议,用 提交的 版本号 做diff 这样可以保证代码准确性。
297766856 加 qq 一起 讨论下
大佬有时间可以补充下以该项目来进行覆盖率收集的例子,含命令的例子
hello,老哥,我刚接触jacoco,希望能得到您的帮助,13720035460 微信,感谢
问一下,打包之后用的org.jacoco.cli目录下target里面的org.jacoco.cli 执行时提示没有主清单属性, 能帮忙看一下原因么
您好,这个小组件非常好,解决了我的燃眉之急~非常感谢
官方Jacoco是可以通过配置识别Lombok注解并不统计自动生成的代码覆盖率的,请问此插件如何可以支持这种情况呢,可否给一些建议
jacoco 新手一枚。十分感谢您二次开发的jacoco增量覆盖率的统计功能,但是太清楚怎么使用,在哪里接受传递的newTag和oldTag,请教你是怎么使用的,是用maven,Jenkins还是怎么整合,然后接受传递的参数的,我看网上maven的都是单元测试的,直接mvn install 执行测试生成报告了。但是我想做的是手动测试的增量代码覆盖率,应该怎么做呢?十分感激
代码拉下来执行命令报错 mvn clean package -Dmaven.javadoc.test=true -Dmaven.test.skip=true
具体错误信息
Execution help-goal of goal org.apache.maven.plugins:maven-plugin-plugin:3.6.0:helpmojo failed: Unable to load the mojo 'helpmojo' in the plugin 'org.apache.maven.plugins:maven-plugin-plugin:3.6.0'. A required class is missing: org/codehaus/plexus/velocity/DefaultVelocityComponent
JacocoTest用8编译报错:
[类文件的搜索路径: /Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/jre/lib/rt.jar;/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/jre/lib/jce.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/sunec.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/nashorn.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/cldrdata.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/jfxrt.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/dnsns.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/localedata.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/jaccess.jar,/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/jre/lib/ext/zipfs.jar,/Users/lijingtong01/workspace/github/JacocoTest/target/classes,/Users/lijingtong01/.m2/repository/org/springframework/spring-web/4.3.2.RELEASE/spring-web-4.3.2.RELEASE.jar,/Users/lijingtong01/.m2/repository/org/springframework/spring-aop/4.3.2.RELEASE/spring-aop-4.3.2.RELEASE.jar,/Users/lijingtong01/.m2/repository/org/springframework/spring-beans/4.3.2.RELEASE/spring-beans-4.3.2.RELEASE.jar,/Users/lijingtong01/.m2/repository/org/springframework/spring-context/4.3.2.RELEASE/spring-context-4.3.2.RELEASE.jar,/Users/lijingtong01/.m2/repository/org/springframework/spring-core/4.3.2.RELEASE/spring-core-4.3.2.RELEASE.jar,/Users/lijingtong01/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar,/Users/lijingtong01/.m2/repository/org/springframework/spring-webmvc/4.3.2.RELEASE/spring-webmvc-4.3.2.RELEASE.jar,/Users/lijingtong01/.m2/repository/org/springframework/spring-expression/4.3.2.RELEASE/spring-expression-4.3.2.RELEASE.jar,.]
致命错误: 在类路径或引导类路径中找不到程序包 java.lang
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] An unknown compilation problem occurred
[INFO] 1 error
[INFO] -------------------------------------------------------------
比如我diff出来的增量代码为3和4行,为什么“+”加号显示在2,3,4行?
请问您对jacocoagent编译了解吗
作者你好,引用你的jar包,运行之后报如下异常:
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
at sun.security.util.SignatureFileVerifier.process(Unknown Source)
at java.util.jar.JarVerifier.processEntry(Unknown Source)
at java.util.jar.JarVerifier.update(Unknown Source)
at java.util.jar.JarFile.initializeVerifier(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
at sun.misc.Resource.cachedInputStream(Unknown Source)
at sun.misc.Resource.getByteBuffer(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.yangtu.CoverageDemo.main(CoverageDemo.java:14)
这个是因为什么引起的呢?
使用 ExecutionDataClient 生成的结果文件默认为 项目启动到当前这段时间的覆盖率数据;
项目重启后如何在之前的覆盖率文件上追加?
我个人尝试了如下方式:
final FileOutputStream localFile = new FileOutputStream(DESTFILE,true);
结果:
新导出文件追加写到上次的覆盖率文件中,但生成报告并不包含最新测试的覆盖率数据
INFO] JaCoCo ............................................. SUCCESS [ 34.488 s]
[INFO] JaCoCo :: Core ..................................... FAILURE [01:35 min]
[INFO] JaCoCo :: Report ................................... SKIPPED
[INFO] JaCoCo :: Agent RT ................................. SKIPPED
[INFO] JaCoCo :: Agent .................................... SKIPPED
[INFO] JaCoCo :: Ant ...................................... SKIPPED
[INFO] JaCoCo :: Command Line Interface ................... SKIPPED
[INFO] JaCoCo :: Examples ................................. SKIPPED
[INFO] JaCoCo :: Maven Plugin ............................. SKIPPED
[INFO] JaCoCo :: Tests .................................... SKIPPED
[INFO] JaCoCo :: Test :: Core ............................. SKIPPED
[INFO] JaCoCo :: Test :: Core :: Validation ............... SKIPPED
[INFO] JaCoCo :: Test :: Core :: Validation Java 5 ........ SKIPPED
[INFO] JaCoCo :: Test :: Core :: Validation Kotlin ........ SKIPPED
[INFO] JaCoCo :: Test :: Core :: Validation Java 7 ........ SKIPPED
[INFO] JaCoCo :: Test :: Core :: Validation Java 8 ........ SKIPPED
[INFO] JaCoCo :: Test :: Core :: Validation Groovy ........ SKIPPED
[INFO] JaCoCo :: Test :: Report ........................... SKIPPED
[INFO] JaCoCo :: Test :: Agent RT ......................... SKIPPED
[INFO] JaCoCo :: Test :: Agent ............................ SKIPPED
[INFO] JaCoCo :: Test :: Ant .............................. SKIPPED
[INFO] JaCoCo :: Test :: Command Line Interface ........... SKIPPED
[INFO] JaCoCo :: Test :: Examples ......................... SKIPPED
[INFO] JaCoCo :: Test :: Maven Plugin ..................... SKIPPED
[INFO] JaCoCo :: Documentation ............................ SKIPPED
[INFO] JaCoCo :: Distribution ............................. SKIPPED
[INFO] root 0.8.4 ......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:10 min
[INFO] Finished at: 2022-05-30T16:58:16+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project org.jacoco.core: Compilation failure
[ERROR] /Users/linjian/IdeaProjects/JacocoPlus/org.jacoco.core/src/org/jacoco/core/internal/diff/ASTGenerator.java:[43,53] 无法访问org.eclipse.core.runtime.Plugin
[ERROR] 错误的类文件: /Users/linjian/.m2/repository/org/eclipse/platform/org.eclipse.core.runtime/3.24.100/org.eclipse.core.runtime-3.24.100.jar(org/eclipse/core/runtime/Plugin.class)
[ERROR] 类文件具有错误的版本 55.0, 应为 52.0
[ERROR] 请删除该文件或确保该文件位于正确的类路径子目录中。
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :org.jacoco.core
jacococli打出的包main方法的类信息没有添加到manifest,pom文件已经做main-class配置了,请教下
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.