How to get code coverage to ADD coverage data to the active suite?

已回答

I'm very frustrated.  I want to use IntelliJ's code coverage while manually testing (i.e. not with test files) my project.  I've configured it as shown in the online documentation, and I'm getting the colouring in the LH gutter.  All good.  But it seems to be hit and miss as to whether the coverage data for the current test run (Run->Run 'Project' with Coverage) gets added to that from previous runs.  I have wasted hours on this to no avail.

The only way I can figure out to reliably get it to happen is after each test run, to go to the coverage folder in the IDE System Directory, manually move that file elsewhere, and then in IntelliJ, use Run->Show Coverage Data, add all the old coverage data files to the little window, select their checkboxes, and finally press Show Selected.  This is a huge waste of time!!!

My coverage settings are as follows:

 

But the dialog box only comes out sometimes after a test run, not every time, and I cannot figure out what is wrong!

I have also tried setting it to "Add to the active suites" and this works for a while and then stops.

Please, what do I have to do to get coverage to actually work in an incremental fashion with manual testing?

Many TIA!

0

Hi Ski Addict, this dialog you mentioned could be changed at:

 

File | Settings | Build, Execution, Deployment | Coverage. If this is not your case, may you please record a screencast of it and upload them to https://uploads.jetbrains.com and provide the upload id here.

0

Thanks Jacky, I set it to the first option after finding that "Add to the active suites" was not working reliably, so that I would know each time a test's data had been added.  But even this option does not seem to work reliably!  Sometimes I get the dialog box after a test, sometimes I don't.

I'm not sure what you would like a screencast of, please let me know and also is this something that IDEA does, or do you simply mean a screen recording as produced by my Mac?

BTW system details are as follows:

IntelliJ IDEA 2023.2 (Community Edition)
Build #IC-232.8660.185, built on July 26, 2023
Runtime version: 17.0.7+7-b1000.6 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.6.8
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
    ide.allow.merge.buttons=false
    debugger.valueTooltipAutoShowOnSelection=true

Kotlin: 232-1.9.0-IJ8660.185

 

Thanks again!

0

Hi Ski Addict, sorry for the late reply. I mean a project demo that is before and after and take a video or multi screenshot for the problem.

0

Hi Jacky, thanks for this, I have emailed you.

0

请先登录再写评论。