Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong coverage percent 0.7.4 to 0.7.6 #562

Open
jiwhunkim opened this issue Mar 12, 2024 · 4 comments
Open

wrong coverage percent 0.7.4 to 0.7.6 #562

jiwhunkim opened this issue Mar 12, 2024 · 4 comments
Assignees
Labels
Bug Bug issue type S: in progress Status: implementing or design in process

Comments

@jiwhunkim
Copy link

using 0.7.4 kover code coverage work properly
after 0.7.4 version using code coverage show 0%

I found coverage-error.log (0.7.6)

[2024.03.12 18:09:36] (Coverage INFO): Error during class frame computation: com/appmattus/kotlinfixture/resolver/AndroidUriResolver com.intellij.rt.coverage.instrumentation.ClassWriterImpl$FrameComputationClassNotFoundException: Class android/net/Uri not found at com.intellij.rt.coverage.instrumentation.ClassWriterImpl.getOrLoadClassReader(ClassWriterImpl.java:131) at com.intellij.rt.coverage.instrumentation.ClassWriterImpl.getCommonSuperClass(ClassWriterImpl.java:43) at org.jetbrains.coverage.org.objectweb.asm.SymbolTable.addMergedType(SymbolTable.java:1202) at org.jetbrains.coverage.org.objectweb.asm.Frame.merge(Frame.java:1300) at org.jetbrains.coverage.org.objectweb.asm.Frame.merge(Frame.java:1245) at org.jetbrains.coverage.org.objectweb.asm.MethodWriter.computeAllFrames(MethodWriter.java:1611) at org.jetbrains.coverage.org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1547) at org.jetbrains.coverage.org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:786) at org.jetbrains.coverage.org.objectweb.asm.commons.LocalVariablesSorter.visitMaxs(LocalVariablesSorter.java:147) at com.intellij.rt.coverage.instrumentation.util.LocalVariableInserter.visitMaxs(LocalVariableInserter.java:54) at org.jetbrains.coverage.org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:786) at org.jetbrains.coverage.org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:786) at org.jetbrains.coverage.org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:767) at com.intellij.rt.coverage.instrumentation.CoverageEnumerator.accept(CoverageEnumerator.java:62) at com.intellij.rt.coverage.instrumentation.Instrumenter$2.visitEnd(Instrumenter.java:120) at org.jetbrains.coverage.org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1519) at org.jetbrains.coverage.org.objectweb.asm.ClassReader.accept(ClassReader.java:745) at org.jetbrains.coverage.org.objectweb.asm.ClassReader.accept(ClassReader.java:425) at com.intellij.rt.coverage.instrumentation.AbstractIntellijClassfileTransformer.instrument(AbstractIntellijClassfileTransformer.java:132) at com.intellij.rt.coverage.instrumentation.AbstractIntellijClassfileTransformer.transform(AbstractIntellijClassfileTransformer.java:88) at com.intellij.rt.coverage.instrumentation.AbstractIntellijClassfileTransformer.transformInner(AbstractIntellijClassfileTransformer.java:102) at com.intellij.rt.coverage.instrumentation.AbstractIntellijClassfileTransformer.transform(AbstractIntellijClassfileTransformer.java:57) at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244) at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188) at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541) at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at com.appmattus.kotlinfixture.config.Configuration.<clinit>(Configuration.kt:122) at com.appmattus.kotlinfixture.config.ConfigurationBuilder.<init>(ConfigurationBuilder.kt:40) at com.appmattus.kotlinfixture.KotlinFixtureKt.kotlinFixture(KotlinFixture.kt:102) at com.baemin.mart.order.adapter.conversion.OrderConvertSettlementAdapterSpec.<clinit>(OrderConvertSettlementAdapterSpec.kt:118) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:375) at io.kotest.framework.discovery.Discovery$loadSelectedSpecs$loadedClasses$2.invoke(Discovery.kt:158) at io.kotest.framework.discovery.Discovery$loadSelectedSpecs$loadedClasses$2.invoke(Discovery.kt:158) at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210) at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170) at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194) at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:816) at io.kotest.framework.discovery.Discovery.loadSelectedSpecs(Discovery.kt:160) at io.kotest.framework.discovery.Discovery.doDiscovery-IoAF18A(Discovery.kt:99) at io.kotest.framework.discovery.Discovery.discover(Discovery.kt:73) at io.kotest.runner.junit.platform.KotestJunitPlatformTestEngine.discover(KotestJunitPlatformTestEngine.kt:122) at io.kotest.runner.junit.platform.KotestJunitPlatformTestEngine.discover(KotestJunitPlatformTestEngine.kt:39) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107) at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78) at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99) at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:118) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:93) at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:88) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:62) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) at jdk.proxy1/jdk.proxy1.$Proxy2.stop(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:193) at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129) at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100) at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60) at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56) at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113) at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65) at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69) at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

@jiwhunkim jiwhunkim added Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 12, 2024
@shanshin
Copy link
Collaborator

Hi,
could you please provide a small reproducer project?

@shanshin shanshin added Bug Bug issue type S: waiting for clarification Status: additional information required to proceed and removed Question Support request issue type S: untriaged Status: issue reported but unprocessed labels Mar 13, 2024
@jiwhunkim
Copy link
Author

jiwhunkim commented Mar 15, 2024

I think main reason
reproduce project like
https://github.com/jiwhunkim/helloworld-hexagonal-architecture

maybe below log

[2024.03.15 10:22:22] (Coverage WARN): Unexpected error during report saving
java.lang.NullPointerException: Cannot invoke "com.intellij.rt.coverage.data.ClassData.getName()" because "targetClassData" is null
at com.intellij.rt.coverage.util.LineMapper.mapLines(LineMapper.java:75)
at com.intellij.rt.coverage.data.ClassData.checkLineMappings(ClassData.java:223)
at com.intellij.rt.coverage.data.ProjectData.applyLineMappings(ProjectData.java:243)
at com.intellij.rt.coverage.util.CoverageReport.finalizeCoverage(CoverageReport.java:100)
at com.intellij.rt.coverage.util.CoverageReport.save(CoverageReport.java:66)
at com.intellij.rt.coverage.instrumentation.Instrumentator$1.run(Instrumentator.java:88)
at java.base/java.lang.Thread.run(Thread.java:833)

@jiwhunkim
Copy link
Author

@tatocaster
Copy link

same is happening on 0.8.0-beta too ☝🏻
Basically I had to revert from 0.7.5(6) to 0.7.3, but it suffers from #459.
Eagerly waiting for 0.8.1 probably where coverage and verification will work together 🤞

Thanks

@shanshin shanshin added S: in progress Status: implementing or design in process and removed S: waiting for clarification Status: additional information required to proceed labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: in progress Status: implementing or design in process
Projects
None yet
Development

No branches or pull requests

3 participants