Is there a way to get the difference in coverage percentage? My goal is to fail a build when the coverage has decreased.
I can easily get the current coverage percentage and compare it to a threshold number. However I want to compare it to the original coverage percentage.
Currently getting coverage report with gotestsum --junitfile-testcase-classname=short --junitfile-testsuite-name=relative -coverprofile="service.out" ./...
Related
I work with diary data and I am trying to do a multilevel regression with a lagged variable. I try to
predict a binary variable from a continuous variable of the previous day and
To predict a continuous variable from a binary variable of the previous day.
I don't understand how to include this time lag/diary data format into the R code. Also, I do not know how to control for the predictor variable from the same day.
I use the lmer and glmer command for continuous and binary outcomes and so far only level 1 predictors
lmer<-(pred.binary.previousday~outcome.cont.+1(1|level2),data=data)
lmer<-(pred.binary.previousday~outcome.cont.+1(pred.binary.previousday|level2),data=data)
glmer<-(pred.cont.previousday~outcome.binary.+1(1|level2),family(link=binomial),data=data)
AIC did not show a better fit of random coefficients, but that I was expecting. regression results so far were not significant, but maybe that is because I did not write the code correctly.
I am able to generate performance trend report using Jenkins Performance plugin. In performance report what is the significance/meaning of the exponent numbers highlighted in red color in below image. Example -2, +5698, -6657 etc. Not able to find any information related to this
The +value indicates that this build contributed to increase in the response time from the previous build by that 'value'.
Ex: In your case, for the first URI, the average response time increased by +5698 ms, similarly incase of -ve value, it means the current build is faster than the previous by that value. I was able to verify this on my performance trend report.
However i am not sure what the + and - equates to in the "samples" column. Let me know if this works!
Is it possible in SonarQube to calculate code coverage for a delta only?
For instance: a project had 1000 lines yesterday and its unit test coverage results are already in SonarQube. A new commit was pushed today with an extra 100 lines of code and additional test cases. These additional test cases cover 70 of the 100 new lines. Is there a way, possibly using TimeMachine, to retrieve/calculate the code coverage for the delta only? (in this case 70%)
You're looking for "Coverage on New Code", which is calculated against the "Leak period", i.e. the first listing in Administration > General > Differential Views.
Your problem is that differential values are calculated during analysis, so you can't update the leak period value and retroactively get exactly what you described. But narrow the leak period value down from the default 30 days (maybe previous_version?) and you'll get close going forward.
To motivate ourselves to increase code coverage of unit tests, we have defined this rules for coverage:
overall code coverage must be > 80%
overall code coverage must not be less than the last time
code coverage on new code must be > 90%
To fulfill rules 1 and 2 I configured a Quality Gate with these conditions:
"Coverage - value - is less than - 80"
"Coverage - delta since previous analysis - is less than - 0"
For rule 3 I think that the following condition would meet it: "Coverage on new code - value - is less than - 90". But it is not possible to choose a value for this condition, only a delta. What is the meaning of a delta here? New code shouldn't have a delta, because it's new. How must i configure the condition to fulfil rule 3?
By default, SonarQube comes with a predefined Quality Gate that is designed to achieve exactly what you want: progressively make you increase your code coverage.
You can take a look at this "SonarQube way" quality gate on Nemo.
The important line is the one which is highlighted on the screenshot. It means: "The code introduced since the beginning of developments on the current version must be covered at least at 80%". If you admit that you are constantly refactoring and rewriting parts of your code, then ultimately your code will be covered at least at 80%.
I'm using SonarQube 4.2.1 for analyzing maven projects and I'd like to fail the quality gate when the number of issues is higher than the last successful analysis (QG was green).
I'm aware of Fail SonarQube quality gate when coverage decreases but it does not cover all my needs, because the QG would be green also, when build #1 has 5 issues (with QG green), build #2 8 issues and build #3 has 7 issues, which is less than the last analysis but still more than last successful build #1.
Any idea how to do this?
You just have to add the following condition:
Metric: "New issues"
Delta since previous analysis
"Is greater than"
"0" in error