- Notifications
You must be signed in to change notification settings - Fork 1
Migrate Test Project to Native Microsoft.Testing.Platform#448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
| - 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 | ||
ptr727 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| # 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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). --> | ||
qodo-code-review[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| <OutputType>Exe</OutputType> | ||
| <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="AwesomeAssertions" /> | ||
| @@ -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> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "test": { | ||
| "runner": "Microsoft.Testing.Platform" | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.