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
9 changes: 7 additions & 2 deletions .github/workflows/validate-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ 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>/.
# dotnet test runs on native Microsoft.Testing.Platform (global.json test.runner); --coverage
# drives Microsoft.Testing.Extensions.CodeCoverage to emit Cobertura XML into ./coverage/.
# --coverage-output names the file explicitly: the default is a GUID basename that
# codecov-action's file finder does not match, so the upload step would silently find nothing.
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
- name: Run unit tests step
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
run: >-
dotnet test --coverage --coverage-output-format cobertura
--coverage-output coverage.cobertura.xml --results-directory ./coverage
Comment thread
ptr727 marked this conversation as resolved.

# 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
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project>
<ItemGroup>
<PackageVersion Include="AwesomeAssertions" Version="9.5.0" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="10.8.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.10" />
<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.301" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.9.0" />
<PackageVersion Include="Serilog" Version="4.4.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="10.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
<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.runner.visualstudio" Version="4.0.0" />
<PackageVersion Include="xunit.v3" Version="4.0.0" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Utilities.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<File Path="cspell.json" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
<File Path="global.json" />
<File Path="LICENSE" />
<File Path="README.md" />
<File Path="version.json" />
Expand Down
6 changes: 3 additions & 3 deletions UtilitiesTests/ExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void StringExtension_Compress_WithNullString_ShouldThrow()
string? nullString = null;

_ = FluentActions
.Invoking(() => nullString.Compress())
.Invoking(() => nullString!.Compress())
.Should()
.Throw<ArgumentNullException>();
}
Expand Down Expand Up @@ -211,7 +211,7 @@ public async Task StringExtension_CompressAsync_WithNullString_ShouldThrow()
string? nullString = null;

_ = await FluentActions
.Awaiting(() => nullString.CompressAsync())
.Awaiting(() => nullString!.CompressAsync())
.Should()
.ThrowAsync<ArgumentNullException>();
}
Expand All @@ -222,7 +222,7 @@ public async Task StringExtension_DecompressAsync_WithNullString_ShouldThrow()
string? nullString = null;

_ = await FluentActions
.Awaiting(() => nullString.DecompressAsync())
.Awaiting(() => nullString!.DecompressAsync())
.Should()
.ThrowAsync<ArgumentNullException>();
}
Expand Down
12 changes: 10 additions & 2 deletions UtilitiesTests/UtilitiesTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<PropertyGroup>
<IsTestProject>true</IsTestProject>
<RootNamespace>ptr727.Utilities.Tests</RootNamespace>
<!-- .NET 10 SDK dropped the VSTest bridge for dotnet test; run xunit.v3 through native
Microsoft.Testing.Platform instead (paired with global.json's "test.runner" setting). -->
Comment thread
qodo-code-review[bot] marked this conversation as resolved.
<OutputType>Exe</OutputType>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AwesomeAssertions" />
Expand All @@ -12,9 +16,13 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
<PackageReference Include="coverlet.collector">
<!-- coverlet.collector is VSTest-only; Microsoft.Testing.Extensions.CodeCoverage is the
native MTP coverage provider (drives the dotnet test coverage flag). -->
<!-- Unlike coverlet.collector, this extension's self-registration code is compiled in, so
"compile" must stay in IncludeAssets. -->
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<IncludeAssets>compile; runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}