I am trying to get the analysis from pipeline yml, I used SonarQube to get the coverage results, but its failing in the test project build.
Error Message:
System.InvalidOperationException : XXXX doesn’t look like a Refit interface. Make sure it has at least one method with a Refit HTTP method attribute and Refit is installed in the project.
Stack Trace:
at Refit.RestService.GetGeneratedType(Type refitInterfaceType) in //Refit/RestService.cs:line 100
at Refit.RestService.For(Type refitInterfaceType, HttpClient client, IRequestBuilder builder) in //Refit/RestService.cs:line 36
at Refit.RestService.For[T](HttpClient client, IRequestBuilder`1 builder) in //Refit/RestService.cs:line 13
at Refit.RestService.For[T](HttpClient client, RefitSettings settings) in //Refit/RestService.cs:line 20
at Refit.RestService.For[T](String hostUrl, RefitSettings settings) in /_/Refit/RestService.cs:line 27
"
SonaQube Task
- task: SonarQubePrepare@4.11.0
inputs:
SonarQube: ‘SonarQube’
scannerMode: ‘MSBuild’
projectKey: ‘Key’
projectName: ‘Name’
projectVersion: ‘$(GitVersion.SemVer)’
extraProperties: |
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml
Test Project Task
- task: DotNetCoreCLI@2
displayName: Run Tests
inputs:
command: ‘test’
projects: ‘**/[Tt]ests/.csproj’
arguments: ‘–configuration $(buildConfiguration) --collect:“XPlat Code Coverage” – DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura,opencover’
Note : Refit package version - 6.0.38
Did I missed anything? Please share your thoughts