Hi G Ann Campbell,
You were correct. There was a mismatch between the paths specified in the files and the actual path. Once I ran the following command again, it threw a new error.
C:\SonarQube\bin\SonarScanner.MSBuild.exe begin /k:AnalyticsW.sln /n:AnalyticsW.sln /v:22.1.0 /d:sonar.cfamily.threads=8 /d:sonar.cfamily.build-wrapper-output=cfamily-output /d:sonar.testExecutionReportPaths=C:\
Temp\AnalyticsCoreTests.exe.xml,C:\Temp\AnalyticsNativeTests.exe.xml,C:\Temp\AnalyticsWTests.exe.xml
Error:
ERROR: Error during SonarScanner execution
ERROR: Error during parsing of generic test execution report 'C:\Temp\AnalyticsCoreTests.exe.xml'. Look at the SonarQube documentation to know the expected XML format.
ERROR: Caused by: Line 3 of report refers to a file which is not configured as a test file: C:\Product\HedgeRx\Dev\Components\RevalAnalytics\AnalyticsCoreTests\BasicBarriersTest_CmBarrierOpts.cpp
ERROR:
The SonarScanner did not complete successfully
05:59:00.126 Post-processing failed. Exit code: 1
So I searched again and found this issue: Error "file is not configured as a test file".
The folder structure of my Analytics Solution is like this:
The highlighted folders consist of test files. So after referring to the above-mentioned post, I updated my Sonar Begin command(added sonar.tests.inclusions property) and executed it:
C:\SonarQube\bin\SonarScanner.MSBuild.exe begin /k:AnalyticsW.sln /n:AnalyticsW.sln /v:22.1.0 /d:sonar.cfamily.threads=8 /d:sonar.cfamily.build-wrapper-output=cfamily-output /d:sonar.testExecutionReportPaths=C:\
Temp\AnalyticsCoreTests.exe.xml,C:\Temp\AnalyticsNativeTests.exe.xml,C:\Temp\AnalyticsWTests.exe.xml /d:sonar.tests.inclusions=AnalyticsCoreTests/**/*,AnalyticsNativeTests/**/*,AnalyticsWTests/**/*
but this still throws the Line 3 of report refers to a file which is not configured as a test file: C:\Product\HedgeRx\Dev\Components\RevalAnalytics\AnalyticsCoreTests\BasicBarriersTest_CmBarrierOpts.cpp error
So I tried the following variation(added /d:sonar.exclusions property):
C:\SonarQube\bin\SonarScanner.MSBuild.exe begin /k:AnalyticsW.sln /n:AnalyticsW.sln /v:22.1.0 /d:sonar.cfamily.threads=8 /d:sonar.cfamily.build-wrapper-output=cfamily-output /d:sonar.testExecutionReportPaths=C:\
Temp\AnalyticsCoreTests.exe.xml,C:\Temp\AnalyticsNativeTests.exe.xml,C:\Temp\AnalyticsWTests.exe.xml /d:sonar.tests .inclusions=AnalyticsCoreTests/**/*,AnalyticsNativeTests/**/*,AnalyticsWTests/**/* /d:sonar.exclusions=AnalyticsCoreTests/**/*,AnalyticsNativeTests/**/*,AnalyticsWTests/**/*
But this just ended ignoring all the files like before.
Can you please guide what should be the correct SonarQube Begin command?