Date issue with rule common-js:FailedUnitTests

36 views
Skip to first unread message

hoagi...@gmx.net

unread,
Sep 1, 2017, 2:40:31 AM9/1/17
to SonarQube
Hi all,

Since the update to Version 6.5 (at least we noticed it now) there seems to be an issue with the rule common-js:FailedUnitTests.

Today, we received notice about a failing unit test. So far so good, but inside the Ticket, the creation date is mentioned to be the 30.08.2017. But the test just failed today (01.09.2017). 



What we noticed however is, that the date mentioned by the ticket is exactly the last change date of the corresponding test. 


Is this the expected behavior? For us it feels more like a bug.

Kind regards

Holger

G. Ann Campbell

unread,
Sep 1, 2017, 8:01:03 AM9/1/17
to SonarQube, hoagi...@gmx.net
Hi Holger,

Has this rule been in your profile all along, or did you just add it?


Thx,
Ann

hoagi...@gmx.net

unread,
Sep 1, 2017, 8:13:46 AM9/1/17
to SonarQube, hoagi...@gmx.net
Hi Ann,

thanks for picking up my request. We have this rule active since quite some time, so no it has not just been activated.

Best regards

Holger

G. Ann Campbell

unread,
Sep 6, 2017, 7:43:52 AM9/6/17
to SonarQube, hoagi...@gmx.net
Hi Holger,

Sorry for the delay. One reason for it is that I was doing a little checking.

So first, backdating is a feature, not a bug. Really. :-D

We've actually put a fair amount of work lately into backdating issues under certain circumstances. What I had to check on tho was your particular circumstances because I wouldn't have expected backdating under them. Here's how it should work in 6.5:

* Activate a new rule in the profile
* New rule raises issues throughout code base in next analysis
* "New" issues raised on old code by the new rule are backdated to when the line was last touched

6.6 will include further refinements, but this is the behavior you should be seeing, which is why I asked if the rule was new in your profile.

Could you send me the result of this web service call, please?

api/rules/search?rule_key=common-js:FailedUnitTests&f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true


Thx,
Ann

hoagi...@gmx.net

unread,
Sep 6, 2017, 11:05:23 AM9/6/17
to SonarQube, hoagi...@gmx.net
Dear Ann,

many thanks for your update. I think it is clear what happened now.

Please find the requested data below. What I did not mention so far is, that we have an issue with the profiles since a couple of versions. They tend to loose all rule activation after an update. Therefore we export all profiles before making the update and afterwards re-import them. After your explanations, I think this is the reason that triggers the backdating. Anyhow, I agree with you, that this specific rule should not have backdating. Is this going to be changed in 6.6 already?

Thanks for your help, very much appreciated.

Regards

Holger



{"total":1,"p":1,"ps":100,"rules":[{"key":"common-js:FailedUnitTests","repo":"common-js","name":"Failed unit tests should be fixed","createdAt":"2016-04-05T15:16:23+0200","severity":"MAJOR","lang":"js","params":[],"type":"BUG"}],"actives":{"common-js:FailedUnitTests":[{"qProfile":"AV44SIUaydYo8kzFcTr1","inherit":"NONE","severity":"MAJOR","params":[],"createdAt":"2017-08-31T14:33:50+0200"},{"qProfile":"AV44SLIXydYo8kzFcTwF","inherit":"NONE","severity":"MAJOR","params":[],"createdAt":"2017-08-31T14:34:01+0200"}]},"qProfiles":{"AV44SIUaydYo8kzFcTr1":{"name":"QA h.com, no ES6","lang":"js","langName":"JavaScript"},"AV44SLIXydYo8kzFcTwF":{"name":"QA h.com, with ES6","lang":"js","langName":"JavaScript"}}}

G. Ann Campbell

unread,
Sep 6, 2017, 11:11:18 AM9/6/17
to hoagi...@gmx.net, SonarQube
Hi Holger,

Thanks for sharing the results of the web service call. I'm glad you've figured it out.

I didn't mean to imply that that rule shouldn't have backdating. What I meant was that under the circumstances you listed, I wouldn't have expected backdating to kick in. There are no plans to carve out exceptions to backdating for specific rules. 

Feel free to start a new thread about your problem with profiles. What you describe is an unexpected behavior.


Ann





---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/VWvuTtn2wzM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/d4a4a22a-1f52-4433-a3df-7b273408b994%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages