Hi @mickaelcaro
Just want to backtrack a little here. I have the following Jenkins commands:
stage('SonarQube Analysis') {
steps {
withSonarQubeEnv('SonarQube') {
withCredentials([string(credentialsId: 'sonarqube-key', variable: 'sq_key')]) {
sh 'C:/sonar-scanner/SonarScanner.MSBuild.exe begin /key:NAFP-INT /d:sonar.cs.vstest.reportsPaths=**/TestResults/*.trx'
}
}
}
}
stage('Build') {
steps {
powershell label: 'building...', script: 'MsBuild.exe /t:Rebuild'
}
}
stage('Test') {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
powershell label: 'testing...', script: 'vstest.console.exe "C:/Jenkins/workspace/nepractice-int/HealthHome.Tests/bin/Debug/HealthHome.Tests.dll" /Logger:trx /Enablecodecoverage'
}
}
}
stage('End SonarQube Analysis'){
steps {
withSonarQubeEnv('SonarQube') {
withCredentials([string(credentialsId: 'sonarqube-key', variable: 'sq_key')]) {
sh 'C:/sonar-scanner/SonarScanner.MSBuild.exe end'
}
}
}
}
This generates my TestResults folder and inside is the trx, the .trx file has a link to the coverage file:
<UriAttachments>
<UriAttachment>
<A href="SALM\SYSTEM_SALM 2020-03-13 11_26_17.coverage"></A>
</UriAttachment>
</UriAttachments>
This file never seems to be processed by MSBuild and attempted to be converted to the .xml. I have the testagent installed and on the system path and can manually generate this file. But I’m trying to understand why my SonarScanner.MSBuild doesn’t do this as mentioned earlier?