0

I have setup a project with a specific date in sonar.timemachine.period5 in my project.properties file. This usually works perfectly, but sometimes the sonarqube runner doesn't make the comparison.

sonar.timemachine.period5=2015-11-04

Here is a part of the log output from two consecutive sonar-runner analysis:

This one is not comparing against period 5:

10:28:17.546 INFO  - Loaded quality gate 'MyProject'
10:28:17.591 INFO  - Compare to previous analysis (2015-10-26)
10:28:17.596 INFO  - Compare over 30 days (2015-10-24, analysis of Mon Oct 26 09:26:01 CET 2015)
10:28:17.597 INFO  - Compare to previous version (2015-10-26)

while this one is....

10:37:43.996 INFO  - Loaded quality gate 'MyProject'
10:37:44.054 INFO  - Compare to previous analysis (2015-11-23)
10:37:44.060 INFO  - Compare over 30 days (2015-10-24, analysis of Mon Oct 26 09:26:01 CET 2015)
10:37:44.061 INFO  - Compare to previous version (2015-11-23)
10:37:44.062 INFO  - Compare to date 2015-11-04 (analysis of 2015-11-23

Any clues on why this is happening?

The result is that the project sometimes passes the qualitygate when it certainly shouldn't.

Im running SonarQube 5.1.2 and using Sonar-Runner 2.4

Kaj Bonfils
  • 416
  • 4
  • 10

1 Answers1

1

Periods 4 and 5 are not set globally but on the project level. Double-check your first project to make sure it has a valid Period 5 value.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • The periods are set at the project level. Sometimes it works perfectly, other times it doesn't. I have narrowed it down to be some kind of interaction when building multiple chained builds from jenkins. It seems that when one of the previous builds in the chain haven't finished it's sonarqube analysis, this might happen. I know random errors are the worst thing ever, so I'll continue to monitor to see if I can get some kind of clear pattern that can be reproduced. – Kaj Bonfils Nov 28 '15 at 07:58