diff --git a/.github/workflows/validate-task.yml b/.github/workflows/validate-task.yml index e0567d2..db8bca1 100644 --- a/.github/workflows/validate-task.yml +++ b/.github/workflows/validate-task.yml @@ -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//. + # 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. - 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 # 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 diff --git a/Directory.Packages.props b/Directory.Packages.props index 1813bcb..d4c69f3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,16 +1,16 @@ - - + + - - - + + + diff --git a/Utilities.slnx b/Utilities.slnx index a0cdada..fe43668 100644 --- a/Utilities.slnx +++ b/Utilities.slnx @@ -9,6 +9,7 @@ + diff --git a/UtilitiesTests/ExtensionsTests.cs b/UtilitiesTests/ExtensionsTests.cs index 63e61d8..aa22f7b 100644 --- a/UtilitiesTests/ExtensionsTests.cs +++ b/UtilitiesTests/ExtensionsTests.cs @@ -93,7 +93,7 @@ public void StringExtension_Compress_WithNullString_ShouldThrow() string? nullString = null; _ = FluentActions - .Invoking(() => nullString.Compress()) + .Invoking(() => nullString!.Compress()) .Should() .Throw(); } @@ -211,7 +211,7 @@ public async Task StringExtension_CompressAsync_WithNullString_ShouldThrow() string? nullString = null; _ = await FluentActions - .Awaiting(() => nullString.CompressAsync()) + .Awaiting(() => nullString!.CompressAsync()) .Should() .ThrowAsync(); } @@ -222,7 +222,7 @@ public async Task StringExtension_DecompressAsync_WithNullString_ShouldThrow() string? nullString = null; _ = await FluentActions - .Awaiting(() => nullString.DecompressAsync()) + .Awaiting(() => nullString!.DecompressAsync()) .Should() .ThrowAsync(); } diff --git a/UtilitiesTests/UtilitiesTests.csproj b/UtilitiesTests/UtilitiesTests.csproj index 6d87d47..210db32 100644 --- a/UtilitiesTests/UtilitiesTests.csproj +++ b/UtilitiesTests/UtilitiesTests.csproj @@ -2,6 +2,10 @@ true ptr727.Utilities.Tests + + Exe + true @@ -12,9 +16,13 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + + + all - runtime; build; native; contentfiles; analyzers; buildtransitive + compile; runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/global.json b/global.json new file mode 100644 index 0000000..7ec050f --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +}