I have a web server application that I am running inside IntelliJ. I want to run the server with code coverage, then execute an external test harness that will make requests, and see how much of the code is executed by those requests.
I can generate the correct code coverage when running unit tests from within the IDE, but when I run with Code Coverage on and execute with an external harness, I get all 0's for code coverage.
If I run the web app in the debugger instead, it triggers breakpoints as expected, so I know that code is being executed.
Please help!
I had the same issue. Clicking Stop to end the process results in all 0% coverage, presumably due to the process not getting a chance to tidy up and generate results:
Stop Click this button to terminate the current process externally by means of the standard mechanisms.
Clicking Exit instead allows the coverage to generate properly:
Exit Click this button to terminate the current process gracefully using in-process internal mechanisms.
See here for more detail: https://www.jetbrains.com/idea/webhelp/test-runner-tab.html#
This solution worked for me:
Go to IntelliJ Toolbar --> View --> ToolWindows --> Coverage. A Window wil appear on the right side. Here you can delete Classes from the list by selecting them and hit the red X on the bottom left corner.
Got 0% coverage in ur IDEA?
Maybe you are viewing coverage per class. Try to switch it OFF using this little button:
Edit:
This button is supposed to show/switch coverage per test. It only appears, when you run your tests "with coverage" and it is located on toolbar of a Run panel (Alt + 4).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With