how to publish klocwork results on sonarqube - jenkins

We are running both: Klocwork for C++ and SonarQube for Java and C# projects as a CI process using Jenkins. Since the SonarQube dashboard is much better, I would like to publish Klocwork results on the SonarQube.
Is it possible using some kind of Jenkins plugin? Any other option?

There is a SonarQube plugin for Klocwork available on this updated page: www.emenda.com/klocwork-sonarqube-plugin
You will need to complete the request form on the web page in order to obtain the resource.

To publish Klockwork results in SonarQube you need not a Jenkins plugin but a SonarQube plugin. There appears to be one but I have no experience with it, and the screenshots on the site are quite old.
If you don't have any luck with it, another option would be to develop your own plugin. If you decide to go that route, you can post specific plugin development questions to the SonarQube Google Group.

Related

How to add Sonarqube into Jenkins

I have installed sonar and jenkins. Now I want to add Sonarqube into Jenkins. But in the manage plugins, it doesn't show me the Sonarqube.the display I get
SonarQube is a standalone server. It offers a web user interface to visualize bugs, code smells and vulnerabilities. You cannot include this web-ui SonarQube in Jenkins.
However, you can trigger a scan as part of your Jenkins job. This scan can "send" its findings into a SonarQube installation - either hosted by your own (on-premise), or using the hosting offer at sonarcloud.io.
There are a couple of different ways to include the scanner in your job, but the setup is specific to your programming language and build tools (Maven, VisualStudio, command line, ...). Check the sonarcloud docs for the way, that fit's best to your situation.

How to get jenkins pipeline test results into ReportPortal.io instance?

I have an automated Jenkins workflow that runs and tests a java project. I need to get all the data and results that are outputted by Jenkins into Report Portal (RP).
Initially, I was under the impression that you have to install the ReportPortal.io Jenkins plugin to be able to configure Jenkins to communicate with RP.
However, it appears that the plugin will eventually be deprecated.
According to one of the RP devs, there are APIs that can be used, but investigating them on our RP server does not give very clear instructions on what every API does or if it is what is required to get test data from Jenkins to RP.
How then do I get Jenkins to send all generated data to RP?
I am very familiar with Jenkins, but I am extremely new to Report Portal.
ReportPortal is intended for test execution results collection, not for jenkins logs gathering.
In two words, you need to find reporting agent at their github organization which depends on your testing framework (e.g. junit, testng, jbehave) and integrate it into your project.
Here is example for TestNG framework:
https://github.com/reportportal/example-java-TestNG/

CICD with jenkins and sonarqube

from the last week i am working with jenkins, and its going good but at the end of R&D I have lost of confusion, these are questions which confusingto me.
How to do Continuous Integration with jenkins of Website?
hoe to view Testing analysis reports produced by sonarqube server to my local system?
what happens where all my developers will do commit and push at the same time on repository?
How to deploy my web application on targeted server using jenkins?
How to I use sonarqube to test my website ?
If you are building a .net website, install msbuild plugin in jenkins. Create a jenkins job, add a step checkout your website (git/svn - install required repo plugin). Schedule to run nightly or hourly depending on your needs.
Type in url for your sonarqube server and then you can view the reports.
This is not an issue if your developers are comitting simultaneously. Usually a CI tool such as Jenkins will take care of that.
This is called continuous deployment or continuous delivery. Something like Octopus Deploy can help you if you are deploying .net applications. You can use the tool octo.exe and pass the API key as parameter to deploy to a specific environment.
SonarQube is used as a quality gate for code analysis. It is not a test framework. Try to investigate on how to use selenium framework for automation testing.
I hope that I have answered your questions.

Do I need sonar and sonar runner for Jenkins?

I want to set up Sonar with Jenkins. But I'm not sure if the Sonar site describes two different ways to do this or if there are two necessary steps:
As far as I understood it, it's two different ways. If this is the case, what is the difference and what are the advantages and disadvantages (between the Sonar itself and Sonar runner)?
If you want to analyse a project with SonarQube and Jenkins, here's what you need:
A SonarQube server up and running
A Jenkins server up and running with the SonarQube Scanner for Jenkins installed and configure to point to your SonarQube server
A job configured to run a SonarQube analysis on your project:
Using the default and standard SonarQube Scanner (suitable for most projects)
Using the SonarQube Scanner for MSBuild (for .NET solutions)
Using a post build action for Maven-based projects
Everything is described more in details on the SonarQube Scanner for Jenkins documentation page.

how to publish sonar result in jenkins server, or do we have sonar-report jenkins plugin

There is a sonar plugin for jenkins, it triggers the sonar build inside CI (jenkins), it is useful.
While now I want to see the sonar result inside jenkins without jumping to sonar websites, it is useful if I just want to see some key data for this job.
It could be sonar-report plugin in jenkins.
Do you have similar needs ?
One ugly solution I used so far is to use Sonar Web API.
I add one curl command in the end of job (build steps) to fetch the needed metrics like
curl http://sonar.sh.cn.ao.ericsson.se//api/resources?metrics=qi-quality-index,coverage,test_success_density&resource=54936 --output sonar-result.xml
Then I archive the sonar-result.xml to make it visible inside the job.
You can try using Mashup Portlets plugin for Jenkins to configure the results in Jenkins Dashboard.
PFB URL for the plugin.
URL:- https://wiki.jenkins-ci.org/display/JENKINS/Mashup+Portlets

Resources