Has anyone has success make the "Run with Coverage" work for pants projects in Intellij? I am using latest version of IntelliJ with latest pants plugin but it would always fail.
I am able to run pants command line for code coverage successfully with: "./pants clean-all test backend: --test-junit-coverage-open". In the same time I am able to run junit tests within Intellij for my pants projects.
But when I do "Run with Coverage" for junit tests within Intellij, it runs tests successfully, then a dialog pops up with "Project is out of date" title, if I click "cancel" then nothing happens, if I click "OK" then it opens the Coverage tab, right after that it prints exception message like below and no coverage information will be given:
Error:Internal error: (com.twitter.intellij.pants.PantsException) This is a Pants project. Please use PantsCompile under `Edit Configuration`
com.twitter.intellij.pants.PantsException: This is a Pants project. Please use PantsCompile under `Edit Configuration`
at com.twitter.intellij.pants.jps.incremental.serialization.PantsJpsProjectExtensionSerializer.loadExtension(PantsJpsProjectExtensionSerializer.java:28)
at com.twitter.intellij.pants.jps.incremental.serialization.PantsJpsProjectExtensionSerializer.loadExtension(PantsJpsProjectExtensionSerializer.java:14)
at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadComponents(JpsLoaderBase.java:62)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadFromDirectory(JpsProjectLoader.java:124)
at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:101)
at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:41)
at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:79)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:267)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Any idea on how to fix this? This would be really helpful for me to see what's not covered right within IntelliJ.
Thanks,
Frank