Code review plugin running tests at source code level - devops

I am building a Devops pipeline , where in I am trying to include an extra code review plugin which supports C, C++ and C#. In my pipeline, I already have Sonarqube 6.5 running and it also has the FXCop plugin activated.
So, Sonarqube runs tests at source code level and FXCop runs tests at binary level. Now, I am trying to find out another code review plugin which could be plugged to Sonarqube (Plugin has to run tests at source code level, not binary level).
I thought of choosing StyleCop but it has to be downloaded in my laptop. So, I had to neglect that.
Tried using Source Meter, which is another plugin that runs review tests at source code level but it is not compatible with 6.5 version of Sonarqube (only supported till Sonarqube 4.5 version).
And now, I am running out of plugins which could do the job. Could anyone suggest a plugin that could both be plugged with Sonarqube 6.5 and run source code level review tests?
NOTE: (Should support C, C++ and C#)

You could try SonarQube plug-in for PVS-Studio static source code analyzer for C/C++/C#.

Related

Jar files for DL4J - using DL4J without building using Maven

I want to use DL4J [https://deeplearning4j.org/] and tried the instructions on the setup guide [https://deeplearning4j.org/gettingstarted]. I am facing problems while building using Maven (build failure). Do I need to really use Maven to build everything. I just want to write some basic programs and run the examples which comes with DL4J. I am unable to find a list of jar files which i can import into my project and compile the examples. Any help is appreciated.
The developers suggest to stick to Java 8 to avoid dependency-problems with Maven. If you are using Java 9 or OpenJDK (like on Linux), consider a switch to Java 8 to get Maven running.
You should consider to use IntelliJ IDE which manages automatically dependencies download and integration with maven.
If you're already using IntelliJ try to remove m2 folder (which contains all maven dependencies) and choose auto-import option in settings of the IDE.
You can try to use the last maven version too by download it and then configuring it into settings.
Like gurvinder372 said, more information about your problem should be great for us.

TFS SonarQube Extension is not sending comments to pull requests for JS files

I'm using Visual Studio Team Foundation Server 2015 with SonarQube extension.
It's commenting to pull requests for .cs files but not commenting on JavaScript (jsx) files. When I check the report on the dashboard I can see comments for JS files, so it means, the scanner is analyzing JS files correctly but I couldn't understand why it's not sending comments to pull request.
How can I set it up to command for JS files too?
UPDATE: This is my build definition which linked to pull requests:
1) SonarQube Scanner for MSBuild - Begin Analysis (new)
2) Visual Studio Build (solution of our project)
3) npm install
4) npm run build
5) SonarQube Scanner for MSBuild - End Analysis (new)
As you see there are 2 different projects in the same folder. One of them is .NET project (step 2), another one is a NodeJS project (step 3-4).
PR decoration in TFS/VSTS (i.e. adding comments and updating the status of a PR) used to be supported only for projects built with the Scanner for MSBuild, and with quite some limitations (what you are experiencing is probably one of them).
As a consequence, the support of PR decoration has been removed in the latest version of the TFS/VSTS extension.
We are now working on a proper support of PR decoration, that will work for any project (.NET, Java, JS, ...etc). We are planning to roll this out first on SonarCloud (using the SonarCloud VSTS extension), and in a couple of month on SonarQube (using the SonarQube TFS/VSTS extension).

Alternatives for QC

In my project we are using QC to execute our test cases(QTP), moving forward we would be eliminating QC (for cost reasons).
As far as I explored MSBuild & Jenkins, they would be suitable.
But MSBuild will trigger the execution when a new build pushed to the repository. Also it will automatically test on the latest build.
Is there any other CI tool available to execute test cases through QTP?
I will be executing automation once in a release. Also we install our application by manual since it requires lots of configuration.
Take a look at HP Application Automation Tools.
This plugin basically replaces the need for QC, and is developed by HP.
Create a Jenkins job using this plugin on the same Jenkins installation used to build your code, then you can configure your job to run your tests as soon the code is available (e.g. on a nightly basis).
See here for a helpful guide on how to implement a simple Jenkins job using this plugin.
They also host the code on Github, which is very useful if you need to change the behavior of the plugin to suit your needs.

Does Jenkins support Xcode integration

Has anyone used Jenkins in Xcode for code management and automated deployment ? If yes, how can it be integrated ? How does automated deployment work with Jenkins ? Went through the documentation but didn't get much idea.
I went through the Jenkins plugins for iOS but not clear if we can publish the build to AppStore using any plugin.
We are using a Jenkins Server for Continuos Integration, by fetching the source from an SVN Server when the Jenkins is triggered by Commits to this repositories.
But, to be serious, i wouldn't recommend the jenkins... i'd rather use xcode server/bots to get rid of all the hassle with the jenkins...
fastlane is a tool for iOS and Android developers to automate tedious tasks like generating screenshots, dealing with provisioning profiles and releasing your application.
https://github.com/fastlane/fastlane
xctool is a replacement for Apple's xcodebuild that makes it easier to test iOS and Mac products. It's especially helpful for continuous integration.
https://github.com/facebook/xctool
The term "Jenkins in Xcode for code management" seems not fully correct. Because Jenkins server is for CI, in which we config it (create a job) that will fetch the source code from your repository (SVN, GIT), then compile it and run, probably execute your unit tests, UI automation tests or code coverage tool.
Based on your schedule, Jenkins server will automatically start its job or is triggered whenever there is a change in your repo (anybody commits the code for example).
The tool you mentioned which in Xcode is probably XCode Bots, the built-in CI tool.
In order to set up, firstly, you have to install and config XCode server. After that, connecting your server with your repositories. Secondly, creates a bot with your customize configuration and run it.
In my opinion in term of Jenkins and Xcode comparison, I would say that it depends on what tools or add-in functions that you want to set up for your CI server. Jenkins has many plugins might helpful like check style, measure code coverage while Xcode bot still having some limitation.
This document https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/ for your further reference.
I hope this would be helpful to you.
There is a gem called xcpretty, you can use it to output JUnit format test result, then use Jenkins JUnit Plugin to show the result.
Install xcpretty
gem install xcpretty
Use xcpretty to create junit format xml file
xcodebuild test ... | xcpretty --report junit --output [path_to_save]/unit_test_result.xml
Then this unit_test_result.xml can be used to report by Jenkins JUnit Plugin

Sonar Runner OS X

I'm currently looking at how to start using SonarQube as part of a Jenkins build process for building mobile apps.
Because we are building mobile apps our Jenkins runs on OS X so we can support iOS.
We have a Sonar server running on a windows box elsewhere on the network so all we need to do from the OS X box is send the files that relate to the analysis.
What is the best way of doing that? Using the Sonar Runner jar? If so where is the best place to source that from?
EDIT
I should have added that we are using Jenkins Workflow in our build scripts, this means it isn't easy for us to use plugins that don't support the simple build step, as I believe Sonar doesn't.
This is why we really need information on how to do Sonar analysis from the command line.
EDIT
I appreciate that Sonar uses Java but I am definitely seeing different behaviour on OS X as opposed to Windows.
On Windows the Sonar Runner script works, whereas on OS X it times out, I'm able to verify it isn't a network issue since I can get to the Sonar server though the browser.
Regarding the OS, it's all Java code, so OS is a non-issue.
Regarding using Jenkins, take a look at SonarQube Scanner for Jenkins. It will let you configure your server information and add analysis as a Build Step to a job.
Short of that, you can run an analysis from the command line by installing SonarQube Scanner, cd-ing to your project root and invoking sonar-runner.

Resources