Skip to content

Use .NET SDK in two test projects #371

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
merged 3 commits into from
Dec 13, 2022
Merged

Conversation

dougbu
Copy link
Contributor

@dougbu dougbu commented Nov 23, 2022

Use .NET SDK in NetCore.Test project

  • for now, unable to target netcoreapp2.1 in NetCore.Test project
    • Microsoft.Net.Http is not compatible
    • System.Net.Http types have different identities, causing compilation failures
  • switch to use dotnet vstest for any .NET Core assemblies (just one currently)
    • can use Xunit target for all .NET Framework assemblies
  • make XunitXml.TestLogger available for .NET Core App testing
    • use above test logger in repo-level testing
    • integrate w/ tests that use the Xunit target
  • don't import from xunit.msbuild.runner when targeting .NET Core; not needed
  • add $(CopyLocalLockFileAssemblies) to these (now both .NET SDK) test projects
    • xUnit assemblies were not copied (when they should have been) w/o this

Use .NET SDK in Microsoft.TestCommon

  • allows reference in .NET SDK test projects w/o duplicating package references
  • not sure how NetStandard.Test targeted netcoreapp2.1 before

@dougbu dougbu requested review from TanayParikh, MackinnonBuck, javiercn and a team November 23, 2022 21:46
@dougbu dougbu force-pushed the dougbu/Newtonsoft.Json.part4 branch from b7a1be2 to 2cdd25b Compare November 24, 2022 02:36
@dougbu dougbu force-pushed the dougbu/Newtonsoft.Json.part5 branch from e0ccddc to 3a910b7 Compare November 24, 2022 02:36
Base automatically changed from dougbu/Newtonsoft.Json.part4 to main November 24, 2022 03:26
@dougbu dougbu force-pushed the dougbu/Newtonsoft.Json.part5 branch from 3a910b7 to 0e80639 Compare November 28, 2022 05:58
@dougbu
Copy link
Contributor Author

dougbu commented Nov 30, 2022

@wtgodbe and other reviewers, suggest having another look because I needed to change a fair amount to get things working end-to-end.

- for now, unable to target `netcoreapp2.1` in NetCore.Test project
  - Microsoft.Net.Http is not compatible
  - System.Net.Http types have different identities, causing compilation failures
- switch to use `dotnet vstest` for any .NET Core assemblies (just one currently)
  - can use `Xunit` target for all .NET Framework assemblies
- make XunitXml.TestLogger available for .NET Core App testing
  - use above test logger in repo-level testing
  - integrate w/ tests that use the `Xunit` target
- don't import from xunit.msbuild.runner when targeting .NET Core; not needed
- add `$(CopyLocalLockFileAssemblies)` to these (now both .NET SDK) test projects
  - xUnit assemblies were not copied (when they should have been) w/o this
- allows reference in .NET SDK test projects
- rename WebStack.xunit.targets -> WebStack.testing.targets
- rename `Xunit` target -> `TestAssembly`
- move `dotnet vstest` use into new target
  - handle exit codes more consistently
@dougbu dougbu force-pushed the dougbu/Newtonsoft.Json.part5 branch from bd9ec79 to 82f520b Compare December 12, 2022 23:39
@dougbu dougbu merged commit 1e2a82c into main Dec 13, 2022
@dougbu dougbu deleted the dougbu/Newtonsoft.Json.part5 branch December 13, 2022 00:13
@dougbu dougbu added this to the 3.3.0 (5.3.0) milestone Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants