Problem with implementation of Integration tests

31 views
Skip to first unread message

Vladimir Topolev

unread,
Feb 15, 2018, 8:47:21 AM2/15/18
to SonarQube
Hi.

I faced an issue running custom plugin on SonarQube Server via Orchestrator for integration tests.

First of all, the implemented plugin works perfectly when I'm running it using Docker with the latest version of 
SonarQube Server. I can see custom rules on UI and custom rules raise issues properly.

But when the same plugin is launching via Orchestrator, something goes wrong.
It gives me:

> java.lang.IllegalStateException: Failed to activate rule with key 'PYTHON001'. No corresponding rule found in repository with key 'pythoncustom'.
> at org.sonarsource.analyzer.commons.ProfileDefinitionReader.activateRules(ProfileDefinitionReader.java:51)
> at python.plugin.PythonProfile.createProfile(PythonProfile.java:25)
> at org.sonar.server.qualityprofile.RegisterQualityProfiles.profilesByLanguage(RegisterQualityProfiles.java:186)

Could you help me, please. I've spent 3 days and there is no idea how I can fix it.




alban....@sonarsource.com

unread,
Feb 15, 2018, 12:02:50 PM2/15/18
to SonarQube
Hi Vladimir,

In your example, you create a repository of 0 rule and 1 rule template, because of: ( src/main/java/python/plugin/PythonRuleRepository.java:L25 ):
repository.rules().forEach(rule -> rule.setTemplate(true));
And in your profile, you try to add a rule template instead of a rule, so you faced an exception, it's quite normal.
Why did you add this line about "setTemplate" ?

Regards,

Alban

Vladimir Topolev

unread,
Feb 15, 2018, 2:24:40 PM2/15/18
to SonarQube
 Hi, Alban.

Yep, I forgot to delete this row where rules were converted into templates. But it didn't help (I've pushed a new commit where I deleted it).

Thanks for taking the time.


Reply all
Reply to author
Forward
0 new messages