Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/validate-task.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,9 +24,11 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# Builds with TreatWarningsAsErrors, so analyzer and code-style warnings fail here.
# --collect drives coverlet.collector to emit Cobertura XML into ./coverage/<guid>/.
# global.json opts dotnet test into Microsoft.Testing.Platform (MTP) mode, the .NET 10 SDK's replacement for
# the VSTest runner; --coverlet drives coverlet.MTP (coverlet.collector's VSTest data collector is silently
# ignored under MTP) to emit Cobertura XML into ./coverage/.
- name: Run unit tests step
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
run: dotnet test --coverlet --coverlet-output-format cobertura --results-directory ./coverage

# Report-only: fail_ci_if_error is false so a Codecov hiccup or an absent token never fails the gate.
- name: Upload coverage to Codecov step
Expand Down
15 changes: 8 additions & 7 deletions Directory.Packages.props
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
<Project>
<ItemGroup>
<PackageVersion Include="AwesomeAssertions" Version="9.5.0" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.6.0" />
<PackageVersion Include="AwesomeAssertions" Version="9.6.0" />
<!-- coverlet.MTP replaces coverlet.collector: the VSTest data collector is silently ignored
under Microsoft.Testing.Platform (MTP0001), so coverage needs the MTP-native extension. -->
<PackageVersion Include="coverlet.MTP" Version="10.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.9.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.11" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.400" />
<PackageVersion Include="ptr727.Utilities" Version="4.0.28" />
<PackageVersion Include="Serilog" Version="4.4.0" />
Expand All@@ -13,8 +15,7 @@
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.11" />
<PackageVersion Include="xunit.analyzers" Version="1.27.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
<PackageVersion Include="xunit.analyzers" Version="2.0.0" />
<PackageVersion Include="xunit.v3" Version="4.0.0" />
</ItemGroup>
</Project>
13 changes: 8 additions & 5 deletions LanguageTagsTests/LanguageTagsTests.csproj
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,12 +11,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!-- coverlet.MTP is a native Microsoft.Testing.Platform extension, not a build-time-only tool
like the VSTest coverlet.collector was: its self-registration codegen needs the package on
this project's own compile-time closure, so IncludeAssets must not exclude "compile" (the
collector's restricted list omitted it, which is fine for a VSTest data collector but
breaks a compiled-against library). PrivateAssets is unrelated to that and stays unset,
since it only controls exposure to downstream consumers, which this test project has none
of. -->
<PackageReference Include="coverlet.MTP" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LanguageTags\LanguageTags.csproj" />
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}