Kotlin / kotlinx-kover

Apache License 2.0
1.27k stars 47 forks source link

Run fails #179

Closed emartynov closed 1 year ago

emartynov commented 2 years ago

After update I see next error on run on CI:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.intellij.rt.coverage.data.instructions.LineInstructions.getInstructions()" because "lineInstruction" is null
    at com.intellij.rt.coverage.util.InstructionsSection.saveClass(InstructionsSection.java:100)
    at com.intellij.rt.coverage.util.ClassListSection$1.execute(ClassListSection.java:51)
    at com.intellij.rt.coverage.util.ClassListSection$1.execute(ClassListSection.java:48)
    at org.jetbrains.coverage.gnu.trove.TObjectIntHashMap.forEachEntry(TObjectIntHashMap.java:379)
    at com.intellij.rt.coverage.util.ClassListSection.saveInternal(ClassListSection.java:48)
    at com.intellij.rt.coverage.util.ReportSection.save(ReportSection.java:61)
    at com.intellij.rt.coverage.util.ReportSectionsUtil.saveSections(ReportSectionsUtil.java:72)
    at com.intellij.rt.coverage.instrumentation.SaveHook.save(SaveHook.java:104)
    at com.intellij.rt.coverage.aggregate.Aggregator.processRequests(Aggregator.java:88)
    at com.intellij.rt.coverage.aggregate.Main.main(Main.java:27)

Whenever I run it locally, I see bunch of messages like:

java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo
...
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 62

CI runs with JDK 17, and I run locally with JDK 18.

shanshin commented 2 years ago

Is your project open source? Reproducer or project code would help to learn the issue.

emartynov commented 2 years ago

Unfortunately, it is not. Let me know if you want to have a full stack trace or any other information.

ununhexium commented 2 years ago

Hi @shanshin

Here is an example. https://github.com/ununhexium/skyscrapers/tree/github.com_Kotlin_kotlinx-kover_issues_179

Removing the rule block inside koverMergedVerify "solved" the issue.

zuevmaxim commented 2 years ago

@ununhexium Thank you a lot for a reproducer! This is a tricky Kotlin inline issue :)

zuevmaxim commented 2 years ago

Fixed in Agent 1.0.669

emartynov commented 2 years ago

Super. Let me try it.

shanshin commented 2 years ago

@emartynov , you can try the new version of the agent by configuring the plugin this way (in the file where the Kover is applied)

kover {
    intellijEngineVersion.set("1.0.669") 
}
emartynov commented 2 years ago

@shanshin Thank you, I already found that DSL :) I will keep you updated

emartynov commented 2 years ago

The build is green, however, I still see an exception in the log about the class version. I run it with Java 18.

zuevmaxim commented 2 years ago

@emartynov Could you please share full error stacktrace?

Rubyj commented 1 year ago

This issue still persists in kover 0.5.1. I had to downgrade to 0.5.0 to fix the issue FYI @zuevmaxim @lars-reimann

zuevmaxim commented 1 year ago

@Rubyj Could you please share a full error stacktrace? Please specify kover version and IJCoverage (kover { intellijEngineVersion.set("1.0.669") }) version that you use. If it is possible, please share a small reproducer or GitHub link to your project that reproduces the issue

ege-ah commented 1 year ago

this happens in 0.6.0 too

zuevmaxim commented 1 year ago

@ege-ah Could you please share a full error stack trace? If it is possible, please share a small reproducer or GitHub link to your project that reproduces the issue

shanshin commented 1 year ago

Feel free to open new bug issue if the problem reproduced again.

JavierSegoviaCordoba commented 1 year ago

I found it after creating a new issue: https://github.com/Kotlin/kotlinx-kover/issues/296