SonarQube VSTS Marketplace Extension - tfs

I downloaded the extension from
https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarqube#review-details,
for TFS 2015 on premise, installed it in my collection and created and end point. Then I configured 2 steps as indicated before and after my build, I am getting the following error
[error]The MSBuild.SonarQube.Runner executable could not be found. Check that the build definition includes a SonarQube Pre-Build step
My sonar server Version is 5.6.3 running on Linux fedora. Do I need to install any other tools? I understand that The SonarQube Extension embeds its own version of the SonarQube Scanner for MSBuild. The first step before the build executes correctly, the build succeed but the end step fails.
Thanks in advance for your help

Related

sonarqube 8.9.2 with tfs 2015 build integration - is it posible?

I'm using sonarqube 8.9.2 and TFS2015 update 4.
in 8.9.2 there is no c# plugin as it's built-in.
when trying to run the sonarqube step of the build I get an error saying the SonarQube.MSBuild.Runner.Implementation.zip is missing.
##[error]Could not find a file on the SonarQube server. Url: http://XXXXXXXXXX/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip
2021-09-02T14:34:22.7202456Z ##[error]Failed to update the SonarQube MSBuild Runner binaries. Check the server url, verify that the C# plugin is correctly installed on the SonarQube server and that the SonarQube server has been restarted.
2021-09-02T14:34:22.7202456Z ##[error]Pre-processing failed. Exit code: 1
2021-09-02T14:34:22.7360027Z ##[error]Unexpected exit code received from batch file: 1
the only thing I can find in the configuration is the Azure DevOps configuration in the ALM section but I'm using a local TFS 2015.
I've seen this post and the relevant answer but in 8.9 there is no C# plugin - Not able to integrate TFS 2015 with SonarQube
is it possible to integrate?
p.s,
I tried working with an older version of sonarqube (7.9.X) only to find there are issues with compatibility.
I installed v9 only to find that there is a bug in the latest releases and it will not start.
getting sick of this and starting to think I need to build a script that will run it manually.
thanks for your help,
Shay

TFS 2017 + Sonarqube

We have a on prem installation of TFS (TFS 2017) and I am attempting to integrate SonarQube analysis into our build steps. I have installed the SonarQube extension on the TFS server and added a service endpoint to point to a server where I have SonarQube Server installed and configured.
When I attempting to trigger a build, I am getting an error "No agents could be found with the following capabilities: msbuild, java, visualstudio". Does my build server need JRE to be installed to get the SonarQube build steps to work? SonarQube website says this:
**Installation
Make sure the .NET Framework v4.5.2+ is installed
Make sure the Java Runtime Environment 8 is installed
Install the extension from the marketplace**
Both the error message and the documentation told you the same thing: You need Java installed.
I will be the third source of confirmation: You need Java installed.
First, the official document is very clear here: Make sure the Java Runtime Environment 8 is installed
Besides, according to your prompting error message:
No agents could be found with the following capabilities: msbuild,
java, visualstudio
You are also lacking msbuild, visualstudio. Not only need Java installed, but also need Visual Studio installed on your build agent, then restart the build agent. Restarting the build agent will capture the added Capabilities. If this not work, reconfigure the build agent should do the trick.
The build agent will not detect the environment changes after you installed it. It will only detect during the installation. If you are using vNext build agent, also try to manually add some capabilities in Settings- Agent Queues- Agent Pool - Agent- Capabilities. After this trigger the build again.
Note: if you are running on TFS earlier than 2017 Update 2, you will need to download and manually install the latest 3.x version of the VSIX to install SonarQube Extension.

TFS 2015 - Build failed due to exception in the test assemblies

I am trying to run a newly created Build in TFS but i am getting an error as shown in the screenshot below :
Build Configuration
I tried to debug the Unit Test project on my machine and even on the TFS server, it worked fine. So i am not able to understand if there is any configuration missing or issue in the test assemblies code?
Update
Since VS is installed after the build agent configured. Then reregister the build agent with TFS, since the system capabilities are only discovered when the agent is first configured -- any changes made after that are not captured.
First you could also Enable Verbose Debug Mode for TFS Build vNext by add system.debug=true to get more detail log info for trobuleshooting.
According to your build log and configuration, the error occurs after code coverage warning.
Try to uncheck the code coverage option and trigger the build again.
As a prerequisite to using Code Coverage, the first thing to do is to install Visual Studio Enterprise version on the build agent.
I had installed Build Agent before installing Visual Studio. Re-configuring the Build Agent resolved the issue.

TFS 2015:No agent could be found with the following capabilities: msbuild, visualstudio, vstest

We have recently upgraded to TFS 2015 Update 4. When I tried to do a build, I am getting the following error:
There are issues with the request or definition that may prevent the build from running:No agent could be found with the following capabilities: msbuild, visualstudio, vstest Queue the build anyway?
I tried the workaround mentioned in this link, but still couldn't figure out.
I have installed VS 2017 Enterprise in the Build Machine. Note, that since this is a POC I have installed Build Agent on the TFS Server itself.
Should anything extra be need to be installed? Please help.
TIA
You could double check if you are missing some capabilities such as VSTEST_15.0 for the build agent.
Settings- Agent Queues- Agent Pool - Agent- Capabilities
If the test related capabilities are missing, you could try to reregister the build agent. Or manually add the capabilitie by select +.
Recently I had the same issue: installed VS2017, configured build agent, visualstudio and msbuild capabilities missing.
Try installing VS2015 next to VS2017. Re-configure the build agent after this (in my case, I completely removed all the old _diag, _work and settings.json data as well). This fixed the issue for me, the missing capabilities were now recognized.
I was getting the same error out of the blue and it was running fine the previous week.
Restarting the build agent service resolved the error for me

Restore nuget package Jenkins

When I tried to use Jenkins as our CI environment to build ASP.NET MVC5 project, I set up to use MSBuild.exe to build project.
But when the cmd run into restore nuget packages, it stucked. The error message is as below:
WARNING: Unable to connect to the remote server
Unable to find version '3.4.1.9004' of package 'Antlr'.
Build step 'Execute Windows batch command' marked build as failure
But if I use windows command line to run the msbuild, it is working and could download the pkg from nuget.org. Error only happened when try to build in Jenkins. And my network is fine, but behind a company proxy/firewall, I am not sure what it is. And I have set to auto restore nuget package in VS2013.
Any idea is much more appreciated.
I finally found out the root cause, it is the Jenkins service has not enough access right. Open windows services and right click on the Jenkins service, in the security tab, change the default user to whom that has enough access right to the Internet.

Resources