Skip to content

Commit 4784c91

Browse files
authored
Merge pull request #12 from HodStudio/feature/SonarReports
Adjusts sonar reports (code Coverage + analysis)
2 parents 7b1a736 + e178f6f commit 4784c91

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

coverletArgs.runsettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<DataCollectors>
55
<DataCollector friendlyName="XPlat code coverage">
66
<Configuration>
7-
<Format>cobertura</Format>
7+
<Format>cobertura,opencover</Format>
88
</Configuration>
99
</DataCollector>
1010
</DataCollectors>

scripts/Build.ps1

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function Exec
2222
}
2323
}
2424

25-
$projectPath = ".\src\HodStudio.EntityFrameworkDiffLog\HodStudio.EntityFrameworkDiffLog.csproj"
26-
$libraryOnlySolutionPath = ".\src\HodStudio.EntityFrameworkDiffLog\HodStudio.EntityFrameworkDiffLog.Library.sln"
25+
$projectPath = "$($env:APPVEYOR_BUILD_FOLDER)\src\HodStudio.EntityFrameworkDiffLog\HodStudio.EntityFrameworkDiffLog.csproj"
26+
$libraryOnlySolutionPath = "$($env:APPVEYOR_BUILD_FOLDER)\src\HodStudio.EntityFrameworkDiffLog\HodStudio.EntityFrameworkDiffLog.Library.sln"
2727

2828
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }
2929
if(Test-Path .\testresults) { Remove-Item .\testresults -Force -Recurse }
@@ -61,8 +61,8 @@ dotnet test -c Release --test-adapter-path:. --logger:"nunit;LogFilePath=$($env:
6161
$corePassed = $lastexitcode
6262

6363
echo "Adjust Configuration for Tests 4.5"
64-
Remove-Item -Path ".\src\HodStudio.EntityFrameworkDiffLog.TestsDotNet45\bin\Release\HodStudio.EntityFrameworkDiffLog.TestsDotNet45.dll.config"
65-
Rename-Item -Path ".\src\HodStudio.EntityFrameworkDiffLog.TestsDotNet45\bin\Release\App.Release.config" -NewName "HodStudio.EntityFrameworkDiffLog.TestsDotNet45.dll.config"
64+
Remove-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\src\HodStudio.EntityFrameworkDiffLog.TestsDotNet45\bin\Release\HodStudio.EntityFrameworkDiffLog.TestsDotNet45.dll.config"
65+
Rename-Item -Path "$($env:APPVEYOR_BUILD_FOLDER)\src\HodStudio.EntityFrameworkDiffLog.TestsDotNet45\bin\Release\App.Release.config" -NewName "HodStudio.EntityFrameworkDiffLog.TestsDotNet45.dll.config"
6666

6767
echo "Tests 4.5 version"
6868
.\packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe .\src\HodStudio.EntityFrameworkDiffLog.TestsDotNet45\bin\Release\HodStudio.EntityFrameworkDiffLog.TestsDotNet45.dll --result="$($env:APPVEYOR_BUILD_FOLDER)\TestResults\net45-results.xml"
@@ -134,11 +134,29 @@ echo "Starting Sonar for Library"
134134

135135
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null)
136136
{
137-
exec { & dotnet sonarscanner begin /d:sonar.login="$env:sonartoken" /key:"HodStudio.EntityFrameworkDiffLog" /o:"hodstudio-github" /d:sonar.sources=".\src\HodStudio.EntityFrameworkDiffLog" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.pullrequest.base="$env:APPVEYOR_REPO_BRANCH" /d:sonar.pullrequest.branch="$env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH" /d:sonar.pullrequest.key="$env:APPVEYOR_PULL_REQUEST_NUMBER " /d:sonar.pullrequest.provider="GitHub" /d:sonar.pullrequest.github.repository="$env:APPVEYOR_REPO_NAME" /d:sonar.coverageReportPaths="$($env:APPVEYOR_BUILD_FOLDER)\testresults\SonarQube.xml" }
137+
exec { & dotnet sonarscanner begin `
138+
/d:sonar.login="$env:sonartoken" `
139+
/key:"HodStudio.EntityFrameworkDiffLog" `
140+
/o:"hodstudio-github" `
141+
/d:sonar.sources="$($env:APPVEYOR_BUILD_FOLDER)\src\HodStudio.EntityFrameworkDiffLog" `
142+
/d:sonar.host.url="https://sonarcloud.io" `
143+
/d:sonar.pullrequest.base="$env:APPVEYOR_REPO_BRANCH" `
144+
/d:sonar.pullrequest.branch="$env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH" `
145+
/d:sonar.pullrequest.key="$env:APPVEYOR_PULL_REQUEST_NUMBER " `
146+
/d:sonar.pullrequest.provider="GitHub" `
147+
/d:sonar.pullrequest.github.repository="$env:APPVEYOR_REPO_NAME" `
148+
/d:sonar.coverageReportPaths="$($env:APPVEYOR_BUILD_FOLDER)\testresults\SonarQube.xml" }
138149
}
139150
else
140151
{
141-
exec { & dotnet sonarscanner begin /d:sonar.login="$env:sonartoken" /key:"HodStudio.EntityFrameworkDiffLog" /o:"hodstudio-github" /d:sonar.sources=".\src\HodStudio.EntityFrameworkDiffLog" /d:sonar.host.url="https://sonarcloud.io" /version:"$completeVersion" /d:sonar.coverageReportPaths="$($env:APPVEYOR_BUILD_FOLDER)\testresults\SonarQube.xml" }
152+
exec { & dotnet sonarscanner begin `
153+
/d:sonar.login="$env:sonartoken" `
154+
/key:"HodStudio.EntityFrameworkDiffLog" `
155+
/o:"hodstudio-github" `
156+
/d:sonar.sources="$($env:APPVEYOR_BUILD_FOLDER)\src\HodStudio.EntityFrameworkDiffLog" `
157+
/d:sonar.host.url="https://sonarcloud.io" `
158+
/version:"$completeVersion" `
159+
/d:sonar.coverageReportPaths="$($env:APPVEYOR_BUILD_FOLDER)\testresults\SonarQube.xml" }
142160
}
143161

144162
exec { & dotnet build $libraryOnlySolutionPath -c Release }

0 commit comments

Comments
 (0)