[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338436#comment-17338436 ] ASF subversion and git services commented on LUCENE-9188: - Commit 29a6b9f7d0f1e7d2fe2adf0b48c18ad021727b97 in lucene-solr's branch refs/heads/branch_8x from Uwe Schindler [ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=29a6b9f ] Backport of some LUCENE-9188 fixes: Fix import > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Major > Fix For: main (9.0) > > Attachments: LUCENE-9188.patch, report.png, screenshot-1.png > > Time Spent: 8h > Remaining Estimate: 0h > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338429#comment-17338429 ] ASF subversion and git services commented on LUCENE-9188: - Commit 6e57a5f36f727e0fcea60193da443a95d12c01c8 in lucene-solr's branch refs/heads/branch_8x from Robert Muir [ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=6e57a5f ] Backport of some LUCENE-9188 fixes: Ensure NRT tests are running fine > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Major > Fix For: main (9.0) > > Attachments: LUCENE-9188.patch, report.png, screenshot-1.png > > Time Spent: 8h > Remaining Estimate: 0h > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338040#comment-17338040 ] Uwe Schindler commented on LUCENE-9188: --- To run coverage, now the following needs to be done for developers: * check out source * execute {{gradlew coverage}}; usual test parameters can be added, like test filtering * open the report (per module) reported by gradle's log output On Jenkins we have a new job, which runs tests and generates a *combined "overall"* report (all modules in one HTML layout): https://ci-builds.apache.org/job/Lucene/job/Lucene-Coverage-main/ Internals: To run tests with instrumentation, you can also add a system property: {{-Dtests.coverage=true}} to usual test runs (e.g. on Jenkins). This will write JaCoCo database files to the test CWD. It won't generate any report, this is up to you (run Gradle task separately or use your IDE / Jenkins to produce the rport, e.g. by meging all per-module database files into one report). For easy usage, the "per-module" task {{gradlew coverage}} was added. > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Major > Fix For: main (9.0) > > Attachments: LUCENE-9188.patch, report.png, screenshot-1.png > > Time Spent: 7h 10m > Remaining Estimate: 0h > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338036#comment-17338036 ] Uwe Schindler commented on LUCENE-9188: --- The new Jenkins config now looks like this: !screenshot-1.png|width=671,height=668! > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Major > Fix For: main (9.0) > > Attachments: LUCENE-9188.patch, report.png, screenshot-1.png > > Time Spent: 7h 10m > Remaining Estimate: 0h > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17338034#comment-17338034 ] ASF subversion and git services commented on LUCENE-9188: - Commit 06907a2c1272f9004b3b892c3656df53a616462b in lucene's branch refs/heads/main from Robert Muir [ https://gitbox.apache.org/repos/asf?p=lucene.git;h=06907a2 ] LUCENE-9188: Add jacoco code coverage support to gradle (#119) Co-authored-by: Dawid Weiss Co-authored-by: Uwe Schindler > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > Time Spent: 7h > Remaining Estimate: 0h > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17159735#comment-17159735 ] Dawid Weiss commented on LUCENE-9188: - Fair enough, Robert. With the current structure of gradle build adding things like this should be fairly isolated from anything else and it doesn't bother me much, really. I'm sorry I haven't been too active recently. > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17159638#comment-17159638 ] Robert Muir commented on LUCENE-9188: - I still intend to get back and fix this patch up, sorry for the delays. [~dweiss] to answer your question, I think even casually perusing these coverage reports on the existing code is useful. When you see chunks of untested code, there might be dragons. Here is one bug i found doing that (browsing a jenkins-generated report looking for trouble): LUCENE-2627 So it is a bit of a different use-case than when e.g. writing targeted test suite in your IDE? [~sokolov]: +1 to the idea to find a way to generate these reports for code reviews in the future (somehow). IMO we want to minimize the bar for reviewing code: run automated tests and checks, provide basic analysis like this to the reviewer, etc. > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17036404#comment-17036404 ] Michael Sokolov commented on LUCENE-9188: - Thanks for this, [~rcmuir]. I find code coverage helpful when adding new code since it helps you check if you forgotten to write a useful test. In the past I have used IDE's support for it, but it's great to have this option. We don't run tests in GitHub today so we? I suppose if we did this could help with code reviews too > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033554#comment-17033554 ] Robert Muir commented on LUCENE-9188: - We have to pass the last one precisely for the security policy. today that is just how it is setup for ant, so i gave it the property it wanted to get it working... I agree lets see if we can switch it to something like user.dir > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17033549#comment-17033549 ] Dawid Weiss commented on LUCENE-9188: - I'm not really familiar with jacoco - I can imagine test coverage reports can be useful but I don't run them myself. In fact, I ignored jacoco when porting ant code because I didn't think anybody was looking into those reports? Anyway. The patch looks good overall. Minor comments. {code} + // XXX: too many things called "workingDir" in gradle! + def targetDir = "${buildDir}/tmp/tests-cwd" {code} There is an extension property set on each project in defaults-tests.gradle: {code} project.ext { testsCwd = file("${buildDir}/tmp/tests-cwd") {code} so you could replace targetDir with papths referencing that instead. {code} + systemProperty 'junit4.childvm.cwd', workingDir as String {code} I don't think we have to pass this property anymore. This was used by randomizedtesting ant runner to pass cwd for different forked JVMs (because it wasn't known apriori in isolation mode). The property is referenced from security policies but it could just become a reference to ${user.dir}. > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17028592#comment-17028592 ] Robert Muir commented on LUCENE-9188: - There is some remnants of my experimentation here, and the location of the permissions should be organized (as it is not related to ant at all). So still messy, sorry :) > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org
[jira] [Commented] (LUCENE-9188) Add jacoco code coverage support to gradle build
[ https://issues.apache.org/jira/browse/LUCENE-9188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17028589#comment-17028589 ] Robert Muir commented on LUCENE-9188: - Here's a first stab. I had to wrestle with the security permissions but it works. Unfortunately it doesn't help to give just the jacoco agent jar AllPermission so that it can do what it wants, that was the first thing I tried. It is defining new classes and other stuff, and I think there is some gradle stuff mixed in the stacks. With this patch at least it is functional: {noformat} # run tests instrumented and generate the report afterwards. gradlew -p lucene/core test jacocoTestReport -Ptests.coverage=true # open lucene/core/build/reports/jacoco/test/html/index.html in browser {noformat} !report.png! > Add jacoco code coverage support to gradle build > > > Key: LUCENE-9188 > URL: https://issues.apache.org/jira/browse/LUCENE-9188 > Project: Lucene - Core > Issue Type: Task > Components: general/build >Reporter: Robert Muir >Priority: Major > Attachments: LUCENE-9188.patch, report.png > > > Seems to be missing. I looked into it a little, all the documented ways of > using the jacoco plugin seem to involve black magic if you are using "java" > plugin, but we are using "javaLibrary", so I wasn't able to hold it right. > This one should work very well, it has low overhead and should work fine > running tests in parallel (since it supports merging of coverage data files: > that's how it works in the ant build) -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org