-
Notifications
You must be signed in to change notification settings - Fork 363
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
add information when measure fails to save #757
Conversation
b261bb9
to
db66229
Compare
this has evolved a bit, in our organization we are collecting 3 levels of coverage. unit, it, and overall (and overall contains a functional coverage + ut +it). sonar does not allow to collect anthing other than unit and it, so we decided to collect the remaining under overall. this gives us a idea of the ammount of coverage we have from all our testing levels. the problem is that this functional coverage builds run only at the weekend, and we decided that its ok to use the measusres from the weekend during the week, so this pr allows to ignore cases where changes in source files can cause mismatch between the coverage and the source files.this is disable by default and in 5.3 it will fail if you try to add a measure to a file that does not contain that line |
I also discovered this issue with SQ 5.3 and temporarily disabled coverage analysis. We also use distributed system for build and test.
should not be introduced. |
I am not so inclined to allow invalid measures to be skipped without I think by default the analysis should fail since this is now the default I also think each case is one case and should be analysed individually. Regarding the 3 suggestions, 2 and 3 are interesting ideas however I think On Sat, Jan 16, 2016, 11:48 Bert [email protected] wrote:
|
I am not sure to break the analysis execution because of synchronization issues. Maybe this is more a philosophical discussion whether reliable execution or accurate measures shall have higher priorities. The error messages will anyway indicate a problem with the coverage report file.
For example one of my project overall analysis runs 7+ hours and I would accept some out-dated measures before executing it again 😟 |
I totally agree with you, that it depends on the team using it. But for On Sat, Jan 16, 2016, 21:11 Bert [email protected] wrote:
|
👌 let us vote on the default behavior. |
Independent how we decide things for overall coverage seems to change anyway:
Default behaviour, also with SQ core it's not consistent at the moment:
|
oh, thats quite bad. i was not aware of this. overall, is the one that causes the most issues. if we dont have it then i am not that interested in this feature. so the discussion is only about if invalid measures should be skipped or fail analysis. i vote for default to fail. @guwirth issues? did you try with 5.3, adding a issue to a line that does not exist? |
@jmecosta there is still this code: https://github.com/SonarOpenCommunity/sonar-cxx/blob/master/sonar-cxx-plugin/src/main/java/org/sonar/plugins/cxx/utils/CxxReportSensor.java private int getLineAsInt(String line, int maxLine) {
int lineNr = 0;
if (line != null) {
try {
lineNr = Integer.parseInt(line);
if (lineNr < 1) {
lineNr = 1;
} else if (lineNr > maxLine) { // https://jira.sonarsource.com/browse/SONAR-6792
lineNr = maxLine;
}
} catch (java.lang.NumberFormatException nfe) {
CxxUtils.LOG.warn("Skipping invalid line number: {}", line);
lineNr = -1;
}
}
return lineNr;
} So I would expect it's ignored? |
No :) I understood you were referring to the core behaviour. And was not On Mon, Jan 18, 2016, 18:34 Günter Wirth [email protected] wrote:
|
fix name read buildlog line by line handle parallel build log
334e64e
to
1c0c396
Compare
@jmecosta think this is no more needed and have to be reworked anyway. I close it. |
got some issues with 5.3, i was usig a old coverage file and was now in 5.3 throwing exceptions because of mismatch lines. this pr adds a bit more information to help debug such cases. functionally it does nothing, same functionality as before