-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Analyzer missing hook to filter classes using Agent includes/excludes settings #930
Comments
The
If I understand your issue correctly this is the core of the request. Actually the way how class files are provided to the |
I'm using the API, not Ant, not the maven plugin.
I've fixed the issue. I understand completely how it works. The agent uses
include/exclude patterns to instrument code, while the Report API has to
reproduce the exact same filtering except based on the file system.
If your report is for a spring boot war that includes a hundred jars, you
have to explode the war, explode the jars into directories and figure out
where the classes are and filter paths using file system paths.
This is all unnecessary, if you just make the change I made. Then you can
run using the exact same includes/excludes strings as the Agent.
There is an outstanding Jenkins bug related to this issue.
Bottom line is you have two different mechanisms for selecting Classes and
only one of them works well, which is the Agent. The Report class selection
is a painful exercise left to the user.
…On Thu, Aug 29, 2019, 2:37 AM Marc R. Hoffmann ***@***.***> wrote:
The Analyzeris used during report generation. It is typically used in a
different stage of the build and in a different JVM that the JaCoCo agent.
Therefore the Analyzer has no access to the agent's includes and excludes
settings.
Otherwise Reports coverage is incorrectly calculated when directories
containing Jars are analyzed (unless you manually explode the jars and
exclude classes yourself).
If I understand your issue correctly this is the core of the request.
Actually the way how class files are provided to the Analyzer highly
depends on the integration (Ant, Maven, CLI, ...). Maybe you can describe
your setup a bit more in detail so we can get an understanding of your use
case: What integration are you using? How does your setup look like? What
classes are you going to filter (why?).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#930?email_source=notifications&email_token=AAFBIMKGNMMCC5IYYPKLTGDQG5VCDA5CNFSM4IR52V4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5NNJKQ#issuecomment-526046378>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFBIMPMJ47YP76VIWGBKH3QG5VCDANCNFSM4IR52V4A>
.
|
org.jacoco.core.analysis.Analyzer should include a way to skip (short circuit) analyzing classes based on
the values used by the JaCoCo agent's includes and excludes settings.
Otherwise Reports coverage is incorrectly calculated when directories containing Jars are analyzed (unless you manually explode the jars and exclude classes yourself). I've solved this issued using the change below:
Note this Filter implementation only handles includes and excludes.
It does not account for options.getExclClassloader(),options.getInclBootstrapClasses(), or options.getInclNoLocationClasses().
The text was updated successfully, but these errors were encountered: