Skip to content

Commit c170ace

Browse files
author
Petr Sramek
committed
lets try it
1 parent 6c98e9a commit c170ace

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

.github/workflows/dotnet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
with:
4444
dotnet-version: 9.x
4545
- name: Test
46-
run: dotnet test ./tests/**/*Tests.csproj --configuration Release --verbosity normal --logger trx --collect:"Code Coverage" --results-directory TestResults
46+
run: dotnet test ./tests/**/*Tests.csproj --configuration Release --verbosity normal --settings unit-test.runsettings --logger trx --collect:"Code Coverage" --results-directory test-results
4747
- name: Upload
4848
uses: actions/upload-artifact@v4
4949
with:
5050
name: test-results
5151
path: |
52-
**/TestResults/*
52+
**/test-results/*

unit-test.runsettings

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- File name extension must be .runsettings -->
3+
<RunSettings>
4+
<DataCollectionRunSettings>
5+
<DataCollectors>
6+
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
7+
<Configuration>
8+
<CodeCoverage>
9+
<Format>coverage</Format>
10+
<!-- Match assembly file paths: -->
11+
<ModulePaths>
12+
<Include>
13+
<ModulePath>.*\.dll$</ModulePath>
14+
</Include>
15+
</ModulePaths>
16+
17+
<!-- Match attributes on any code element: -->
18+
<Attributes>
19+
<Exclude>
20+
<!-- Don't forget "Attribute" at the end of the name -->
21+
<Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>
22+
<Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>
23+
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
24+
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
25+
</Exclude>
26+
</Attributes>
27+
28+
<!-- We recommend you do not change the following values: -->
29+
30+
<!-- Set this to True to collect coverage information for functions marked with the "SecuritySafeCritical" attribute. Instead of writing directly into a memory location from such functions, code coverage inserts a probe that redirects to another function, which in turns writes into memory. -->
31+
<UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
32+
<!-- When set to True, collects coverage information from child processes that are launched with low-level ACLs, for example, UWP apps. -->
33+
<AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
34+
<!-- When set to True, collects coverage information from child processes that are launched by test or production code. -->
35+
<CollectFromChildProcesses>True</CollectFromChildProcesses>
36+
<!-- When set to True, restarts the IIS process and collects coverage information from it. -->
37+
<CollectAspDotNet>False</CollectAspDotNet>
38+
<!-- When set to True, static native instrumentation will be enabled. -->
39+
<EnableStaticNativeInstrumentation>True</EnableStaticNativeInstrumentation>
40+
<!-- When set to True, dynamic native instrumentation will be enabled. -->
41+
<EnableDynamicNativeInstrumentation>True</EnableDynamicNativeInstrumentation>
42+
<!-- When set to True, instrumented binaries on disk are removed and original files are restored. -->
43+
<EnableStaticNativeInstrumentationRestore>True</EnableStaticNativeInstrumentationRestore>
44+
45+
</CodeCoverage>
46+
</Configuration>
47+
</DataCollector>
48+
</DataCollectors>
49+
</DataCollectionRunSettings>
50+
</RunSettings>

0 commit comments

Comments
 (0)