Skip to content

Commit

Permalink
test: Fix code coverage generation
Browse files Browse the repository at this point in the history
  • Loading branch information
VMelnalksnis committed Feb 19, 2024
1 parent b7337ec commit f4c711a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 9 deletions.
5 changes: 0 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PublishSingleFile>true</PublishSingleFile>
<DebuggerSupport>false</DebuggerSupport>
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
<TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
<StripSymbols>true</StripSymbols>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
Expand Down
1 change: 1 addition & 0 deletions Gnomeshade.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{367D9DDB
ProjectSection(SolutionItems) = preProject
tests\.editorconfig = tests\.editorconfig
tests\Directory.Build.props = tests\Directory.Build.props
tests\coverlet.runsettings = tests\coverlet.runsettings
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gnomeshade.TestingHelpers", "tests\Gnomeshade.TestingHelpers\Gnomeshade.TestingHelpers.csproj", "{CFFBE37B-AD26-4D48-AC8F-655D735732A4}"
Expand Down
3 changes: 0 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
ignore:
- "**/*.axaml"

comment:
layout: "header, diff, components"

Expand Down
5 changes: 5 additions & 0 deletions deployment/publish.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ $dotnetArgs = $dotnetArgs + "--self-contained"
$dotnetArgs = $dotnetArgs + "--no-restore"
$dotnetArgs = $dotnetArgs + "-p:AssemblyVersion=$version.$RunNumber"
$dotnetArgs = $dotnetArgs + "-p:InformationalVersion=$version$Tag+$Runtime"
$dotnetArgs = $dotnetArgs + "-p:DebuggerSupport=false"
$dotnetArgs = $dotnetArgs + "-p:DebugSymbols=false"
$dotnetArgs = $dotnetArgs + "-p:DebugType=None"
$dotnetArgs = $dotnetArgs + "-p:TrimmerRemoveSymbols=true"
$dotnetArgs = $dotnetArgs + "-p:StripSymbols=true"
$dotnetArgs = $dotnetArgs + "/warnAsError"
$dotnetArgs = $dotnetArgs + "/nologo"

Expand Down
5 changes: 5 additions & 0 deletions deployment/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ dotnet publish \
--no-restore \
-p:AssemblyVersion="$version.$3" \
-p:InformationalVersion="$version$4$2" \
-p:DebuggerSupport=false \
-p:DebugSymbols=false \
-p:DebugType=None \
-p:TrimmerRemoveSymbols=true \
-p:StripSymbols=true \
/warnAsError \
/nologo

Expand Down
12 changes: 11 additions & 1 deletion deployment/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@
set -e

./deployment/build.sh
dotnet test -p:CollectCoverage=true -p:BuildInParallel=true -m:8 --configuration Release --collect:"XPlat Code Coverage" --no-build
dotnet test \
-p:CollectCoverage=true \
-p:BuildInParallel=true \
-p:ContinuousIntegrationBuild=false \
-p:DebugType=portable \
-p:CopyLocalLockFileAssemblies=true \
-m:8 \
--configuration Release \
--collect:"XPlat Code Coverage" \
--settings ./tests/coverlet.runsettings \
--no-build
12 changes: 12 additions & 0 deletions tests/coverlet.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Include>[Gnomeshade.*]*</Include>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>

0 comments on commit f4c711a

Please sign in to comment.