-
Notifications
You must be signed in to change notification settings - Fork 30
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
Computing Portfolio fails due to Pitest plugin #25
Comments
As per SonarSource support: |
Since the error is about expecting an int and getting a double, my guess would be that the issue is with MUTATIONS_KILLED_RATIO / MUTATIONS_KILLED_PERCENT_KEY, since Metric.ValueType.PERCENT is of type Double |
@johankees I will fix this when I return from vacation next week. |
Thanks @bradflood For now I've "fixed" this by surrounding "sum += m.getIntValue();" with a try/catch clause, which allowed me to log the above statement. Hope this helps... Thanks! |
@johankees great! it looks as if you have a handle on what needs to be fixed, and have built the code. If you want to attempt a fix, that would be great. Send a pull request and we can review it together. |
PR 26 submitted and merged to catch IllegalStateException when metric is of type Double (as is the case when the metric is killed percent). This issue is kept open until a more general solution is in place. Specifically, we cannot assume that all metrics in the list are integers; when a Portfolio is being computed, a percentage killed will have been calculated and added to the list. Need a deeper understanding that is reflected in PitestComputer and corresponding test. |
Hi,
With SonarQube v6.7 we see issues with computing portfolios when the pitest plugin is installed. The background task fails with the following error:
org.sonar.server.computation.task.projectanalysis.component.VisitException: Visit of Component {key=KEY_NAME,type=VIEW} failed
.....
Caused by: java.lang.IllegalStateException: Value can not be converted to int because current value type is a DOUBLE
at org.sonar.server.computation.task.projectanalysis.api.measurecomputer.MeasureImpl.checkValueType(MeasureImpl.java:80)
at org.sonar.server.computation.task.projectanalysis.api.measurecomputer.MeasureImpl.getIntValue(MeasureImpl.java:50)
at org.sonar.plugins.pitest.PitestComputer.compute(PitestComputer.java:79)
at org.sonar.plugins.pitest.PitestComputer.compute(PitestComputer.java:57)
Odd thing is that this happens for nested portfolios, but not for single portfolios. For example, this will work file
PortfolioA
But this fails
Portfolio1 <-- Fails here
Here portfolio A and the configured projects are the same in both cases. It will fail on the top level portfolio btw (Portfolio1).
The text was updated successfully, but these errors were encountered: