diff --git a/.gitea/workflows/sonarqube.yml b/.gitea/workflows/sonarqube.yml index bd93f3e..15d073a 100644 --- a/.gitea/workflows/sonarqube.yml +++ b/.gitea/workflows/sonarqube.yml @@ -50,29 +50,19 @@ jobs: /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" \ /d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ /d:sonar.exclusions="**/bin/**,**/obj/**" \ + /d:sonar.coverage.exclusions="tests/**,**/*.Tests/**" \ + /d:sonar.cs.opencover.reportsPaths="tests/**/TestResults/**/coverage.opencover.xml" \ /d:sonar.verbose=true - name: 7. Build run: dotnet build Strata.SqlTools.QueryBreakdown.sln --configuration Release - - name: 8. Test plugins endpoint from runner - if: false + - name: 8. Test with coverage run: | - echo "Test 1: curl with token via Basic auth" - curl -s -w "\nHTTP %{http_code}\n" \ - -u "${{ secrets.SONAR_TOKEN }}:" \ - "${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2 - echo "---" - echo "Test 2: curl with token via Bearer auth" - curl -s -w "\nHTTP %{http_code}\n" \ - -H "Authorization: Bearer ${{ secrets.SONAR_TOKEN }}" \ - "${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2 - echo "---" - echo "Test 3: same Java User-Agent the scanner uses" - curl -s -w "\nHTTP %{http_code}\n" \ - -u "${{ secrets.SONAR_TOKEN }}:" \ - -H "User-Agent: ScannerCLI/5.0.2.4997" \ - "${{ secrets.SONAR_HOST_URL }}/api/plugins/installed" | tail -2 - + dotnet test Strata.SqlTools.QueryBreakdown.sln \ + --configuration Release --no-build \ + --settings coverlet.runsettings \ + --collect "XPlat Code Coverage" + - name: 9. SonarScanner End run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"