Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get code coverage from running process #202

Closed
michael-arndt-gcx opened this issue Aug 9, 2022 · 5 comments
Closed

Get code coverage from running process #202

michael-arndt-gcx opened this issue Aug 9, 2022 · 5 comments
Assignees
Labels
Feature Feature request issue type Kover Coverage Tool Kover Gradle Plugin S: postponed Status: work on the issue is not in the short term plans

Comments

@michael-arndt-gcx
Copy link

With jacoco it's possible to use a java agent to get coverage at runtime. This enables collecting coverage during integration and end-to-end tests. I don't see an option like this with kover yet?

More precisely we're building OCI images (using build packs / bootBuildImage) and then run tests against a running container.

@shanshin
Copy link
Collaborator

shanshin commented Aug 9, 2022

Hi, do you mean to get statistics via network ports?

@shanshin shanshin added the Feature Feature request issue type label Aug 23, 2022
@shanshin shanshin self-assigned this Oct 27, 2022
@shanshin shanshin added the S: postponed Status: work on the issue is not in the short term plans label Oct 27, 2022
@shanshin shanshin added this to the Release 0.8.0 milestone Oct 27, 2022
@Kantis
Copy link

Kantis commented Jan 17, 2023

You can instrument the system-under-test with a java agent (not sure how multiplatform support can be achieved). The java agent then provides execution data either over a TCP connection, or by dumping the execution data to the filesystem, which can then be aggregated with data from other sources. (For instance unit test coverage collected in usual way).

@Jonatha1983
Copy link

@Kantis can you please add some more details/example on how to instrument a JVM?
I have an IntelliJ plugin with ui test that includes 2 processes- 1 the ide to test
2 the ui test
I would like to collect the coverage for the this scenario

Thanks

@Kantis
Copy link

Kantis commented Nov 28, 2023

@Jonatha1983 you would add
-javaagent:$jacocoJarPath=destfile=$pathWhereYouWantCoverageData/jacoco-it.exec,includes=com.mypackages.*" to the arguments which you start the java process under test with. It all depends a bit on the rest of the infrastructure of your project.

@shanshin feel free to remove this comment if it derails the discussion too much.

@shanshin shanshin removed this from the Release 0.8.0 milestone Jan 3, 2025
@shanshin
Copy link
Collaborator

shanshin commented Jan 3, 2025

Closed as irrelevant due to migration to JaCoCo.

@shanshin shanshin closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type Kover Coverage Tool Kover Gradle Plugin S: postponed Status: work on the issue is not in the short term plans
Projects
None yet
Development

No branches or pull requests

4 participants