Search code examples
intellij-ideagradlecode-coverage

Tests coverage using Gradle in IntelliJ IDEA


Does anybody knows how to run tests with coverage using Gradle in IntelliJ IDEA? It seems that the option is missing from contextual menu and if invoked from left side of the screen the following problem is reported:

Error running **TestClass**
Cannot find runner for **TestClass**

No Gradle targets are run before import and Build, Execution, Deployment > Build Tools > Gradle > Runner > Delegate IDE build/run actions to gradle option is enabled.


Solution

  • Code coverage is not supported for Gradle test runner in IntelliJ IDEA at the moment, please follow the related request for updates:

    • IDEA-158659 'Run with Coverage' does nothing for Gradle build